Sha256: ef5110257c12eaa9278484a7dd005ab5b322062c8b281e40eb8b797bb1a9b930
Contents?: true
Size: 1.54 KB
Versions: 38
Compression:
Stored size: 1.54 KB
Contents
#!/bin/sh # # /etc/init.d/splunk # init script for Splunk. # generated by 'splunk enable boot-start'. # ### BEGIN INIT INFO # Provides: splunkd # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start splunk # Description: Splunk indexer service ### END INIT INFO # RETVAL=0 splunk_start() { echo Starting Splunk... <% if @runasroot %> "<%= @splunkdir %>/bin/splunk" start --no-prompt --answer-yes <% else %> /bin/su - splunk -c "\"<%= @splunkdir %>/bin/splunk\" start --no-prompt --answer-yes" <% end %> RETVAL=$? } splunk_stop() { echo Stopping Splunk... <% if @runasroot %> "<%= @splunkdir %>/bin/splunk" stop <% else %> /bin/su - splunk -c "\"<%= @splunkdir %>/bin/splunk\" stop " <% end %> RETVAL=$? } splunk_restart() { echo Restarting Splunk... <% if @runasroot %> "<%= @splunkdir %>/bin/splunk" restart --no-prompt --answer-yes <% else %> /bin/su - splunk -c "\"<%= @splunkdir %>/bin/splunk\" restart --no-prompt --answer-yes" <% end %> RETVAL=$? } splunk_status() { echo Splunk status: <% if @runasroot %> "<%= @splunkdir %>/bin/splunk" status --no-prompt --answer-yes <% else %> /bin/su - splunk -c "\"<%= @splunkdir %>/bin/splunk\" status --no-prompt --answer-yes" <% end %> RETVAL=$? } case "$1" in start) splunk_start ;; stop) splunk_stop ;; restart) splunk_restart ;; status) splunk_status ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac exit $RETVAL
Version data entries
38 entries across 38 versions & 1 rubygems