]> git.pld-linux.org Git - packages/flashpolicyd.git/blame - flashpolicyd.init
- ruby 2.0 rebuild
[packages/flashpolicyd.git] / flashpolicyd.init
CommitLineData
7fbefc62
ER
1#!/bin/sh
2#
3# flashpolicyd flashpolicyd short service description
4#
2ee29bf0 5# chkconfig: 345 20 80
7fbefc62
ER
6#
7# description: Starts a server on port 843 to server flash policy requests
8#
9# processname: flashpolicyd
10# config: /etc/flashpolicy.xml
11#
7fbefc62
ER
12
13# Source function library
14. /etc/rc.d/init.d/functions
15
16# Get network config
17. /etc/sysconfig/network
18
19# Set defaults
20TIMEOUT=10
21XML=/etc/flashpolicy.xml
22LOGFREQ=1800
23LOGFILE=/var/log/flashpolicyd.log
ee211994 24DAEMON_USER=nobody
7fbefc62
ER
25
26# Get service config - may override defaults
27[ -f /etc/sysconfig/flashpolicyd ] && . /etc/sysconfig/flashpolicyd
28
29# Check that networking is up.
30if 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
35else
36 exit 0
37fi
38
39start() {
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"
ee211994 47 daemon /usr/sbin/flashpolicyd --user=$DAEMON_USER --timeout=$TIMEOUT --xml=$XML --logfreq=$LOGFREQ --logfile=$LOGFILE
7fbefc62
ER
48 RETVAL=$?
49 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/flashpolicyd
50}
51
52stop() {
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
64condrestart() {
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
75RETVAL=0
76# See how we were called.
77case "$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
101esac
102
103exit $RETVAL
This page took 0.078658 seconds and 4 git commands to generate.