Changeset 3033


Ignore:
Timestamp:
Jul 6, 2010, 12:27:26 AM (14 years ago)
Author:
gdb
Message:

Actually spawn invirtibuilder in the init script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-dev/debian/invirt-dev.init

    r2636 r3033  
    1414# Do NOT "set -e"
    1515
    16 NAME=invirt-dev
     16NAME=invirtibuilder
     17DESC="the Invirt build daemon"
     18DAEMON="/usr/bin/$NAME"
     19PIDFILE="/var/run/$NAME.pid"
    1720GEN_FILES=/srv/repository/conf/distributions
     21
     22[ -x "$DAEMON" ] || exit 0
    1823
    1924. /lib/init/std-init.sh
     
    3843    invirt-build-conf || ret=2
    3944
     45    if [ "$ret" = 0 ]; then
     46        # Return
     47        #   0 if daemon has been started
     48        #   1 if daemon was already running
     49        #   2 if daemon could not be started
     50        log_daemon_msg "Starting $DESC" "$NAME"
     51        if daemon --running -n $NAME; then
     52            log_daemon_msg "$NAME is already running!"
     53            return 1
     54        fi
     55        daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON || return 2
     56    fi
    4057    return $ret
    4158}
     
    4360do_stop()
    4461{
    45     :
     62    # Return
     63    #   0 if daemon has been stopped
     64    #   1 if daemon was already stopped
     65    #   2 if daemon could not be stopped
     66    #   other if a failure occurred
     67    log_daemon_msg "Stopping $DESC" "$NAME"
     68    daemon --stop -n $NAME
     69    RETVAL="$?"
     70    [ "$RETVAL" = 2 ] && return 2
     71    # Many daemons don't delete their pidfiles when they exit.
     72    # rm -f $PIDFILE
     73    return "$RETVAL"
    4674}
    4775
    4876do_reload()
    4977{
     78    do_stop
    5079    do_start
    5180}
Note: See TracChangeset for help on using the changeset viewer.