#!/bin/sh # kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script fi ### BEGIN INIT INFO # Provides: pagure-webhook-server # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: # Description: # <...> # <...> ### END INIT INFO # Author: Sergio Durigan Junior DESC="pagure" DAEMON="/usr/lib/pagure/pagure-webhook-server/pagure-webhook-server.py" PIDFILE="/var/run/pagure/pagure-webhook-server.pid" U="git" test -x "${DAEMON}" || exit 0 . /lib/lsb/init-functions case "${1}" in start) start-stop-daemon --start --background -m --oknodo --pidfile $PIDFILE --chuid ${U}:${U} --exec $DAEMON ;; stop) start-stop-daemon --stop --pidfile $PIDFILE --oknodo --exec ${DAEMON} rm -f $PIDFILE ;; restart) ${0} stop ${0} start ;; status) status_of_proc "${DAEMON}" "Pagure WebHook Server" ;; *) echo "Usage: ${0} {start|stop|restart|status}" exit 1 ;; esac exit 0