forked from ripienaar/flashpolicyd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flashpolicyd.init
executable file
·76 lines (67 loc) · 1.27 KB
/
flashpolicyd.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
#
# Init file for the flashpolicy server daemon
#
# chkconfig: 2345 20 20
# description: Starts a server on port 843 to server flash policy requests
#
# processname: flashpolicyd.rb
# Source function library.
. /etc/rc.d/init.d/functions
desc="Flash policy server"
prog="flashpolicyd"
# these can be overrode in /etc/sysconfig/flashpolicyd
RETVAL=0
TIMEOUT=10
XML=/etc/flashpolicy.xml
LOGFREQ=1800
LOGFILE=/var/log/flashpolicyd.log
USER=root
BINDIR=/usr/sbin
PORT=843
if [ -r /etc/sysconfig/$prog ]; then
source /etc/sysconfig/$prog
fi
start() {
echo -n $"Starting $desc ($prog): "
daemon --check=$prog ${BINDIR}/${prog} --timeout=${TIMEOUT} --xml=${XML} --logfreq=${LOGFREQ} --logfile=${LOGFILE} --user=${USER} --port=${PORT}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
echo -n $"Stopping $desc ($prog): "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
RETVAL=1
esac
exit $RETVAL