Skip to content

Instantly share code, notes, and snippets.

@jaytaylor
Created October 4, 2012 22:48
Show Gist options
  • Save jaytaylor/3836952 to your computer and use it in GitHub Desktop.
Save jaytaylor/3836952 to your computer and use it in GitHub Desktop.
SplunkStorm Forwarder Upstart script
# 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
@jettero
Copy link

jettero commented Jul 12, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment