Commit | Line | Data |
---|---|---|
1420868b OS |
1 | #!/bin/sh |
2 | # kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. | |
3 | if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then | |
4 | set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script | |
5 | fi | |
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 |
16 | DAEMON="/usr/sbin/authdaemond" |
17 | DESC="Courier authentication services" | |
18 | PIDFILE="/run/courier/pid" | |
426e7833 | 19 | |
1420868b OS |
20 | do_start_prepare() { |
21 | do_tmpfiles courier-authdaemon | |
22 | } | |
23 | ||
24 | do_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 | ||
41 | do_start_cmd_override() { | |
42 | $DAEMON start | |
43 | } | |
44 | ||
45 | do_stop_cmd_override() { | |
46 | $DAEMON stop | |
47 | } | |
426e7833 | 48 | |
1420868b OS |
49 | do_status_override() { |
50 | status_of_proc "/usr/lib/courier/courier-authlib/authdaemond" "$NAME" && return 0 || return $? | |
51 | } |