]> git.pld-linux.org Git - packages/heimdal.git/blame - heimdal-ipropd.init
- resolve man pages conflict with openssl 1.1
[packages/heimdal.git] / heimdal-ipropd.init
CommitLineData
a0da4df9
JR
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
a0da4df9
JR
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
17SERVICE_RUN_NICE_LEVEL=${IPROPD_SERVICE_RUN_NICE_LEVEL:-0}
18
19# Check that networking is up.
20if 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
25else
26 exit 0
27fi
28
fae2ef8c
ER
29start_master() {
30 if [ -f /var/lock/subsys/ipropd-master ]; then
31 msg_already_running "Kerberos Replication Daemon (Master)"
32 return
a0da4df9 33 fi
fae2ef8c
ER
34
35 if ! is_yes "$MASTER_ENABLED"; then
36 return
a0da4df9 37 fi
fae2ef8c
ER
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
a0da4df9
JR
44}
45
fae2ef8c
ER
46start_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
63stop_master() {
64 if [ ! -f /var/lock/subsys/ipropd-master ]; then
a0da4df9
JR
65 if is_yes "$MASTER_ENABLED"; then
66 msg_not_running "Kerberos Replication Daemon (Master)"
67 fi
fae2ef8c 68 return
a0da4df9 69 fi
fae2ef8c
ER
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
76stop_slave() {
77 if [ ! -f /var/lock/subsys/ipropd-slave ]; then
a0da4df9
JR
78 if is_yes "$SLAVE_ENABLED"; then
79 msg_not_running "Kerberos Replication Daemon (Slave)"
80 fi
fae2ef8c 81 return
a0da4df9 82 fi
fae2ef8c
ER
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
89start() {
90 start_master
91 start_slave
92}
93
94stop() {
95 stop_master
96 stop_slave
a0da4df9
JR
97}
98
99condrestart() {
fae2ef8c 100 if [ ! -f /var/lock/subsys/ipropd-master -a ! -f /var/lock/subsys/ipropd-slave ]; then
a0da4df9
JR
101 msg_not_running "Kerberos Replication Daemons"
102 RETVAL=$1
fae2ef8c 103 return
a0da4df9 104 fi
fae2ef8c
ER
105
106 stop
107 start
a0da4df9
JR
108}
109
110RETVAL=0
111# See how we were called.
112case "$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
137esac
138
139exit $RETVAL
This page took 0.074772 seconds and 4 git commands to generate.