]> git.pld-linux.org Git - packages/flixengine.git/blame - flixengine.init
- sysconfig support
[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
73b04271
JR
25if [ "$1" != "stop" ]; then
26 check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
27fi
110d4697 28
19b221d4
ER
29# Get service config - may override defaults
30[ -f /etc/sysconfig/flixengine ] && . /etc/sysconfig/flixengine
31
32start() {
1417f1b2
ER
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/flixd ]; then
1417f1b2 35 msg_starting "Flix Engine"
ac12ede0 36 daemon --user $USERID /usr/sbin/flixd --authdir=$AUTHDIR \
cc478664 37 --interface=$INTERFACE --port=$PORT --reuseaddr \
ac12ede0 38 --pidfile /var/run/flixd/flixd.pid --logfile=/var/log/flixd.log
1417f1b2 39 RETVAL=$?
ac12ede0 40 [ $RETVAL = 0 ] && touch /var/lock/subsys/flixd
110d4697 41 else
1417f1b2
ER
42 msg_already_running "Flix Engine"
43 fi
44}
45
46stop() {
47 # Stop daemons.
48 if [ -f /var/lock/subsys/flixd ]; then
7a3dcd1d 49 msg_stopping "Flix Engine"
ac12ede0 50 killproc --pidfile flixd/flixd.pid flixd
7a3dcd1d 51 rm -f /var/lock/subsys/flixd
1417f1b2
ER
52 else
53 msg_not_running "Flix Engine"
110d4697
ER
54 fi
55}
0cea9a65
ER
56
57RETVAL=0
58# See how we were called.
59case "$1" in
60start)
1417f1b2 61 start
0cea9a65
ER
62 ;;
63stop)
1417f1b2 64 stop
0cea9a65
ER
65 ;;
66restart)
1417f1b2 67 stop
0cea9a65 68 sleep 1
1417f1b2 69 start
0cea9a65 70 ;;
182c2008
ER
71status)
72 status flixd
73 RETVAL=$?
74 ;;
0cea9a65 75*)
182c2008 76 msg_usage "$0 {start|stop|restart|status}"
0cea9a65
ER
77 exit 3
78 ;;
110d4697 79esac
0cea9a65
ER
80
81exit $RETVAL
This page took 0.28122 seconds and 4 git commands to generate.