Import Debian changes 0.66.4-9
[hcoop/debian/courier-authlib.git] / debian / courier-authdaemon.init
CommitLineData
1420868b
OS
1#!/bin/sh
2# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
3if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
4 set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
5fi
0fde1ce3 6### BEGIN INIT INFO
7# Provides: courier-authdaemon
8# Required-Start: $remote_fs $syslog
9# Required-Stop: $remote_fs $syslog
10# Default-Start: 2 3 4 5
11# Default-Stop: 0 1 6
12### END INIT INFO
426e7833 13
1420868b 14# Author: Ondřej Surý <ondrej@debian.org>
426e7833 15
1420868b
OS
16DAEMON="/usr/sbin/authdaemond"
17DESC="Courier authentication services"
18PIDFILE="/run/courier/pid"
426e7833 19
1420868b
OS
20do_start_prepare() {
21 do_tmpfiles courier-authdaemon
22}
23
24do_tmpfiles() {
25 local type path mode user group
26
27 TMPFILES=/usr/lib/tmpfiles.d/$1.conf
28
29 if [ -r "$TMPFILES" ]; then
30 while read type path mode user group age argument; do
31 if [ "$type" = "d" ]; then
32 mkdir -p "$path"
33 chmod "$mode" "$path"
34 chown "$user:$group" "$path"
35 [ -x /sbin/restorecon ] && /sbin/restorecon $path
36 fi
37 done < "$TMPFILES"
38 fi
39}
40
41do_start_cmd_override() {
42 $DAEMON start
43}
44
45do_stop_cmd_override() {
46 $DAEMON stop
47}
426e7833 48
1420868b
OS
49do_status_override() {
50 status_of_proc "/usr/lib/courier/courier-authlib/authdaemond" "$NAME" && return 0 || return $?
51}