]> git.pld-linux.org Git - packages/func.git/blob - func-funcd.init
- BR: python-modules, rpm-pythonprov
[packages/func.git] / func-funcd.init
1 #!/bin/sh
2 #
3 # funcd    Fedora Unified Network Control
4 #
5 # chkconfig:    2345 98 02
6 #
7 # description:  Crazy simple, secure remote management.
8 # processname: /usr/bin/funcd
9 #
10 # $Id$
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get service config - may override defaults
19 [ -f /etc/sysconfig/funcd ] && . /etc/sysconfig/funcd
20
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24                 msg_network_down "funcd"
25                 exit 1
26         fi
27 else
28         exit 0
29 fi
30
31 start() {
32         # Check if the service is already running?
33         if [ -f /var/lock/subsys/funcd ]; then
34                 msg_already_running "funcd"
35                 return
36         fi
37
38         msg_starting "funcd"
39         daemon /usr/bin/funcd --daemon
40         RETVAL=$?
41         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/funcd
42 }
43
44 stop() {
45         if [ ! -f /var/lock/subsys/funcd ]; then
46                 msg_not_running "funcd"
47                 return
48         fi
49
50         # Stop daemons.
51         msg_stopping "funcd"
52         killproc --pidfile /var/run/funcd.pid funcd -TERM
53         rm -f /var/lock/subsys/funcd
54 }
55
56 condrestart() {
57         if [ ! -f /var/lock/subsys/funcd ]; then
58                 msg_not_running "funcd"
59                 RETVAL=$1
60                 return
61         fi
62
63         stop
64         start
65 }
66
67
68 RETVAL=0
69 # See how we were called.
70 case "$1" in
71   start)
72         start
73         ;;
74   stop)
75         stop
76         ;;
77   restart)
78         stop
79         start
80         ;;
81   try-restart)
82         condrestart 0
83         ;;
84   force-reload)
85         condrestart 7
86         ;;
87   status)
88         status funcd
89         RETVAL=$?
90         ;;
91   *)
92         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
93         exit 3
94 esac
95
96 exit $RETVAL
This page took 0.0727 seconds and 3 git commands to generate.