File: bcron-spool

package info (click to toggle)
bcron 0.11-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 752 kB
  • sloc: sh: 3,099; ansic: 2,416; makefile: 28
file content (34 lines) | stat: -rwxr-xr-x 895 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/env /lib/init/init-d-script
### BEGIN INIT INFO
# Provides:          bcron-spool
# Should-Start:      $syslog
# Required-Start:    $time $local_fs
# Required-Stop:     $time $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: manage user crontab submission
### END INIT INFO
NAME='bcron-spool'
DESC='manage user crontab submission'
DAEMON=/usr/sbin/bcron-spool

daemon_ () { /usr/bin/daemon --noconfig --name "${NAME}" "$@"; }
if ! test -x '/usr/bin/daemon' ; then
	log_failure_msg "install \`daemon' package to use ${NAME} script"
	exit 1
fi

do_start_cmd_override () {
	cron_uid=$(getent passwd cron | cut -d: -f3)
	cron_gid=$(getent passwd cron | cut -d: -f4)
	daemon_ -- unixserver -u${cron_uid} -g${cron_gid} \
	    /var/run/bcron-spool bcron-spool
}

do_stop_cmd_override () {
	if daemon_ --running ; then
		daemon_ --stop
	fi
}

# vim: ft=sh