From 9e0e55215ded6f461b3d69e7afba30005a267b64 Mon Sep 17 00:00:00 2001 From: Erwei Deng Date: Sat, 2 Apr 2022 17:56:49 +0800 Subject: [PATCH] contrib: fix the bug when remove the scheduler rpm The system maybe crashed before the installation files of the RPM could be written to disk if the scheduler.ko module has BUGs. And after reboot, removing the RPM will fail because the scheduler-install script file can not be found. See the error log: # rpm -e scheduler-xxx Uninstalling scheduler /var/tmp/rpm-tmp.HgRsuX: line 4: /usr/local/bin/scheduler-install: No such file or directory error: %preun(scheduler-xxxxxxx.x86_64)scriptlet failed, exit status 1 error: scheduler-xxxxxxx.x86_64: erase failed So, it is necessary to write the files to disk before installing the kernel module. Signed-off-by: Erwei Deng --- module-contrib/scheduler.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module-contrib/scheduler.spec b/module-contrib/scheduler.spec index f55b20c..2a22641 100644 --- a/module-contrib/scheduler.spec +++ b/module-contrib/scheduler.spec @@ -66,6 +66,8 @@ install -m 644 %{SOURCE5} %{buildroot}%{_localstatedir}/plugsched/%{KVER}-%{KREL #install kernel module after install this rpm-package %post +sync + if [ $1 == 1 ]; then echo "Installing scheduler" systemctl daemon-reload -- Gitee