-
-
Save slavafomin/cef2d5b0f6c6b5a011b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start) | |
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" | |
do_check $VERBOSE | |
case "$?" in | |
0) | |
do_start | |
case "$?" in | |
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; | |
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; | |
esac | |
;; | |
1) [ "$VERBOSE" != no ] && log_end_msg 1 ;; | |
esac | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Function that starts the daemon/service | |
# | |
do_start() | |
{ | |
# Return | |
# 0 if daemon has been started | |
# 1 if daemon was already running | |
# 2 if daemon could not be started | |
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ | |
|| return 1 | |
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ | |
$DAEMON_ARGS 2>/dev/null \ | |
|| return 2 | |
# Add code here, if necessary, that waits for the process to be ready | |
# to handle requests from services started subsequently which depend | |
# on this one. As a last resort, sleep for some time. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment