]>
Commit | Line | Data |
---|---|---|
a0da4df9 JR |
1 | #!/bin/sh |
2 | # | |
3 | # heimdal Heimdal Kerberos V credential cache daemon | |
f29e8338 | 4 | # chkconfig: 2345 11 89 |
5a57e9a4 | 5 | # description: Heimdal Kerberos V credential cache daemon |
a0da4df9 JR |
6 | # processname: kcm |
7 | # config: /etc/kcm.conf | |
8 | ||
9 | ||
10 | # Source function library | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # Get network config | |
14 | . /etc/sysconfig/network | |
15 | ||
16 | # Get service config | |
17 | [ -f /etc/sysconfig/kcm ] && . /etc/sysconfig/kcm | |
18 | ||
19 | # Check that networking is up. | |
20 | if is_yes "${NETWORKING}"; then | |
21 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then | |
22 | msg_network_down "Kerberos KCM" | |
23 | exit 1 | |
24 | fi | |
25 | else | |
26 | exit 0 | |
27 | fi | |
28 | ||
29 | start() { | |
fae2ef8c | 30 | if [ -f /var/lock/subsys/kcm ]; then |
a0da4df9 | 31 | msg_already_running "Kerberos KCM" |
fae2ef8c | 32 | return |
a0da4df9 | 33 | fi |
fae2ef8c ER |
34 | |
35 | msg_starting "Kerberos KCM" | |
36 | busy | |
37 | daemon kcm --detach | |
38 | RETVAL=$? | |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/kcm | |
a0da4df9 JR |
40 | } |
41 | ||
42 | stop() { | |
fae2ef8c | 43 | if [ ! -f /var/lock/subsys/kcm ]; then |
a0da4df9 | 44 | msg_not_running "Kerberos KCM" |
fae2ef8c | 45 | return |
a0da4df9 | 46 | fi |
fae2ef8c ER |
47 | |
48 | msg_stopping "Kerberos KCM" | |
49 | killproc kcm | |
50 | rm -f /var/lock/subsys/kcm >/dev/null 2>&1 | |
a0da4df9 JR |
51 | } |
52 | ||
53 | condrestart() { | |
fae2ef8c | 54 | if [ ! -f /var/lock/subsys/kcm ]; then |
a0da4df9 JR |
55 | msg_not_running "Kerberos KCM" |
56 | RETVAL=$1 | |
fae2ef8c | 57 | return |
a0da4df9 | 58 | fi |
fae2ef8c ER |
59 | |
60 | stop | |
61 | start | |
a0da4df9 JR |
62 | } |
63 | ||
64 | RETVAL=0 | |
65 | # See how we were called. | |
66 | case "$1" in | |
67 | start) | |
68 | start | |
69 | ;; | |
70 | stop) | |
71 | stop | |
72 | ;; | |
73 | restart|force-reload) | |
74 | stop | |
75 | start | |
76 | ;; | |
77 | try-restart) | |
78 | condrestart 0 | |
79 | ;; | |
80 | force-reload) | |
81 | condrestart 7 | |
82 | ;; | |
83 | status) | |
84 | status kcm | |
85 | exit $? | |
86 | ;; | |
87 | *) | |
88 | msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" | |
89 | exit 3 | |
90 | esac | |
91 | ||
92 | exit $RETVAL |