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