Page MenuHomePhabricator
Paste P1866

/etc/init.d/phd
ActivePublic

Authored by joshuaspence on Oct 15 2015, 1:57 AM.
Referenced Files
F879912: /etc/init.d/phd
Oct 15 2015, 1:57 AM
Subscribers
None
#!/bin/sh
### BEGIN INIT INFO
# Provides: phd
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Wrapper around the Phabricator Daemon launcher.
### END INIT INFO
NAME="phd"
DAEMON="/usr/src/phabricator/bin/$NAME"
DESC="Phabricator Daemon launcher"
# Include defaults if available
if [ -r /etc/default/phd ]; then
. /etc/default/phd
fi
# Exit if the package is not installed.
test -x $DAEMON || exit 0
# Load the VERBOSE setting and other rcS variables.
. /lib/init/vars.sh
# Define LSB log_* functions.
. /lib/lsb/init-functions
case "$1" in
start)
$DAEMON status --local >/dev/null 2>&1 && {
echo "Unable to start daemons because daemons are already running." >&2
exit 1
}
$DAEMON launch 'fact' || exit $?
$DAEMON launch 'trigger' || exit $?
$DAEMON launch 'taskmaster' || exit $?
$DAEMON launch 'repository' -- --no-discovery || exit $?
exit 0
;;
stop)
$DAEMON stop || exit $?
exit 0
;;
status)
$DAEMON status --local || exit $?
exit 0
;;
list)
$DAEMON list || exit $?
exit 0
;;
restart)
$0 stop || exit $?
$0 start || exit $?
exit 0
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|status|list|restart}" >&2
exit 1
;;
esac
exit $RETVAL

Event Timeline

joshuaspence changed the title of this paste from untitled to /etc/init.d/phd.
joshuaspence updated the paste's language from autodetect to autodetect.
joshuaspence added a project: Daemons.
joshuaspence updated the paste's language from autodetect to bash.Oct 15 2015, 1:59 AM