diff --git a/overlay/etc/sv/apache/run b/overlay/etc/sv/apache/run index 4a62b5a..d71c5cd 100755 --- a/overlay/etc/sv/apache/run +++ b/overlay/etc/sv/apache/run @@ -1,11 +1,5 @@ #!/bin/sh -set -eu - -echo -n "Removing Apache HTTPD PID file before starting it ..." -(rm -f /var/run/apache2/httpd.pid || true) -echo "OK" - . /usr/sbin/envvars # TODO Check about cache diff --git a/overlay/etc/sv/rsyslog/run b/overlay/etc/sv/rsyslog/run index 97d2f1d..fd8ead3 100755 --- a/overlay/etc/sv/rsyslog/run +++ b/overlay/etc/sv/rsyslog/run @@ -2,8 +2,4 @@ set -eu -echo -n "Removing rsyslogd PID file before starting it ..." -(rm -f /var/run/rsyslogd.pid || true) -echo "OK" - exec rsyslogd -n -f /etc/rsyslog.conf diff --git a/overlay/usr/local/bin/start_nagios b/overlay/usr/local/bin/start_nagios index 9016f68..240bdd9 100755 --- a/overlay/usr/local/bin/start_nagios +++ b/overlay/usr/local/bin/start_nagios @@ -1,5 +1,7 @@ #!/bin/sh +set -eu + # adapted from https://github.com/discourse/discourse_docker/blob/master/image/base/boot # this script becomes PID 1 inside the container, catches termination signals, and stops # processes managed by runit @@ -19,6 +21,16 @@ if [ ! -f "${NAGIOS_HOME}/etc/htpasswd.users" ] ; then chown -R ${NAGIOS_USER}.${NAGIOS_GROUP} "${NAGIOS_HOME}/etc/htpasswd.users" fi +# Remove pid files + +echo -n "Removing Apache HTTPD PID file before starting it ..." +(rm -f /var/run/apache2/httpd.pid || true) +echo "OK" + +echo -n "Removing rsyslogd PID file before starting it ..." +(rm -f /var/run/rsyslogd.pid || true) +echo "OK" + shutdown() { echo Shutting Down ls /etc/service | SHELL=/bin/sh parallel --no-notice sv force-stop {}