Added files from 'suse', to shorten the chain of patches.
[freeradius.git] / suse / rcradiusd
1 #! /bin/sh
2 # Copyright (c) 2001 SuSE GmbH Nuernberg, Germany.
3 #
4 # Author: Wolfgang Rosenauer <feedback@suse.de>, 2000, 2001
5 #
6 # /etc/init.d/radiusd
7 #
8 #   and symbolic its link
9 #
10 # /usr/bin/rcradiusd
11 #
12 ### BEGIN INIT INFO
13 # Provides:       radiusd
14 # Required-Start: $network $syslog $remotefs
15 # Required-Stop:
16 # Default-Start:  3 5
17 # Default-Stop:   0 1 2 6
18 # Description:    RADIUS-Server
19 ### END INIT INFO
20
21
22 . /etc/rc.status
23
24 test -x /usr/sbin/radiusd || exit 5
25
26 rc_reset
27 case "$1" in
28     start)
29         echo -n "Starting service radiusd"
30         startproc /usr/sbin/radiusd 
31         rc_status -v    
32         ;;
33     stop)
34         echo -n "Shutting down service radiusd"
35         killproc -TERM /usr/sbin/radiusd 
36         rc_status -v    
37         ;;
38     try-restart)
39         ## If first returns OK call the second, if first or
40         ## second command fails, set echo return value.
41         $0 stop  &&  $0 start
42         rc_status
43         ;;
44     restart)
45         ## Stop the service and regardless of whether it was
46         ## running or not, start it again.
47         $0 stop
48         $0 start
49         rc_status
50         ;;
51     force-reload)
52         ## Signal the daemon to reload its config. Most daemons
53         ## do this on signal 1 (SIGHUP).
54         ## If it does not support it, restart.
55
56         echo -n "Reload service radiusd"
57         killproc -HUP /usr/sbin/radiusd
58         rc_status -v
59         ;;
60     reload)
61         ## Like force-reload, but if daemon does not support
62         ## signalling, do nothing (!)
63
64         echo -n "Reload service radiusd"
65         killproc -HUP /usr/sbin/radiusd 
66         rc_status -v
67         ;;
68     status)
69         echo -n "Checking for service radiusd: "
70         checkproc /usr/sbin/radiusd
71         rc_status -v
72         ;;
73     *)
74         echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
75         exit 1
76         ;;
77 esac
78 rc_exit