All Apps and Add-ons

Why does the Splunk Upgrader for Linux 1.0.3 assume that the Splunk user is root if there is a System Unit file?

BlueSocket
Contributor

I have been trying to get the Splunk Remote Upgrader for Linux Universal Forwarders 1.0.3 app to work and upgrade our UFs.

The UFs are installed on a supported version of Rocky Linux (9) and we used the .tgx file to install and upgrade the UFs to 9.4.7. The UFs are running as the "splunk" user using the command below to set up and we set the splunk user to be able to read our resources okay.

splunk enable boot-start -systemd-managed 1 -user splunk

Now, when I use the new app on some of my UFs to Splunk 9.4.8/9, etc, the upgrade seems to complete, but Splunk refuses to start up 3 times and then it rolls back the upgrade to 9.4.7.

In the history folder, I see that the logs look for the System Unit file (/etc/systemd/system/SplunkForwarder.service) and if it exists, then the Upgrader assumes that the user running Splunk is root:root and then uses chown -R root:root to the Splunk folder and then the splunk user does not have access to the folder and the start fails. The section in the splunk_util.sh where I found this is:

        if [ -f "$SPLUNK_CUSTOM_UNIT_FILE_PATH" ] || [ -f "$SPLUNK_DEFAULT_UNIT_FILE_PATH" ]; then

            # if any unit file exists, must run splunk as root/sudo

            print_info "Found Splunk unit file. Will start Splunk as ROOT/SUDO."

            splunk_user="root"

It is not true that if the System Unit file (SplunkForwarder.service) exists, then root must be running Splunk - it contains the lines below that tell systemd to start Splunk as the splunk user and the Upgrader should be looking into the file itself to find the real user.

User=splunk

Group=splunk
root is the user who has access to run "systemctl restart SplunkForwarder", but Splunk is not running as root and never has.

If I can stop the process and prevent the Upgrader from rolling back to 9.4.7, then I can run a disable boot-start and then do a enable boot-start and it works, but that is a hack, personally?!

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I suggest you submit a case to Splunk Support.  The upgrader should not assume the UF runs as root.  Running as root is a Bad Practice.

---
If this reply helps you, Karma would be appreciated.
0 Karma

BlueSocket
Contributor

Agreed @richgalloway . However, I am not in a position to be able to raise a case with Splunk Support. I am hoping that someone else will read this when they have the same problem and raise the case themselves.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If you can't submit a case then submit it as an RFE at https://ideas.splunk.com

---
If this reply helps you, Karma would be appreciated.
0 Karma

BlueSocket
Contributor

Thanks for the suggestion, @richgalloway . Looking back on this, I think that this is an environmental issue and I think that I know why the Upgrader is using the root user for the upgrade - so that it can do the upgrade as root and then put it back to the original user, but for some reason, it is not putting it back.

richgalloway
SplunkTrust
SplunkTrust

Yes, the upgrader has to run as root to do its work, but the end result should be the UF running as the specified non-root user.  If that is not happening then it's a problem that should be reported using one of the methods previously mentioned.

---
If this reply helps you, Karma would be appreciated.
0 Karma

BlueSocket
Contributor

@richgalloway , I have created an idea, as you suggested:
https://ideas.splunk.com/ideas/APPSID-I-1084

 

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...