Ticket #3370: etc.rc.d.init.d.mythbackend-pidfile.diff

File etc.rc.d.init.d.mythbackend-pidfile.diff, 1.3 KB (added by Nick Morrott <knowledgejunkie@…>, 13 years ago)

Adds pidfile support to mythbackend init script

  • mythtv/contrib/etc.rc.d.init.d.mythbackend

     
    99#              system is started, in runlevel 5. This allows scheduled \
    1010#              recordings to occur without manual intervention.
    1111# processname: mythbackend
     12# pidfile: /var/run/mythbackend.pid
     13# config: /etc/sysconfig/mythbackend
    1214
    1315# Copyright (c) by Michael Thomson <linux at m-thomson dot net>
    1416# With thanks to Stu Tomlinson <stu at nosnilmot dot com>
     
    6163            echo -n "Starting ${MBE_PROG}: "
    6264            # /usr/local/bin/mythbackend -d -l /some/log/file
    6365            daemon --user ${MBE_USER} ${MBE_LOCATION}${MBE_PROG} \
    64                                       -d -l ${MBE_LOGFILE} ${MBE_OPTIONS}
     66                --daemon --logfile ${MBE_LOGFILE} ${MBE_OPTIONS} \
     67                --pidfile /var/run/${MBE_PROG}.pid
    6568            RETVAL=$?
    6669            [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${MBE_PROG}
    6770            echo
     
    7376        echo -n "Stopping ${MBE_PROG}: "
    7477        killproc ${MBE_LOCATION}${MBE_PROG}
    7578        RETVAL=$?
    76         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${MBE_PROG}
     79        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${MBE_PROG} /var/run/${MBE_PROG}.pid
    7780        echo
    7881        return $RETVAL
    7982}