diff options
author | Kevin Fenzi <kevin@scrye.com> | 2017-03-02 15:33:05 +0000 |
---|---|---|
committer | Kevin Fenzi <kevin@scrye.com> | 2017-03-02 15:33:05 +0000 |
commit | 6c253445a34571e0d65cb9f9d0ff6bb4a84604ff (patch) | |
tree | 50fcc83b89773774e0d6096df24dca93aa3e3a78 | |
parent | c5f9d31e06b62e60f00a0f6bbbec99a80086c389 (diff) | |
download | ansible-6c253445a34571e0d65cb9f9d0ff6bb4a84604ff.tar.gz ansible-6c253445a34571e0d65cb9f9d0ff6bb4a84604ff.tar.xz ansible-6c253445a34571e0d65cb9f9d0ff6bb4a84604ff.zip |
rework our conditional reload script to handle systemctl reload changes
-rw-r--r-- | roles/base/files/common-scripts/conditional-reload.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/roles/base/files/common-scripts/conditional-reload.sh b/roles/base/files/common-scripts/conditional-reload.sh index b9aecdb10..988a08b05 100644 --- a/roles/base/files/common-scripts/conditional-reload.sh +++ b/roles/base/files/common-scripts/conditional-reload.sh @@ -10,9 +10,15 @@ rpm -q $PACKAGE INSTALLED=$? if [ $INSTALLED -eq 0 ]; then - echo "Package $PACKAGE installed. Attempting reload of $SERVICE." - /sbin/service $SERVICE reload - exit $? # Exit with the /sbin/service status code + echo "Checking if $SERVICE is running" + /sbin/service $SERVICE status >& /dev/null + if [ $? == 0 ]; then + echo "Package $PACKAGE installed and running. Attempting reload of $SERVICE." + /sbin/service $SERVICE reload + exit $? # Exit with the /sbin/service status code + fi + echo "Package $PACKAGE is install, but $SERVICE is not running, skipping..." + exit 0 fi # If the package wasn't installed, then pretend everything is fine. |