Created
October 4, 2012 22:48
-
-
Save jaytaylor/3836952 to your computer and use it in GitHub Desktop.
SplunkStorm Forwarder Upstart script
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
# SplunkStorm Forwarder | |
description "SplunkStorm Forwarder" | |
start on (net-device-up | |
and local-filesystems | |
and runlevel [2345]) | |
stop on runlevel [016] | |
respawn limit 10 5 | |
console output | |
script | |
sudo /opt/splunkforwarder/bin/splunk start | |
end script | |
# NB: Unfortunately I'm still searching for a way to have a custom stop command run for upstart scripts | |
#pre-stop script | |
# sudo /opt/splunkforwarder/bin/splunk stop | |
#end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I went another way with this. The semi-documented --nodaemon. If you use splunk start/stop,
service splunkforwarder status
will be tracking the wrong pid. The worst case is upstart tracking a pid that doesn't exist (reporting "killed/exited").https://gist.github.com/jettero/628816e582d1b85d0187733f9c109223
I have a script to deal with upstart tracking the wrong pid and refusing to do anything too:
https://gist.github.com/jettero/5076ae465c4a3d0d18936fe337e656f4