]> git.pld-linux.org Git - packages/flashpolicyd.git/blob - flashpolicyd.init
c7409bdef0088aed2a9dc4d69a72dd8b0322658f
[packages/flashpolicyd.git] / flashpolicyd.init
1 #!/bin/sh
2 #
3 # flashpolicyd  flashpolicyd short service description
4 #
5 # chkconfig:    345 20 20
6 #
7 # description: Starts a server on port 843 to server flash policy requests
8 #
9 # processname:  flashpolicyd
10 # config: /etc/flashpolicy.xml
11 #
12 # $Id$
13
14 # Source function library
15 . /etc/rc.d/init.d/functions
16
17 # Get network config
18 . /etc/sysconfig/network
19
20 # Set defaults
21 TIMEOUT=10
22 XML=/etc/flashpolicy.xml
23 LOGFREQ=1800
24 LOGFILE=/var/log/flashpolicyd.log
25
26 # Get service config - may override defaults
27 [ -f /etc/sysconfig/flashpolicyd ] && . /etc/sysconfig/flashpolicyd
28
29 # Check that networking is up.
30 if is_yes "${NETWORKING}"; then
31         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
32                 msg_network_down "Flash policy server"
33                 exit 1
34         fi
35 else
36         exit 0
37 fi
38
39 start() {
40         # Check if the service is already running?
41         if [ -f /var/lock/subsys/flashpolicyd ]; then
42                 msg_already_running "Flash policy server"
43                 return
44         fi
45
46         msg_starting "Flash policy server"
47         daemon /usr/sbin/flashpolicyd --timeout=$TIMEOUT --xml=$XML --logfreq=$LOGFREQ --logfile=$LOGFILE
48         RETVAL=$?
49         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/flashpolicyd
50 }
51
52 stop() {
53         if [ ! -f /var/lock/subsys/flashpolicyd ]; then
54                 msg_not_running "Flash policy server"
55                 return
56         fi
57
58         # Stop daemons.
59         msg_stopping "Flash policy server"
60         killproc flashpolicyd
61         rm -f /var/lock/subsys/flashpolicyd
62 }
63
64 condrestart() {
65         if [ ! -f /var/lock/subsys/flashpolicyd ]; then
66                 msg_not_running "Flash policy server"
67                 RETVAL=$1
68                 return
69         fi
70
71         stop
72         start
73 }
74
75 RETVAL=0
76 # See how we were called.
77 case "$1" in
78   start)
79         start
80         ;;
81   stop)
82         stop
83         ;;
84   restart)
85         stop
86         start
87         ;;
88   try-restart)
89         condrestart 0
90         ;;
91   force-reload)
92         condrestart 7
93         ;;
94   status)
95         status flashpolicyd
96         RETVAL=$?
97         ;;
98   *)
99         msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
100         exit 3
101 esac
102
103 exit $RETVAL
This page took 0.075487 seconds and 3 git commands to generate.