| 1 |
#!/usr/bin/env /lib/init/init-d-script |
| 2 |
### BEGIN INIT INFO |
| 3 |
# Provides: bcron-spool |
| 4 |
# Should-Start: $syslog |
| 5 |
# Required-Start: $time $local_fs |
| 6 |
# Required-Stop: $time $local_fs |
| 7 |
# Default-Start: 2 3 4 5 |
| 8 |
# Default-Stop: 0 1 6 |
| 9 |
# Short-Description: manage user crontab submission |
| 10 |
### END INIT INFO |
| 11 |
NAME='bcron-spool' |
| 12 |
DESC='manage user crontab submission' |
| 13 |
DAEMON=/usr/sbin/bcron-spool |
| 14 |
|
| 15 |
daemon_ () { /usr/bin/daemon --noconfig --name "${NAME}" "$@"; } |
| 16 |
if ! test -x '/usr/bin/daemon' ; then |
| 17 |
log_failure_msg "install \`daemon' package to use ${NAME} script" |
| 18 |
exit 1 |
| 19 |
fi |
| 20 |
|
| 21 |
do_start_cmd_override () { |
| 22 |
cron_uid=$(getent passwd cron | cut -d: -f3) |
| 23 |
cron_gid=$(getent passwd cron | cut -d: -f4) |
| 24 |
daemon_ -- unixserver -u${cron_uid} -g${cron_gid} \ |
| 25 |
/var/run/bcron-spool bcron-spool |
| 26 |
} |
| 27 |
|
| 28 |
do_stop_cmd_override () { |
| 29 |
if daemon_ --running ; then |
| 30 |
daemon_ --stop |
| 31 |
fi |
| 32 |
} |
| 33 |
|
| 34 |
# vim: ft=sh |