]> git.pld-linux.org Git - packages/flixengine.git/blob - flixengine.init
- disable python/java (broken)
[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 ## Avoid potential seg fault due to unchecked allocations within libogg.
21 ## This will force a read error should any encode instance's ogg demuxer
22 ## use more than 70% of available physical memory
23 ## See flixd(8) for further details.
24 export FLIX_OGG_PHYMEM_PCTMAX=70
25
26 AUTHDIR=/etc/on2
27 PORT=2372
28 USERID=flixd
29 INTERFACE=lo
30
31 if [ "$1" != "stop" ]; then
32         check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
33 fi
34
35 # Get service config - may override defaults
36 [ -f /etc/sysconfig/flixd ] && . /etc/sysconfig/flixd
37
38 start() {
39         # Check if the service is already running?
40         if [ ! -f /var/lock/subsys/flixd ]; then
41                 msg_starting "Flix Engine"
42                 daemon --user $USERID /usr/sbin/flixd --authdir=$AUTHDIR \
43                         --interface=$INTERFACE --port=$PORT --reuseaddr \
44                         --pidfile /var/run/flixd/flixd.pid --logfile=/var/log/flixd.log
45                 RETVAL=$?
46                 [ $RETVAL = 0 ] && touch /var/lock/subsys/flixd
47         else
48                 msg_already_running "Flix Engine"
49         fi
50 }
51
52 stop() {
53         # Stop daemons.
54         if [ -f /var/lock/subsys/flixd ]; then
55                 msg_stopping "Flix Engine"
56                 killproc --pidfile flixd/flixd.pid flixd
57                 rm -f /var/lock/subsys/flixd
58         else
59                 msg_not_running "Flix Engine"
60         fi
61 }
62
63 RETVAL=0
64 # See how we were called.
65 case "$1" in
66 start)
67         start
68         ;;
69 stop)
70         stop
71         ;;
72 restart)
73         stop
74         sleep 1
75         start
76         ;;
77 status)
78         status flixd
79         RETVAL=$?
80         ;;
81 *)
82         msg_usage "$0 {start|stop|restart|status}"
83         exit 3
84         ;;
85 esac
86
87 exit $RETVAL
This page took 0.052223 seconds and 3 git commands to generate.