#!/bin/sh # # flixengine # # chkconfig: 345 12 88 # # description: On2 Technologies Flix Engine init script # processname: flixd # Source function library . /etc/rc.d/init.d/functions ## Specify the mencoder binary for flixd to use when decoding source files. ## If running flixd from the command line or using su within this script to run ## it as another user ensure that this environment variable is set. The default ## install path for mencoder will not be in PATH so without this variable set ## flixd will be unable to decode source files. export FLIXD_MENCODER=/usr/bin/mencoder-flixengine ## Avoid potential seg fault due to unchecked allocations within libogg. ## This will force a read error should any encode instance's ogg demuxer ## use more than 70% of available physical memory ## See flixd(8) for further details. export FLIX_OGG_PHYMEM_PCTMAX=70 AUTHDIR=/etc/on2 PORT=2372 USERID=flixd INTERFACE=lo if [ "$1" != "stop" ]; then check_portmapper || { nls "Error: portmap isn't running" && exit 0; } fi # Get service config - may override defaults [ -f /etc/sysconfig/flixd ] && . /etc/sysconfig/flixd start() { # Check if the service is already running? if [ ! -f /var/lock/subsys/flixd ]; then msg_starting "Flix Engine" daemon --user $USERID /usr/sbin/flixd --authdir=$AUTHDIR \ --interface=$INTERFACE --port=$PORT --reuseaddr \ --pidfile /var/run/flixd/flixd.pid --logfile=/var/log/flixd.log RETVAL=$? [ $RETVAL = 0 ] && touch /var/lock/subsys/flixd else msg_already_running "Flix Engine" fi } stop() { # Stop daemons. if [ -f /var/lock/subsys/flixd ]; then msg_stopping "Flix Engine" killproc --pidfile flixd/flixd.pid flixd rm -f /var/lock/subsys/flixd else msg_not_running "Flix Engine" fi } RETVAL=0 # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop sleep 1 start ;; status) status flixd RETVAL=$? ;; *) msg_usage "$0 {start|stop|restart|status}" exit 3 ;; esac exit $RETVAL