Fix up the fedmsg handler. Ticket https://pagure.io/fedora-infrastructure/issue/6550
Just change the conditional script to use systemctl try-restart and hopefully it will do what we want.
This commit is contained in:
parent
3896b82982
commit
e621c76c8f
2 changed files with 10 additions and 21 deletions
|
@ -15,20 +15,20 @@
|
|||
action: service name=crond state=restarted
|
||||
|
||||
- name: restart fedmsg-gateway
|
||||
command: /usr/local/bin/conditional-restart.sh fedmsg-gateway fedmsg-gateway
|
||||
command: /usr/local/bin/conditional-restart.sh fedmsg-gateway
|
||||
|
||||
- name: restart fedmsg-hub
|
||||
command: /usr/local/bin/conditional-restart.sh fedmsg-hub fedmsg-hub
|
||||
command: /usr/local/bin/conditional-restart.sh fedmsg-hub
|
||||
# Note that, we're cool with arbitrary restarts on bodhi-backend02, just
|
||||
# not bodhi-backend01 or bodhi-backend03. 01 and 03 is where the releng/mash
|
||||
# stuff happens and we # don't want to interrupt that.
|
||||
when: inventory_hostname not in ['bodhi-backend01.phx2.fedoraproject.org', 'bodhi-backend03.phx2.fedoraproject.org']
|
||||
|
||||
- name: restart fedmsg-irc
|
||||
command: /usr/local/bin/conditional-restart.sh fedmsg-irc fedmsg-irc
|
||||
command: /usr/local/bin/conditional-restart.sh fedmsg-irc
|
||||
|
||||
- name: restart fedmsg-relay
|
||||
command: /usr/local/bin/conditional-restart.sh fedmsg-relay fedmsg-relay
|
||||
command: /usr/local/bin/conditional-restart.sh fedmsg-relay
|
||||
|
||||
- name: restart koji-sync-listener
|
||||
action: service name=koji-sync-listener state=restarted
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
#!/bin/bash
|
||||
# Restart SERVICE only if PACKAGE is installed.
|
||||
# We use this throughout handlers/restart_services.yml
|
||||
#
|
||||
# We use this to try and restart a service.
|
||||
# If it's not running, do nothing.
|
||||
# If it is running, restart it.
|
||||
#
|
||||
|
||||
SERVICE=$1
|
||||
PACKAGE=$2
|
||||
|
||||
rpm -q $PACKAGE
|
||||
|
||||
INSTALLED=$?
|
||||
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
echo "Package $PACKAGE installed. Attempting restart of $SERVICE."
|
||||
/sbin/service $SERVICE restart
|
||||
exit $? # Exit with the /sbin/service status code
|
||||
fi
|
||||
|
||||
# If the package wasn't installed, then pretend everything is fine.
|
||||
echo "Package $PACKAGE not installed. Skipping restart of $SERVICE."
|
||||
exit 0
|
||||
/usr/bin/systemctl try-restart $1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue