]> git.pld-linux.org Git - packages/flixengine.git/blame - flixengine.init
- R: rc-scripts >= 0.4.1.5 for check_portmapper function
[packages/flixengine.git] / flixengine.init
CommitLineData
1417f1b2 1#!/bin/sh
0cea9a65 2#
43c771f2
ER
3# flixengine
4#
5# chkconfig: 345 12 88
6#
7# description: On2 Technologies Flix Engine init script
8# processname: flixd
110d4697 9
0cea9a65
ER
10# Source function library
11. /etc/rc.d/init.d/functions
12
1417f1b2
ER
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.
977f216d 18export FLIXD_MENCODER=/usr/bin/mencoder-flixengine
110d4697 19
f2d0d47f 20AUTHDIR=/etc/on2
ac12ede0
ER
21PORT=2372
22USERID=flixd
38598339 23INTERFACE=lo
110d4697 24
1417f1b2
ER
25check_portmap() {
26 if [ ! -f /var/lock/subsys/portmap ]; then
27 echo >&2 "ERROR: portmap does not appear to be running."
28 echo >&2 "Flix Engine requires the portmap service to run."
29 exit 1
110d4697 30 fi
1417f1b2 31 # test for running portmapper
110d4697
ER
32}
33
1417f1b2
ER
34start(){
35 # Check if the service is already running?
36 if [ ! -f /var/lock/subsys/flixd ]; then
37 check_portmap
38 msg_starting "Flix Engine"
ac12ede0 39 daemon --user $USERID /usr/sbin/flixd --authdir=$AUTHDIR \
cc478664 40 --interface=$INTERFACE --port=$PORT --reuseaddr \
ac12ede0 41 --pidfile /var/run/flixd/flixd.pid --logfile=/var/log/flixd.log
1417f1b2 42 RETVAL=$?
ac12ede0 43 [ $RETVAL = 0 ] && touch /var/lock/subsys/flixd
110d4697 44 else
1417f1b2
ER
45 msg_already_running "Flix Engine"
46 fi
47}
48
49stop() {
50 # Stop daemons.
51 if [ -f /var/lock/subsys/flixd ]; then
7a3dcd1d 52 msg_stopping "Flix Engine"
ac12ede0 53 killproc --pidfile flixd/flixd.pid flixd
7a3dcd1d 54 rm -f /var/lock/subsys/flixd
1417f1b2
ER
55 else
56 msg_not_running "Flix Engine"
110d4697
ER
57 fi
58}
0cea9a65
ER
59
60RETVAL=0
61# See how we were called.
62case "$1" in
63start)
1417f1b2 64 start
0cea9a65
ER
65 ;;
66stop)
1417f1b2 67 stop
0cea9a65
ER
68 ;;
69restart)
1417f1b2 70 stop
0cea9a65 71 sleep 1
1417f1b2 72 start
0cea9a65 73 ;;
182c2008
ER
74status)
75 status flixd
76 RETVAL=$?
77 ;;
0cea9a65 78*)
182c2008 79 msg_usage "$0 {start|stop|restart|status}"
0cea9a65
ER
80 exit 3
81 ;;
110d4697 82esac
0cea9a65
ER
83
84exit $RETVAL
This page took 0.106643 seconds and 4 git commands to generate.