Remove the pid files outside and before the runit scripts (#8,#13)

This commit is contained in:
Christos Manios 2020-02-29 15:18:22 +02:00
parent 5c5ad86c13
commit 47ecd6f422
3 changed files with 12 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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 {}