Getting Data In

Does pkgrm stop a splunk forwarder in a clean way on Solaris?

chris
Motivator

Hi

To update our splunk forwarders we use puppet. Puppet first removes the splunk package and then installs the new package.

Is splunk stopped in a clean way when a pkgrm command is issued on Solaris?

We haven't had any trouble so far, we're just not sure if this always works

Thanks,

Chris

0 Karma
1 Solution

pde
Path Finder

preremove executes this:

if [ -x $SPLUNK_HOME/bin/splunk ] ; then
    echo "Attempting to stop splunk."
    $SPLUNK_HOME/bin/splunk stop
fi

So you should be fine unless you've rolled your own SMF service, as I have. In that case, you'll need to tell puppet to disable the service before it removes the package, so the SMF doesn't attempt to restart splunk while it's being removed/reinstalled.

View solution in original post

pde
Path Finder

preremove executes this:

if [ -x $SPLUNK_HOME/bin/splunk ] ; then
    echo "Attempting to stop splunk."
    $SPLUNK_HOME/bin/splunk stop
fi

So you should be fine unless you've rolled your own SMF service, as I have. In that case, you'll need to tell puppet to disable the service before it removes the package, so the SMF doesn't attempt to restart splunk while it's being removed/reinstalled.

pde
Path Finder

I assume that your puppet manifest already knows when it's going to update splunk. If that's so, then just add

service { splunk: ensure =>'stopped', }

before you fetch your distribution file and do the pkgrm/pkgadd. One would think (though YMMV, I don't actually do this myself) that you could define a splunk package and have the splunk service subscribe to it, forcing a restart when the package is updated.

0 Karma

chris
Motivator

Thanks, we do have our own SMF service but it is not setup to restart splunk automatically. So we should be ok. Or do you have an elegant way to detect, that you have to update splunk, so we could do an svcadm disable just before puppet upgrades the package?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...