#!/bin/sh ### BEGIN INIT INFO # Provides: s6 # Required-Start: $remote_fs $syslog nftables # Required-Stop: $remote_fs $syslog nftables # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start s6 service supervision suite # Description: Start s6 service supervision suite ### END INIT INFO NAME="s6" 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 if test -f /etc/default/${NAME}; then . /etc/default/${NAME} fi . /lib/init/vars.sh . /lib/lsb/init-functions case "$1" in start) if $0 status > /dev/null ; then log_success_msg "$NAME is already running" else log_daemon_msg "Starting ${DESC}" "${NAME}" /sbin/start-stop-daemon \ --start \ --oknodo \ --chdir "${SCANDIR}" \ --startas "${DAEMON}" \ --background \ --make-pidfile \ --pidfile "${PIDFILE}" \ -- "${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 log_end_msg $? ;; force-reload|restart) $0 stop $0 start ;; status) status_of_proc -p ${PIDFILE} ${DAEMON} s6 && exit 0 || exit $? ;; *) echo "Usage: ${SCRIPTNAME} {start|stop|restart|force-reload|status}" exit 1 ;; esac exit 0