Ignore:
Timestamp:
Nov 22, 2008, 5:36:20 AM (16 years ago)
Author:
broder
Message:

Punt more tabs

I bet I wrote this with tabs, too. *sigh*

File:
1 edited

Legend:

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

    r1446 r1740  
    5252do_start()
    5353{
    54         # Return
    55         #   0 if daemon has been started
    56         #   1 if daemon was already running
    57         #   2 if daemon could not be started
    58         modprobe fuse
    59         gen_config
    60         daemon --running -n $NAME && return 1
    61         daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
     54    # Return
     55    #   0 if daemon has been started
     56    #   1 if daemon was already running
     57    #   2 if daemon could not be started
     58    modprobe fuse
     59    gen_config
     60    daemon --running -n $NAME && return 1
     61    daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
    6262}
    6363
     
    6767do_stop()
    6868{
    69         # Return
    70         #   0 if daemon has been stopped
    71         #   1 if daemon was already stopped
    72         #   2 if daemon could not be stopped
    73         #   other if a failure occurred
    74         daemon --stop -n $NAME
    75         RETVAL="$?"
    76         [ "$RETVAL" = 2 ] && return 2
    77         # Many daemons don't delete their pidfiles when they exit.
    78         rm -f $PIDFILE
    79         umount "$DAEMON_ARGS"
    80         return "$RETVAL"
     69    # Return
     70    #   0 if daemon has been stopped
     71    #   1 if daemon was already stopped
     72    #   2 if daemon could not be stopped
     73    #   other if a failure occurred
     74    daemon --stop -n $NAME
     75    RETVAL="$?"
     76    [ "$RETVAL" = 2 ] && return 2
     77    # Many daemons don't delete their pidfiles when they exit.
     78    rm -f $PIDFILE
     79    umount "$DAEMON_ARGS"
     80    return "$RETVAL"
    8181}
    8282
    8383do_reload()
    8484{
    85         gen_config
    86         invoke-rc.d conserver-server reload
     85    gen_config
     86    invoke-rc.d conserver-server reload
    8787}
    8888
    8989case "$1" in
    9090  start)
    91         [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
    92         do_start
    93         case "$?" in
    94                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    95                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    96         esac
    97         ;;
     91    [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
     92    do_start
     93    case "$?" in
     94        0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
     95        2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
     96    esac
     97    ;;
    9898  stop)
    99         [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
    100         do_stop
    101         case "$?" in
    102                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    103                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    104         esac
    105         ;;
     99    [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
     100    do_stop
     101    case "$?" in
     102        0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
     103        2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
     104    esac
     105    ;;
    106106  reload|force-reload)
    107         log_daemon_msg "Reloading $DESC" "$NAME"
    108         do_reload
    109         log_end_msg $?
    110         ;;
     107    log_daemon_msg "Reloading $DESC" "$NAME"
     108    do_reload
     109    log_end_msg $?
     110    ;;
    111111  restart)
    112         log_daemon_msg "Restarting $DESC" "$NAME"
    113         do_stop
    114         case "$?" in
    115           0|1)
    116                 do_start
    117                 case "$?" in
    118                         0) log_end_msg 0 ;;
    119                         1) log_end_msg 1 ;; # Old process is still running
    120                         *) log_end_msg 1 ;; # Failed to start
    121                 esac
    122                 ;;
    123           *)
    124                 # Failed to stop
    125                 log_end_msg 1
    126                 ;;
    127         esac
    128         ;;
     112    log_daemon_msg "Restarting $DESC" "$NAME"
     113    do_stop
     114    case "$?" in
     115      0|1)
     116        do_start
     117        case "$?" in
     118            0) log_end_msg 0 ;;
     119            1) log_end_msg 1 ;; # Old process is still running
     120            *) log_end_msg 1 ;; # Failed to start
     121        esac
     122        ;;
     123      *)
     124        # Failed to stop
     125        log_end_msg 1
     126        ;;
     127    esac
     128    ;;
    129129  *)
    130         echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
    131         exit 3
    132         ;;
     130    echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
     131    exit 3
     132    ;;
    133133esac
    134134
Note: See TracChangeset for help on using the changeset viewer.