Ignore:
Timestamp:
Aug 7, 2008, 10:01:06 PM (16 years ago)
Author:
y_z
Message:

simplified the init script to follow sipb-xen-console.init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remctl-auto/debian/sipb-xen-remctl-auto.init

    r834 r875  
    1 #! /bin/bash
    2 ### BEGIN INIT INFO
    3 # Provides:          sipb-xen-remctl-auto
    4 # Required-Start:    $local_fs $remote_fs
    5 # Required-Stop:     $local_fs $remote_fs
    6 # Default-Start:     2 3 4 5
    7 # Default-Stop:      0 1 6
    8 # Short-Description: conserver config from invirt config for invirt host
    9 # Description:       
    10 ### END INIT INFO
     1#!/bin/bash
    112
    12 # Author: Invirt/XVM Project, MIT SIPB <invirt@mit.edu>
     3PACKAGE=sipb-xen-remctl-auto
    134
    14 # Do NOT "set -e"
    15 
    16 # PATH should only include /usr/* if it runs after the mountnfs.sh script
    17 PATH=/sbin:/usr/sbin:/bin:/usr/bin
    18 DESC="Invirt host console config"
    19 NAME=sipb-xen-remctl-auto
    20 SCRIPTNAME=/etc/init.d/$NAME
    21 
    22 # Read configuration variable file if it is present
    23 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
    24 
    25 # Load the VERBOSE setting and other rcS variables
    26 . /lib/init/vars.sh
    27 
    28 # Define LSB log_* functions.
    29 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
    305. /lib/lsb/init-functions
    316
     
    3611}
    3712
    38 #
    39 # Function that starts the daemon/service
    40 #
    41 do_start()
    42 {
    43         # Return
    44         #   0 if daemon has been started
    45         #   1 if daemon was already running
    46         #   2 if daemon could not be started
    47         gen_config
    48 }
    49 
    50 #
    51 # Function that stops the daemon/service
    52 #
    53 do_stop()
    54 {
    55         return 0
    56 }
    57 
    58 do_reload()
    59 {
    60         gen_config
    61 }
    62 
    6313case "$1" in
    64   start)
    65         [ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
    66         do_start
    67         case "$?" in
    68                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    69                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    70         esac
    71         ;;
     14  start|reload|force-reload|restart)
     15    log_begin_msg "Reloading config for $PACKAGE"
     16    gen_config
     17    log_end_msg $?
     18    ;;
    7219  stop)
    73         [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
    74         do_stop
    75         case "$?" in
    76                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    77                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    78         esac
    79         ;;
    80   reload|force-reload)
    81         log_daemon_msg "Reloading $DESC" "$NAME"
    82         do_reload
    83         log_end_msg $?
    84         ;;
    85   restart)
    86         log_daemon_msg "Restarting $DESC" "$NAME"
    87         do_stop
    88         case "$?" in
    89           0|1)
    90                 do_start
    91                 case "$?" in
    92                         0) log_end_msg 0 ;;
    93                         1) log_end_msg 1 ;; # Old process is still running
    94                         *) log_end_msg 1 ;; # Failed to start
    95                 esac
    96                 ;;
    97           *)
    98                 # Failed to stop
    99                 log_end_msg 1
    100                 ;;
    101         esac
    102         ;;
     20    ;;
    10321  *)
    104         echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
    105         exit 3
    106         ;;
     22    log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}"
     23    ;;
    10724esac
    108 
    109 :
Note: See TracChangeset for help on using the changeset viewer.