puppet: Start supervisord if it isn't running on restart.

This commit is contained in:
Tim Abbott
2016-06-28 21:06:43 -07:00
parent 058d0ab0ec
commit 809a45394f

View File

@@ -21,8 +21,11 @@ class zulip::supervisor {
# the changed configuration until you do an "update" (I assume
# this is so you can check if your config file parses without
# doing anything, but it's really confusing)
#
# Also, to handle the case that supervisord wasn't running at all,
# we check if it is not running and if so, start it.
hasrestart => true,
restart => "bash -c 'supervisorctl reread && supervisorctl update'"
restart => "bash -c 'if pgrep -f supervisord >/dev/null; then supervisorctl reread && supervisorctl update; else /etc/init.d/supervisor start; fi'"
}
file { "/etc/supervisor/supervisord.conf":