summaryrefslogtreecommitdiff
path: root/debian/heimdal-kdc.init
blob: 6989d126f6a84787f80d7040631a9d75950d2307 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#! /bin/sh
### BEGIN INIT INFO
# Provides:          heimdal-kdc
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start KDC server
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
KDC_DAEMON=/usr/lib/heimdal-servers/kdc
KDC_NAME=heimdal-kdc
KDC_DESC="Heimdal KDC"
KPASSWDD_DAEMON=/usr/lib/heimdal-servers/kpasswdd
KPASSWDD_NAME=kpasswdd
KPASSWDD_DESC="Heimdal password server"

if [ -f "/etc/default/heimdal-kdc" ] ; then
	. /etc/default/heimdal-kdc
fi

test -f $KDC_DAEMON || exit 0
test -f $KPASSWDD_DAEMON || exit 0

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

# commented out due to bug #574425.
# set -e

case "$1" in
  start)
	if [ "$KDC_ENABLED" = "yes" ];
	then
		echo -n "Starting $KDC_DESC: "
		start-stop-daemon --start --quiet --background \
			--make-pidfile --pidfile /var/run/$KDC_NAME.pid \
			--exec $KDC_DAEMON -- $KDC_PARAMS
		echo "$KDC_NAME."
	fi
	if [ "$KPASSWDD_ENABLED" = "yes" ];
	then
		echo -n "Starting $KPASSWDD_DESC: "
		start-stop-daemon --start --quiet --background \
			--make-pidfile --pidfile /var/run/$KPASSWDD_NAME.pid \
			--exec $KPASSWDD_DAEMON -- $KPASSWDD_PARAMS
		echo "$KPASSWDD_NAME."
	fi
	if [ "$MASTER_ENABLED" = "yes" ];
	then
		echo -n "Starting incremental propagation master: "
		start-stop-daemon --start --quiet --background \
			--make-pidfile --pidfile /var/run/ipropd-master.pid \
			--exec /usr/sbin/ipropd-master -- $MASTER_PARAMS
		echo "ipropd-master."
	fi
	if [ "$SLAVE_ENABLED" = "yes" ];
	then
		echo -n "Starting incremental propagation slave: "
		start-stop-daemon --start --quiet --background \
			--make-pidfile --pidfile /var/run/ipropd-slave.pid \
			--exec /usr/sbin/ipropd-slave -- $SLAVE_PARAMS
		echo "ipropd-slave."
	fi
	;;
  stop)
	if [ -f /var/run/$KPASSWDD_NAME.pid ]
	then
		echo -n "Stopping $KPASSWDD_DESC: "
		start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/$KPASSWDD_NAME.pid \
			--exec $KPASSWDD_DAEMON -- $KPASSWDD_PARAMS
		echo "$KPASSWDD_NAME."
	fi
	if [ -f /var/run/$KDC_NAME.pid  ]
	then
		echo -n "Stopping $KDC_DESC: "
		start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/$KDC_NAME.pid \
			--exec $KDC_DAEMON -- $KDC_PARAMS
		echo "$KDC_NAME."
	fi
	if [ -f /var/run/ipropd-master.pid ]
	then
		echo -n "Stopping incremental propagation master: "
		start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/ipropd-master.pid \
			--exec /usr/sbin/ipropd-master -- $MASTER_PARAMS
		echo "ipropd-master."
	fi
	if [ -f /var/run/ipropd-slave.pid ]
	then
		echo -n "Stopping incremental propagation slave: "
		start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/ipropd-slave.pid \
			--exec /usr/sbin/ipropd-slave -- $SLAVE_PARAMS
		echo "/usr/sbin/ipropd-slave."
	fi
	;;
  #reload)
	#
	#	If the daemon can reload its config files on the fly
	#	for example by sending it SIGHUP, do it here.
	#
	#	If the daemon responds to changes in its config file
	#	directly anyway, make this a do-nothing entry.
	#
	# echo "Reloading $DESC configuration files."
	# start-stop-daemon --stop --signal 1 --quiet --pidfile \
	#	/var/run/$NAME.pid --exec $DAEMON
  #;;
  restart|force-reload)
	#
	#	If the "reload" option is implemented, move the "force-reload"
	#	option to the "reload" entry above. If not, "force-reload" is
	#	just the same as "restart".
	#
	/etc/init.d/heimdal-kdc stop
	sleep 1
	/etc/init.d/heimdal-kdc start
	;;
  *)
	N=/etc/init.d/$NAME
	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0