/etc/init.d/mini-buildd is in mini-buildd 1.0.5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | #!/bin/sh -e
### BEGIN INIT INFO
# Provides: mini-buildd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start mini-buildd daemon
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/mini-buildd
NAME=$(basename "${DAEMON}")
DESC="custom Debian build daemon"
DEFAULT_FILE="/etc/default/mini-buildd"
# Defaults
MINI_BUILDD_OPTIONS="--verbose"
PIDFILE=~mini-buildd/.mini-buildd.pid
if [ -e "${DEFAULT_FILE}" ]; then
. "${DEFAULT_FILE}"
fi
[ -x "${DAEMON}" ] || exit 0
# Note: If the locale is not set to UTF-8 encoding when python
# starts, python subprocess will not work with non-ascii unicode
# chars (i.e., s.th. like 'subprocess.call([u"ΓΌ"])').
export LANG="C.UTF-8"
START_STOP_DAEMON="start-stop-daemon --quiet --pidfile ${PIDFILE}"
STOP_DAEMON="${START_STOP_DAEMON} --stop --user mini-buildd"
START_DAEMON="${START_STOP_DAEMON} --start --exec ${DAEMON} --chuid mini-buildd"
. /lib/lsb/init-functions
_is_running()
{
${STOP_DAEMON} --test
}
# Usage: run_with_log LOGTXT CMD_WITH_ARGS...
_run_with_log()
{
log_begin_msg "${1} ${DESC}: ${NAME}"
shift
local retval=0
${@} || retval=$?
log_end_msg ${retval}
return ${retval}
}
case "${1}" in
start)
if _is_running; then
_run_with_log "Already running" true
else
_run_with_log "Starting" ${START_DAEMON} -- ${MINI_BUILDD_OPTIONS} --pidfile=${PIDFILE}
fi
;;
stop)
if _is_running; then
_run_with_log "Stopping" ${STOP_DAEMON} --retry 30
else
_run_with_log "Already stopped" true
fi
;;
reload)
if _is_running; then
_run_with_log "Reloading" ${STOP_DAEMON} --signal HUP
else
_run_with_log "Not running" false
fi
;;
force-reload|restart)
${0} stop
${0} start
;;
status)
status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
;;
*)
echo "Usage: /etc/init.d/mini-buildd {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac
exit 0
|