Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 15 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 magnus 1
#!/bin/sh
2
### BEGIN INIT INFO
3
# Provides:          oidentd ident-server
4
# Required-Start:    $remote_fs $syslog
5
# Required-Stop:     $remote_fs $syslog
6
# Should-Start:
7
# Should-Stop:
8
# Default-Start:     2 3 4 5
9
# Default-Stop:      0 1 6
10
# Short-Description: replacement ident daemon
11
# Description:       oidentd is a replacement ident daemon
12
### END INIT INFO
13
 
14
PATH=/sbin:/bin:/usr/sbin:/usr/bin
15
OIDENTD=/usr/sbin/oidentd
16
 
17
# See if the daemons are there
18
test -f ${OIDENTD} || exit 0
19
 
20
# oidentd configuration
21
OIDENT_OPTIONS=""
22
OIDENT_USER="nobody"
23
OIDENT_GROUP="nogroup"
24
test -f /etc/default/oidentd && . /etc/default/oidentd
25
 
26
. /lib/lsb/init-functions
27
 
28
if [ "${OIDENT_BEHIND_PROXY}" = "yes" ]; then
33 magnus 29
	OIDENT_OPTIONS="${OIDENT_OPTIONS} -P `ip route show to exact 0/0 | awk '{print $3}'`"
3 magnus 30
fi
31
 
32
 
33
OPTIONS="${OIDENT_OPTIONS} -u ${OIDENT_USER} -g ${OIDENT_GROUP}"
34
 
35
case "$1" in
36
	start)
37
		log_daemon_msg "Starting ident daemon" "oidentd"
38
		start-stop-daemon --start --quiet --oknodo --exec ${OIDENTD} -- ${OPTIONS}
39
		log_end_msg $?
40
		;;
41
	stop)
42
		log_daemon_msg "Stopping ident daemon" "oidentd"
43
		start-stop-daemon --stop --quiet --oknodo --exec ${OIDENTD} -- ${OPTIONS}
44
		log_end_msg $?
45
		;;
46
	reload|restart|force-reload)
47
		log_daemon_msg "Restarting ident daemon" "oidentd"
48
		start-stop-daemon --stop --quiet --exec ${OIDENTD} -- ${OPTIONS}
49
		sleep 2
50
		start-stop-daemon --start --quiet --exec ${OIDENTD} -- ${OPTIONS}
51
		log_end_msg $?
52
		;;
53
	status)
54
		status_of_proc "$OIDENTD" "oidentd" && exit 0 || exit $?
55
		;;
56
	*)
57
		log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload|status}"
58
		exit 1
59
		;;
60
esac
61
 
62
exit 0
63