]> git.pld-linux.org Git - packages/heimdal.git/blob - heimdal-ipropd.init
- resolve man pages conflict with openssl 1.1
[packages/heimdal.git] / heimdal-ipropd.init
1 #!/bin/sh
2 #
3 # ipropd        Heimdal Kerberos V replication daemons
4 # chkconfig:    2345 41 41
5 # description:  Heimdal Kerberos V replication daemons
6 # processname:  ipropd-master ipropd-slave
7 # config:       /etc/krb5.conf
8
9 # Source function library
10 . /etc/rc.d/init.d/functions
11
12 # Get network config
13 . /etc/sysconfig/network
14
15 # Get service config
16 [ -f /etc/sysconfig/heimdal ] && . /etc/sysconfig/heimdal
17 SERVICE_RUN_NICE_LEVEL=${IPROPD_SERVICE_RUN_NICE_LEVEL:-0}
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 Replication Daemons"
23                 exit 1
24         fi
25 else
26         exit 0
27 fi
28
29 start_master() {
30         if [ -f /var/lock/subsys/ipropd-master ]; then
31                 msg_already_running "Kerberos Replication Daemon (Master)"
32                 return
33         fi
34
35         if ! is_yes "$MASTER_ENABLED"; then
36                 return
37         fi
38
39         msg_starting "Kerberos Replication Daemon (Master)"
40         busy
41         daemon ipropd-master --detach
42         RETVAL=$?
43         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipropd-master
44 }
45
46 start_slave() {
47         if [ -f /var/lock/subsys/ipropd-slave ]; then
48                 msg_already_running "Kerberos Replication Daemon (Slave)"
49                 return
50         fi
51
52         if ! is_yes "$SLAVE_ENABLED"; then
53                 return
54         fi
55
56         msg_starting "Kerberos Replication Daemon (Slave)"
57         busy
58         daemon ipropd-slave --detach $SLAVE_PARAMS
59         RETVAL=$?
60         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipropd-slave
61 }
62
63 stop_master() {
64         if [ ! -f /var/lock/subsys/ipropd-master ]; then
65                 if is_yes "$MASTER_ENABLED"; then
66                         msg_not_running "Kerberos Replication Daemon (Master)"
67                 fi
68                 return
69         fi
70
71         msg_stopping "Kerberos Replication Daemon (Master)"
72         killproc ipropd-master
73         rm -f /var/lock/subsys/ipropd-master >/dev/null 2>&1
74 }
75
76 stop_slave() {
77         if [ ! -f /var/lock/subsys/ipropd-slave ]; then
78                 if is_yes "$SLAVE_ENABLED"; then
79                         msg_not_running "Kerberos Replication Daemon (Slave)"
80                 fi
81                 return
82         fi
83
84         msg_stopping "Kerberos Replication Daemon (Slave)"
85         killproc ipropd-slave
86         rm -f /var/lock/subsys/ipropd-slave >/dev/null 2>&1
87 }
88
89 start() {
90         start_master
91         start_slave
92 }
93
94 stop() {
95         stop_master
96         stop_slave
97 }
98
99 condrestart() {
100         if [ ! -f /var/lock/subsys/ipropd-master -a ! -f /var/lock/subsys/ipropd-slave ]; then
101                 msg_not_running "Kerberos Replication Daemons"
102                 RETVAL=$1
103                 return
104         fi
105
106         stop
107         start
108 }
109
110 RETVAL=0
111 # See how we were called.
112 case "$1" in
113   start)
114         start
115         ;;
116   stop)
117         stop
118         ;;
119   restart|force-reload)
120         stop
121         start
122         ;;
123   try-restart)
124         condrestart 0
125         ;;
126   force-reload)
127         condrestart 7
128         ;;
129   status)
130         is_yes "$MASTER_ENABLED" && status ipropd-master
131         is_yes "$SLAVE_ENABLED" && status ipropd-slave
132         exit $?
133         ;;
134   *)
135         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
136         exit 3
137 esac
138
139 exit $RETVAL
This page took 0.266531 seconds and 3 git commands to generate.