]> git.pld-linux.org Git - packages/heimdal.git/blob - heimdal-kcm.init
- rel 1 is back
[packages/heimdal.git] / heimdal-kcm.init
1 #!/bin/sh
2 #
3 # heimdal       Heimdal Kerberos V credential cache daemon
4 # chkconfig:    2345 11 89
5 # description:  Heimdal Kerberos V credential cache daemon
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() {
30         local pid
31
32         if [ ! -f /var/lock/subsys/kcm ]; then
33                 msg_starting "Kerberos KCM"
34                 busy
35                 daemon kcm --detach
36                 RETVAL=$?
37                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/kcm
38         else
39                 msg_already_running "Kerberos KCM"
40         fi
41 }
42
43 stop() {
44         if [ -f /var/lock/subsys/kcm ]; then
45                 msg_stopping "Kerberos KCM"
46                 killproc kcm
47                 rm -f /var/lock/subsys/kcm >/dev/null 2>&1
48         else
49                 msg_not_running "Kerberos KCM"
50         fi
51 }
52
53 condrestart() {
54         if [ -f /var/lock/subsys/kcm ]; then
55                 stop
56                 start
57         else
58                 msg_not_running "Kerberos KCM"
59                 RETVAL=$1
60         fi
61 }
62
63 RETVAL=0
64 # See how we were called.
65 case "$1" in
66   start)
67         start
68         ;;
69   stop)
70         stop
71         ;;
72   restart|force-reload)
73         stop
74         start
75         ;;
76   try-restart)
77         condrestart 0
78         ;;
79   force-reload)
80         condrestart 7
81         ;;
82   status)
83         status kcm
84         exit $?
85         ;;
86   *)
87         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
88         exit 3
89 esac
90
91 exit $RETVAL
This page took 0.034488 seconds and 3 git commands to generate.