From cb8195d2d6ce1c01e132c05c1bf5593eab45b2c6 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 2 Sep 2014 17:51:46 -0500 Subject: [PATCH] systemd: RemainAfterExit in openafs-client.service Currently, if the client is started without any options that require an extra thread (like -afsdb), all processes spawned by afsd will exit. There may be some kernel threads still active, but those are spawned by the kernel module, and are not child processes of the parent afsd process, or anything like that. Since we are a Type=forking service in systemd, systemd interprets this situation to mean that the service has stopped successfully, and then runs the ExecStop commands. So, for example, if our AFSD_ARGS in our sysconfig is "-fakestat -afsdb", the service starts as normal. But if it is changed to "-fakestat", then when openafs-client.service is started, it immediately stops again. To avoid this, turn on the systemd option RemainAfterExit, which tells systemd that the service has not stopped if all of our processes have exited. The client service will thus remain running until it is stopped. Issue reported by Rich Sudlow. Change-Id: If760d3617d4afbcfac923df726eb58b03ce25771 Reviewed-on: http://gerrit.openafs.org/11440 Tested-by: BuildBot Reviewed-by: Anders Kaseorg Reviewed-by: Benjamin Kaduk --- src/packaging/RedHat/openafs-client.service | 1 + 1 file changed, 1 insertion(+) diff --git a/src/packaging/RedHat/openafs-client.service b/src/packaging/RedHat/openafs-client.service index 1a34c0c17..cc206318c 100644 --- a/src/packaging/RedHat/openafs-client.service +++ b/src/packaging/RedHat/openafs-client.service @@ -6,6 +6,7 @@ Before=remote-fs.target [Service] Type=forking +RemainAfterExit=true EnvironmentFile=/etc/sysconfig/openafs ExecStartPre=/bin/sed -n 'w/usr/vice/etc/CellServDB' /usr/vice/etc/CellServDB.local /usr/vice/etc/CellServDB.dist ExecStartPre=/bin/chmod 0644 /usr/vice/etc/CellServDB -- 2.39.5