3 # Startup script for the Flumotion streaming server
5 # flumotion: Flumotion Streaming Server
9 # description: Flumotion is a streaming server for audio and video. \
10 # See http://www.fluendo.com for details.
12 # Source function library.
13 . /etc/rc.d/init.d/functions
15 # paths to files and variables
17 prog=/usr/sbin/flumotion
18 lockdir=/var/lock/subsys
19 rundir=/var/run/flumotion
20 logfile=/var/log/flumotion/service.log
21 sysconfig=/etc/sysconfig/flumotion
23 # source configuration
24 if [ -f $sysconfig ] ; then
28 # to make sure our service log file is always owned by the correct user,
32 chown flumotion $logfile
36 # we have the subsys lock iff this script has been run and a
37 # flumotion process is running
38 # see http://www.redhat.com/magazine/008jun05/departments/tips_tricks/
39 if [ -n "`find $rundir -name 'manager.*.pid' -o -name 'worker.*.pid'`" ]
41 touch ${lockdir}/flumotion
43 rm -f ${lockdir}/flumotion
47 # if arguments are specified, we only start/stop that service part
56 $prog status | cut -f1,2 -d' ' | while read type name
58 startone $type $name || RETVAL=1
67 if test "x$name" == "x"
69 echo $"Please specify a $type name"
73 msg_starting "Flumotion $type $name"
74 daemon --user flumotion $prog -d 3 -l $logfile start $type $name
76 [ $RETVAL = 0 ] && update_lockfile
88 $prog status | cut -f1,2 -d' ' | while read type name
90 if test -e ${rundir}/$type.$name.pid
92 stopone $type $name || RETVAL=1
102 if test "x$name" == "x"
104 echo $"Please specify a $type name"
111 msg_stopping "Flumotion $type $name"
113 $prog stop -d 3 -l $logfile $type $name
115 [ $RETVAL = 0 ] && ok || died
116 [ $RETVAL = 0 ] && update_lockfile
130 $prog status | cut -f1,2 -d' ' | while read type name
132 if test -e ${rundir}/$type.$name.pid
134 condrestartone $type $name || RETVAL=1
144 if test "x$name" == "x"
146 echo $"Please specify a $type name"
150 if test -e ${rundir}/$type.$name.pid
152 stopone $type $name || RETVAL=1
153 startone $type $name || RETVAL=1
173 if test "x$name" == "x"
175 echo $"Please specify a $type name"
181 $prog status $type $name
196 # See how we were called.
206 # FIXME: now that we have condrestart, maybe restart should also handle
207 # stop/start per process, instead of global stop and global start ?
228 echo $"Usage: $service {start|stop|restart|list|status|clean}"