From c666bfee8848183ccbc566c9e0fa019088e56505 Mon Sep 17 00:00:00 2001 From: Jonathon Weiss Date: Thu, 10 Nov 2016 17:06:18 -0500 Subject: [PATCH] Prevent double-starting client on RHEL7 On RHEL7 if the AFS client is stopped with 'service openafs-client stop', but that fails for some reason (most commonly because some process has a file or directory in AFS open) systemd will decide that the openafs-client is in a failed state when it is actually running. If one then runs 'service openafs-client start' systemd will start a new AFS client. At this point AFS access will continue to work until the functional AFS client is (successfully) stopped, at which point a reboot is required to recover. Have systemd check the status of 'fs sysname' before starting the AFS client, so we avoid getting into a state that requires a reboot. Change-Id: I28a5cca746823d69183ea5ce65c10e1725009c5c Reviewed-on: https://gerrit.openafs.org/12443 Tested-by: BuildBot Reviewed-by: Michael Meffie 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 cc206318c..09379bea3 100644 --- a/src/packaging/RedHat/openafs-client.service +++ b/src/packaging/RedHat/openafs-client.service @@ -8,6 +8,7 @@ Before=remote-fs.target Type=forking RemainAfterExit=true EnvironmentFile=/etc/sysconfig/openafs +ExecStartPre=/bin/bash -c "fs sysname > /dev/null 2>/dev/null; test $? -ne 0 || (echo AFS client appears to be running -- not starting && exit 1)" 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 ExecStartPre=/sbin/modprobe openafs -- 2.39.5