[lxc-devel] [lxcfs/stable-2.0] Add reload in service scripts
theredcat on Github
lxc-bot at linuxcontainers.org
Thu Jun 8 16:16:42 UTC 2017
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 463 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170608/3599ae72/attachment.bin>
-------------- next part --------------
From ef3bc959c174d660ccd3cec77a6d7d05ad73f5e9 Mon Sep 17 00:00:00 2001
From: Nathan Delhaye <the at red.cat>
Date: Sat, 3 Jun 2017 13:49:29 +0200
Subject: [PATCH 1/2] Add reload command for sysv init script
---
config/init/sysvinit/lxcfs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/config/init/sysvinit/lxcfs b/config/init/sysvinit/lxcfs
index 21a9c61..4d70bda 100755
--- a/config/init/sysvinit/lxcfs
+++ b/config/init/sysvinit/lxcfs
@@ -80,6 +80,13 @@ case "$1" in
fi
status_of_proc -p ${PIDFILE} "${DAEMON}" lxcfs
;;
+
+ reload)
+ if init_is_upstart; then
+ exit 1
+ fi
+ kill -USR1 $(cat /var/run/lxcfs.pid)
+ ;;
restart|force-reload)
if init_is_upstart; then
From 5cfc1b910dc7b39cefb92447bb66d36239f5713a Mon Sep 17 00:00:00 2001
From: Nathan Delhaye <the at red.cat>
Date: Sat, 3 Jun 2017 13:50:42 +0200
Subject: [PATCH 2/2] Add reload command to systemd script
---
config/init/systemd/lxcfs.service | 1 +
1 file changed, 1 insertion(+)
diff --git a/config/init/systemd/lxcfs.service b/config/init/systemd/lxcfs.service
index 95e3ee9..af20e5a 100644
--- a/config/init/systemd/lxcfs.service
+++ b/config/init/systemd/lxcfs.service
@@ -10,6 +10,7 @@ KillMode=process
Restart=on-failure
ExecStopPost=-/bin/fusermount -u /var/lib/lxcfs
Delegate=yes
+ExecReload=/bin/kill -USR1 $MAINPID
[Install]
WantedBy=multi-user.target
More information about the lxc-devel
mailing list