From 02c3e2fca35ec2c0ad7fbca42ab95ba3d1c41e77 Mon Sep 17 00:00:00 2001 From: zhangsong234 Date: Tue, 15 Dec 2020 02:23:33 +0800 Subject: [PATCH] Fix uninstall error when service not stopped Signed-off-by: zhangsong234 (cherry picked from commit 446c42dfedb183a366fe7d588d98c696fa404bbc) --- lxcfs.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lxcfs.spec b/lxcfs.spec index f6d5a99..2e00b3a 100644 --- a/lxcfs.spec +++ b/lxcfs.spec @@ -4,7 +4,7 @@ #Basic Information Name: lxcfs Version: 4.0.5 -Release: 1 +Release: 3 Summary: FUSE filesystem for LXC License: Apache-2.0 URL: http://linuxcontainers.org @@ -57,10 +57,11 @@ install -d -m 0755 %{buildroot}%{_localstatedir}/lib/lxc/%{name}/ %pre %preun +%systemd_preun lxcfs %post -ret=`systemctl is-active lxcfs` -if [ "$ret" == "active" ]; then +systemctl status lxcfs | grep 'Active:' | grep 'running' +if [ $? -eq 0 ]; then systemctl restart lxcfs fi -- Gitee