Changes between Version 17 and Version 18 of Scripts/initd


Ignore:
Timestamp:
Jan 11, 2009, 8:57:51 PM (12 years ago)
Author:
Waldorf
Comment:

remove the lsb LSB log_* functions for greater compatibility + fix pidfile issue (hopefully)

Legend:

Unmodified
Added
Removed
Modified
  • Scripts/initd

    v17 v18  
    9898[ -f /etc/default/rcS ] && . /etc/default/rcS
    9999
    100 # Define LSB log_* functions.
    101 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
    102 . /lib/lsb/init-functions
    103 
    104100#
    105101# Function that starts the daemon/service
     
    120116    #   1 if daemon was already running
    121117    #   2 if daemon could not be started
    122     start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON \
    123             --test -- $TRANSMISSION_ARGS > /dev/null \
     118    start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
     119            --exec $DAEMON --test -- $TRANSMISSION_ARGS > /dev/null \
    124120            || return 1
    125     start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON \
    126             -- $TRANSMISSION_ARGS \
     121    start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
     122            --exec $DAEMON -- $TRANSMISSION_ARGS \
    127123            || return 2
    128124}
     
    160156case "$1" in
    161157  start)
    162         log_daemon_msg "Starting $DESC" "$NAME"
     158        echo "Starting $DESC" "$NAME..."
    163159        do_start
    164160        case "$?" in
    165                 0|1) log_end_msg 0 ;;
    166                 2)  log_end_msg 1 ;;
     161                0|1) echo "   Starting $DESC $NAME succeeded" ;;
     162                *)   echo "   Starting $DESC $NAME failed" ;;
    167163        esac
    168164        ;;
    169165  stop)
    170         log_daemon_msg "Stopping $DESC" "$NAME"
     166        echo "Stopping $DESC $NAME..."
    171167        do_stop
    172168        case "$?" in
    173                 0|1) log_end_msg 0 ;;
    174                 2) log_end_msg 1 ;;
     169                0|1) echo "   Stopping $DESC $NAME succeeded" ;;
     170                *)   echo "   Stopping $DESC $NAME failed" ;;
    175171        esac
    176172        ;;
     
    180176        # 'force-reload' alias
    181177        #
    182         log_daemon_msg "Restarting $DESC" "$NAME"
     178        echo "Restarting $DESC $NAME..."
    183179        do_stop
    184180        case "$?" in
     
    186182                do_start
    187183                case "$?" in
    188                         0) log_end_msg 0 ;;
    189                         1) log_end_msg 1 ;; # Old process is still running
    190                         *) log_end_msg 1 ;; # Failed to start
     184                    0|1) echo "   Restarting $DESC $NAME succeeded" ;;
     185                    *)   echo "   Restarting $DESC $NAME failed: couldn't start $NAME" ;;
    191186                esac
    192187                ;;
    193188          *)
    194                 # Failed to stop
    195                 log_end_msg 1
    196                 ;;
     189                echo "   Restarting $DESC $NAME failed: couldn't stop $NAME" ;;
    197190        esac
    198191        ;;
     
    202195        ;;
    203196esac
    204 
    205 :
    206197}}}