]> git.pld-linux.org Git - packages/flixengine.git/blob - flixengine.init
06846d8ab22183194e7ad1418ed361506ef7f80c
[packages/flixengine.git] / flixengine.init
1 #!/bin/sh
2 #
3 # flixengine   
4 #
5 # chkconfig:    345 12 88
6 #
7 # description: On2 Technologies Flix Engine init script
8 # processname:  flixd
9
10 # Source function library
11 . /etc/rc.d/init.d/functions
12
13 ## Specify the mencoder binary for flixd to use when decoding source files.
14 ## If running flixd from the command line or using su within this script to run
15 ## it as another user ensure that this environment variable is set. The default
16 ## install path for mencoder will not be in PATH so without this variable set
17 ## flixd will be unable to decode source files.
18 export FLIXD_MENCODER=/usr/bin/mencoder-flixengine
19
20 AUTHDIR=/etc/on2
21 PORT=2372
22 USERID=flixd
23 INTERFACE=lo
24
25 if [ "$1" != "stop" ]; then
26         check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
27 fi
28
29 # Get service config - may override defaults
30 [ -f /etc/sysconfig/flixengine ] && . /etc/sysconfig/flixengine
31
32 start() {
33         # Check if the service is already running?
34         if [ ! -f /var/lock/subsys/flixd ]; then
35                 msg_starting "Flix Engine"
36                 daemon --user $USERID /usr/sbin/flixd --authdir=$AUTHDIR \
37                         --interface=$INTERFACE --port=$PORT --reuseaddr \
38                         --pidfile /var/run/flixd/flixd.pid --logfile=/var/log/flixd.log
39                 RETVAL=$?
40                 [ $RETVAL = 0 ] && touch /var/lock/subsys/flixd
41         else
42                 msg_already_running "Flix Engine"
43         fi
44 }
45
46 stop() {
47         # Stop daemons.
48         if [ -f /var/lock/subsys/flixd ]; then
49                 msg_stopping "Flix Engine"
50                 killproc --pidfile flixd/flixd.pid flixd
51                 rm -f /var/lock/subsys/flixd
52         else
53                 msg_not_running "Flix Engine"
54         fi
55 }
56
57 RETVAL=0
58 # See how we were called.
59 case "$1" in
60 start)
61         start
62         ;;
63 stop)
64         stop
65         ;;
66 restart)
67         stop
68         sleep 1
69         start
70         ;;
71 status)
72         status flixd
73         RETVAL=$?
74         ;;
75 *)
76         msg_usage "$0 {start|stop|restart|status}"
77         exit 3
78         ;;
79 esac
80
81 exit $RETVAL
This page took 0.073769 seconds and 2 git commands to generate.