From ba4470a022c022e43f170c20b43f428e4f5e3d9d Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Sun, 27 Oct 2013 12:21:17 +0100 Subject: [PATCH] Improve glusterfsd.service to start and stop successfully Resolves: 1022542 --- glusterfs.spec | 3 +++ glusterfsd.service | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/glusterfs.spec b/glusterfs.spec index 9478f4b..9c710e2 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -765,6 +765,9 @@ if [ $1 -ge 1 ]; then fi %changelog +* Sun Oct 27 2013 Niels de Vos +- Correctly start+stop glusterfsd.service (#1022542) + * Sat Oct 26 2013 Niels de Vos - add base-port config option to /etc/glusterd/glusterd.vol (#1023653) diff --git a/glusterfsd.service b/glusterfsd.service index 4454ad8..e25405d 100644 --- a/glusterfsd.service +++ b/glusterfsd.service @@ -1,12 +1,16 @@ [Unit] -Description=GlusterFS an clustered file-system server +Description=GlusterFS brick processes (stopping only) After=network.target glusterd.service [Service] -Type=forking -PIDFile=/run/glusterfsd.pid -LimitNOFILE=65536 -ExecStart=/usr/sbin/glusterfsd -p /run/glusterfsd.pid +Type=oneshot +# glusterd starts the glusterfsd processed on-demand +# /bin/true will mark this service as started, RemainAfterExit keeps it active +ExecStart=/bin/true +RemainAfterExit=yes +# if there are no glusterfsd processes, a stop/reload should not give an error +ExecStop=/bin/sh -c "/bin/killall --wait glusterfsd || /bin/true" +ExecReload=/bin/sh -c "/bin/killall -HUP glusterfsd || /bin/true" [Install] WantedBy=multi-user.target