Changeset 1740 for trunk/packages/invirt-console-server
- Timestamp:
- Nov 22, 2008, 5:36:20 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-console-server/debian/invirt-console-server.init
r1446 r1740 52 52 do_start() 53 53 { 54 55 56 57 58 59 60 61 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 62 62 } 63 63 … … 67 67 do_stop() 68 68 { 69 70 71 72 73 74 75 76 77 78 79 80 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" 81 81 } 82 82 83 83 do_reload() 84 84 { 85 86 85 gen_config 86 invoke-rc.d conserver-server reload 87 87 } 88 88 89 89 case "$1" in 90 90 start) 91 92 93 94 95 96 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 ;; 98 98 stop) 99 100 101 102 103 104 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 ;; 106 106 reload|force-reload) 107 108 109 110 107 log_daemon_msg "Reloading $DESC" "$NAME" 108 do_reload 109 log_end_msg $? 110 ;; 111 111 restart) 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 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 ;; 129 129 *) 130 131 132 130 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 131 exit 3 132 ;; 133 133 esac 134 134
Note: See TracChangeset
for help on using the changeset viewer.