#!/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 # set some variables export PATH=$PATH:/usr/libexec/on2/flixengine ## 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/libexec/on2/flixengine/mencoder AUTHDIR=/var/lib/on2 check_portmap() { if [ ! -f /var/lock/subsys/portmap ]; then echo >&2 "ERROR: portmap does not appear to be running." echo >&2 "Flix Engine requires the portmap service to run." exit 1 fi # test for running portmapper } start(){ # Check if the service is already running? if [ ! -f /var/lock/subsys/flixd ]; then check_portmap msg_starting "Flix Engine" /usr/sbin/flixd --authdir=$AUTHDIR --pidfile /var/run/flixd.pid RETVAL=$? if [ $RETVAL = 0 ]; then ok else fail fi else msg_already_running "Flix Engine" fi } stop() { # Stop daemons. if [ -f /var/lock/subsys/flixd ]; then killproc --pidfile flixd.pid 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 ;; *) msg_usage "$0 {start|stop|restart}" exit 3 ;; esac exit $RETVAL