diff --git a/codepot/sbin/codepot-mon-httpd b/codepot/sbin/codepot-mon-httpd index f6252ffa..9b0e4ab5 100644 --- a/codepot/sbin/codepot-mon-httpd +++ b/codepot/sbin/codepot-mon-httpd @@ -19,8 +19,13 @@ then DAEMON=1 fi +exit_requested=no -while true +trap 'exit_requested=yes' SIGINT SIGHUP SIGTERM + +[ "${DAEMON}" = "1" ] && logger -t "$0" "Started" + +while [ "${exit_requested}" = "no" ] do sleep 5 @@ -54,3 +59,5 @@ END { } ' done + +[ "${DAEMON}" = "1" ] && logger -t "$0" "Exited"