3
# Provides: icecc-scheduler
4
# Required-Start: $local_fs $remote_fs
5
# Required-Stop: $local_fs $remote_fs
6
# Default-Start: 2 3 4 5
8
# Short-Description: control icecc scheduler start at boot time
9
# Description: control icecc scheduler start at boot time by
10
# sourcing /etc/default/icecc and /etc/icecc/icecc.conf.
13
SCHEDULER=/usr/sbin/icecc-scheduler
14
CONFIGFILE=/etc/icecc/icecc.conf
15
DEFAULTFILE=/etc/default/icecc
17
# Read configuration files
18
[ -r $CONFIGFILE ] && . $CONFIGFILE
19
[ -r $DEFAULTFILE ] && . $DEFAULTFILE
21
test -x $SCHEDULER || exit 0
23
. /lib/lsb/init-functions
26
if test -n "$ICECC_NETNAME"; then
27
netname="-n $ICECC_NETNAME"
30
start_icecc_scheduler() {
31
if test -z "$ICECC_SCHEDULER_LOG_FILE"; then
32
ICECC_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler"
35
logfile="-l $ICECC_SCHEDULER_LOG_FILE"
36
: > $ICECC_SCHEDULER_LOG_FILE
37
chown icecc $ICECC_SCHEDULER_LOG_FILE
38
start-stop-daemon --start --quiet --chuid icecc \
39
--exec $SCHEDULER -- -d $logfile $netname
42
stop_icecc_scheduler() {
43
start-stop-daemon --stop --quiet --signal TERM --oknodo --exec $SCHEDULER
48
log_daemon_msg "Starting distributed compiler scheduler" "icecc-scheduler"
53
log_daemon_msg "Stopping distributed compiler scheduler" "icecc_scheduler"
58
log_daemon_msg "Restarting distributed compiler scheduler" "icecc-scheduler"
65
status_of_proc "$SCHEDULER" "icecc-scheduler" && exit 0 || exit $?
68
N=/etc/init.d/icecc-scheduler
69
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2