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'`" ]; then
40 touch ${lockdir}/flumotion
42 rm -f ${lockdir}/flumotion
46 # if arguments are specified, we only start/stop that service part
48 if [ "x$*" != "x" ]; then
54 $prog status | cut -f1,2 -d' ' | while read type name; do
55 startone $type $name || RETVAL=1
64 if [ "x$name" == "x" ]; then
65 nls "Please specify a $type name"
69 msg_starting "Flumotion $type $name"
70 daemon --user flumotion $prog -d 3 -l $logfile start $type $name
72 [ $RETVAL = 0 ] && update_lockfile
77 if [ "x$*" != "x" ]; then
83 $prog status | cut -f1,2 -d' ' | while read type name; do
84 if [ -e ${rundir}/$type.$name.pid ]; then
85 stopone $type $name || RETVAL=1
95 if [ "x$name" == "x" ]; then
96 nls "Please specify a $type name"
103 msg_stopping "Flumotion $type $name"
105 $prog stop -d 3 -l $logfile $type $name
107 [ $RETVAL = 0 ] && ok || died
108 [ $RETVAL = 0 ] && update_lockfile
114 if [ "x$*" != "x" ]; then
120 $prog status | cut -f1,2 -d' ' | while read type name; do
121 if [ -e ${rundir}/$type.$name.pid ]; then
122 condrestartone $type $name || RETVAL=1
132 if [ "x$name" == "x" ]; then
133 nls "Please specify a $type name"
137 if [ -e ${rundir}/$type.$name.pid ]; then
138 stopone $type $name || RETVAL=1
139 startone $type $name || RETVAL=1
147 if [ "x$*" != "x" ]; then
158 if [ "x$name" == "x" ]; then
159 nls "Please specify a $type name"
165 $prog status $type $name
180 # See how we were called.
190 # FIXME: now that we have condrestart, maybe restart should also handle
191 # stop/start per process, instead of global stop and global start ?
197 try-restart|force-reload)
212 msg_usage "$0 {start|stop|restart|try-restart|force-reload|list|status|clean}"