Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/goir/system_daemon into g…
Browse files Browse the repository at this point in the history
…oir-master

Conflicts:
	System/Daemon/OS.php
  • Loading branch information
kvz committed Jan 26, 2012
2 parents 45064ce + 8d114f3 commit 1a99b19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions data/template_Debian
Expand Up @@ -66,7 +66,7 @@ do_stop()
# 1 if daemon was already stopped # 1 if daemon was already stopped
# 2 if daemon could not be stopped # 2 if daemon could not be stopped
# other if a failure occurred # other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
RETVAL="$?" RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2 [ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks # Wait for children to finish too if this is a daemon that forks
Expand All @@ -91,7 +91,7 @@ do_reload() {
# restarting (for example, when it is sent a SIGHUP), # restarting (for example, when it is sent a SIGHUP),
# then implement that here. # then implement that here.
# #
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE
return 0 return 0
} }


Expand Down Expand Up @@ -121,6 +121,9 @@ case "$1" in
#do_reload #do_reload
#log_end_msg $? #log_end_msg $?
#;; #;;
status)
status_of_proc $DAEMON $NAME -p $PIDFILE
;;
restart|force-reload) restart|force-reload)
# #
# If the "reload" option is implemented then remove the # If the "reload" option is implemented then remove the
Expand All @@ -144,8 +147,8 @@ case "$1" in
esac esac
;; ;;
*) *)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 3 exit 3
;; ;;
esac esac
Expand Down
2 changes: 1 addition & 1 deletion examples/signals.php
Expand Up @@ -57,7 +57,7 @@


function myHandler($signal) { function myHandler($signal) {
if ($signal === SIGTERM) { if ($signal === SIGTERM) {
System_Daemon::warning('I received the termination signal. ' . $sig); System_Daemon::warning('I received the termination signal. ' . $signal);
// Execute some final code // Execute some final code
// and be sure to: // and be sure to:
System_Daemon::stop(); System_Daemon::stop();
Expand Down

0 comments on commit 1a99b19

Please sign in to comment.