Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Manually merge changes to pleaserun
Browse files Browse the repository at this point in the history
  • Loading branch information
untergeek authored and jordansissel committed Jul 14, 2015
1 parent e370ff5 commit 00cf4d9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
5 changes: 5 additions & 0 deletions pkg/logstash.default
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@

# Nice level
#LS_NICE=19

# If this is set to 1, then when `stop` is called, if the process has
# not exited within a reasonable time, SIGKILL will be sent next.
# The default behavior is to simply log a message "program stop failed; still running"
KILL_ON_STOP_TIMEOUT=0
22 changes: 14 additions & 8 deletions pkg/logstash.sysv
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description:
# Short-Description:
# Description: Starts Logstash as a daemon.
### END INIT INFO

Expand Down Expand Up @@ -51,7 +51,7 @@ start() {
export PATH HOME LS_HEAP_SIZE LS_JAVA_OPTS LS_USE_GC_LOGGING

# chown doesn't grab the suplimental groups when setting the user:group - so we have to do it for it.
# Boy, I hope we're root here.
# Boy, I hope we're root here.
SGROUPS=$(id -Gn "$LS_USER" | tr " " "," | sed 's/,$//'; echo '')

if [ ! -z $SGROUPS ]
Expand Down Expand Up @@ -91,9 +91,15 @@ stop() {
sleep 1
done
if status ; then
echo "$name stop failed; still running."
if [ "$KILL_ON_STOP_TIMEOUT" -eq 1 ] ; then
trace "Timeout reached. Killing $name (pid $pid) with SIGKILL. This may result in data loss."
kill -KILL $pid
emit "$name killed with SIGKILL."
else
emit "$name stop failed; still running."
fi
else
echo "$name stopped."
emit "$name stopped."
fi
fi
}
Expand Down Expand Up @@ -138,7 +144,7 @@ case "$1" in
;;
stop) stop ;;
force-stop) force_stop ;;
status)
status)
status
code=$?
if [ $code -eq 0 ] ; then
Expand All @@ -148,9 +154,9 @@ case "$1" in
fi
exit $code
;;
restart)
stop && start
restart)

stop && start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|force-stop|status|restart}" >&2
Expand Down

0 comments on commit 00cf4d9

Please sign in to comment.