- Timestamp:
- Nov 22, 2008, 5:36:20 AM (16 years ago)
- Location:
- trunk/packages
- Files:
-
- 2 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 -
trunk/packages/invirt-remote-server/debian/invirt-remote-server.init
r1534 r1740 29 29 do_start() 30 30 { 31 32 33 34 35 36 37 38 31 # Return 32 # 0 if daemon has been started 33 # 1 if daemon was already running 34 # 2 if daemon could not be started 35 gen_files 36 modprobe fuse 37 daemon --running -n $NAME && return 1 38 daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2 39 39 } 40 40 41 41 do_stop() 42 42 { 43 44 45 46 47 48 49 50 51 52 53 54 43 # Return 44 # 0 if daemon has been stopped 45 # 1 if daemon was already stopped 46 # 2 if daemon could not be stopped 47 # other if a failure occurred 48 daemon --stop -n $NAME 49 RETVAL="$?" 50 [ "$RETVAL" = 2 ] && return 2 51 # Many daemons don't delete their pidfiles when they exit. 52 rm -f $PIDFILE 53 umount "$DAEMON_ARGS" 54 return "$RETVAL" 55 55 } 56 56
Note: See TracChangeset
for help on using the changeset viewer.