]> git.pld-linux.org Git - packages/flashpolicyd.git/blame - flashpolicyd.init
- ruby-modules for socket.rb; rel 2
[packages/flashpolicyd.git] / flashpolicyd.init
CommitLineData
7fbefc62
ER
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
21TIMEOUT=10
22XML=/etc/flashpolicy.xml
23LOGFREQ=1800
24LOGFILE=/var/log/flashpolicyd.log
ee211994 25DAEMON_USER=nobody
7fbefc62
ER
26
27# Get service config - may override defaults
28[ -f /etc/sysconfig/flashpolicyd ] && . /etc/sysconfig/flashpolicyd
29
30# Check that networking is up.
31if 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
36else
37 exit 0
38fi
39
40start() {
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"
ee211994 48 daemon /usr/sbin/flashpolicyd --user=$DAEMON_USER --timeout=$TIMEOUT --xml=$XML --logfreq=$LOGFREQ --logfile=$LOGFILE
7fbefc62
ER
49 RETVAL=$?
50 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/flashpolicyd
51}
52
53stop() {
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
65condrestart() {
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
76RETVAL=0
77# See how we were called.
78case "$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
102esac
103
104exit $RETVAL
This page took 0.160153 seconds and 4 git commands to generate.