Skip to content

Commit

Permalink
Fixes #9875: Better docker service restart
Browse files Browse the repository at this point in the history
Improve the check for the docker service in order to restart it if
needed. Also check for systemd based system first and then fall back to
the service based utilities.
  • Loading branch information
elyezer committed Mar 23, 2015
1 parent a525598 commit af4751a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions templates/rhsm-katello-reconfigure.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,14 @@ if [ -d $CA_TRUST_ANCHORS ]; then
cp $KATELLO_CERT_DIR/$KATELLO_CERT $CA_TRUST_ANCHORS
update-ca-trust

#restart if docker service is installed
service docker status >/dev/null && \
# restart docker if it is installed and running
if [ -f /usr/lib/systemd/system/docker.service ]; then
systemctl status docker >/dev/null && \
systemctl restart docker >/dev/null 2&>1
elif [ -f /etc/init.d/docker ]; then
service docker status >/dev/null && \
service docker restart >/dev/null 2&>1
fi
fi

# restart goferd if it is installed and running
Expand Down

0 comments on commit af4751a

Please sign in to comment.