X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=files%2Fetc%2Finit.d%2Fs6;h=238b0b6c642cbfa4a84a0f326aeea058a7933a6e;hb=HEAD;hp=a30790887b7c2be042331722e35bb03d3c5822d3;hpb=a94410eb468f5c9f79dacbf36d52b036b8159884;p=user%2Fhenk%2Fcode%2Fpuppet%2Fmodules%2Fs6.git diff --git a/files/etc/init.d/s6 b/files/etc/init.d/s6 index a307908..238b0b6 100644 --- a/files/etc/init.d/s6 +++ b/files/etc/init.d/s6 @@ -15,7 +15,6 @@ DESC="s6 system service supervision suite" DAEMON="/usr/local/bin/s6-svscanboot" SCANDIR="/etc/s6-scandir/" DAEMON_ARGS=${SCANDIR} -PIDFILE="/var/run/s6.pid" SCRIPTNAME="/etc/init.d/${NAME}" test -x $DAEMON || exit 0 @@ -36,35 +35,20 @@ case "$1" in /sbin/start-stop-daemon \ --start \ --oknodo \ - --chdir "${SCANDIR}" \ - --startas "${DAEMON}" \ --background \ - --make-pidfile \ - --pidfile "${PIDFILE}" \ + --chdir "${SCANDIR}" \ + --exec "${DAEMON}" \ -- "${DAEMON_ARGS}" log_end_msg $? fi ;; stop) log_daemon_msg "Stopping ${DESC}" "${NAME}" - /sbin/start-stop-daemon \ - --stop \ - --oknodo \ - --retry TERM/60/QUIT/60 \ - --remove-pidfile \ - --pidfile "${PIDFILE}" - if test $? = 2; then - /sbin/start-stop-daemon \ - --stop \ - --oknodo \ - --retry TERM/60/KILL/10 \ - --exec /usr/bin/s6-svscan - /sbin/start-stop-daemon \ - --stop \ - --oknodo \ - --retry TERM/60 \ - --exec /usr/bin/s6-supervise - fi + /usr/bin/s6-svscanctl -t "${SCANDIR}" + while $0 status + do + sleep 0.1 + done log_end_msg $? ;; force-reload|restart) @@ -72,7 +56,22 @@ case "$1" in $0 start ;; status) - status_of_proc -p ${PIDFILE} ${DAEMON} s6 && exit 0 || exit $? + /usr/bin/s6-svscanctl "${SCANDIR}" + exitcode=$? + case "$exitcode" in + 0) + log_success_msg "$NAME is running" + return ${exitcode} + ;; + 100) + log_failure_msg "$NAME is not running" + return ${exitcode} + ;; + *) + log_failure_msg "$NAME has some problem, exit code was ${exitcode}" + return ${exitcode} + ;; + esac ;; *) echo "Usage: ${SCRIPTNAME} {start|stop|restart|force-reload|status}"