pagure/debian/pagure-milters.init

54 lines
1.2 KiB
Bash

#!/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-milters
# 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 <sergiodj@sergiodj.net>
DESC="pagure"
DAEMON="/usr/bin/python2 /usr/share/pagure/pagure-milters/comment_email_milter.py"
PIDFILE="/var/run/pagure/pagure-milters.pid"
test -x "${DAEMON}" || exit 0
. /lib/lsb/init-functions
case "${1}" in
start)
start-stop-daemon --start --background -m --oknodo --pidfile $PIDFILE --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 Milters"
;;
*)
echo "Usage: ${0} {start|stop|restart|status}"
exit 1
;;
esac
exit 0