]> git.pld-linux.org Git - packages/flixengine.git/blame_incremental - flixengine.init
- R: rc-scripts >= 0.4.1.5 for check_portmapper function
[packages/flixengine.git] / flixengine.init
... / ...
CommitLineData
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.
18export FLIXD_MENCODER=/usr/bin/mencoder-flixengine
19
20AUTHDIR=/etc/on2
21PORT=2372
22USERID=flixd
23INTERFACE=lo
24
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
30 fi
31 # test for running portmapper
32}
33
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"
39 daemon --user $USERID /usr/sbin/flixd --authdir=$AUTHDIR \
40 --interface=$INTERFACE --port=$PORT --reuseaddr \
41 --pidfile /var/run/flixd/flixd.pid --logfile=/var/log/flixd.log
42 RETVAL=$?
43 [ $RETVAL = 0 ] && touch /var/lock/subsys/flixd
44 else
45 msg_already_running "Flix Engine"
46 fi
47}
48
49stop() {
50 # Stop daemons.
51 if [ -f /var/lock/subsys/flixd ]; then
52 msg_stopping "Flix Engine"
53 killproc --pidfile flixd/flixd.pid flixd
54 rm -f /var/lock/subsys/flixd
55 else
56 msg_not_running "Flix Engine"
57 fi
58}
59
60RETVAL=0
61# See how we were called.
62case "$1" in
63start)
64 start
65 ;;
66stop)
67 stop
68 ;;
69restart)
70 stop
71 sleep 1
72 start
73 ;;
74status)
75 status flixd
76 RETVAL=$?
77 ;;
78*)
79 msg_usage "$0 {start|stop|restart|status}"
80 exit 3
81 ;;
82esac
83
84exit $RETVAL
This page took 0.04413 seconds and 4 git commands to generate.