Getting Data In

When installing the universal forwarder, why is it unable to create /opt/app/splunkforwarder/var folder?

dmacndawk
New Member

I'm trying to install Splunk Universal Forwarder on Red Hat OS. I am getting stuck at this step. Before this command, I've already ran:

chown -R splunk /opt/app/splunkforwarder
chmod -R 755 /opt/app/splunkforwarder

The permissions and groups are all there. For some reason, it seems like it can't create /opt/app/splunkforwarder/var folder.

[root@server etc]# /opt/app/splunkforwarder/bin/splunk enable boot-start -user splunk --accept-license

Warning: cannot create "/opt/app/splunkforwarder/var/log/splunk"

Warning: cannot create "/opt/app/splunkforwarder/var/log/introspection"
First-time-run has not finished.  Ignore this error when previewing migration - exiting.
0 Karma

gokadroid
Motivator

I think the issue is that when you run chown -R splunk /opt/app/splunkforwarder you are instructing that the ownership of these folders and subfolders shouldo be changed to a user called splunk

However when you are running the Splunk binary you are running it as a root:
[root@server etc]# /opt/app/splunkforwarder/bin/splunk enable boot-start -user splunk --accept-license

Switch to user splunk and then run, which should sort it out.

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!

Defend at Machine Speed: Your Guide to Security Sessions at .conf26

Splunk .conf26   With threats moving at machine speed and attack surfaces expanding across hybrid ...

Where Innovation Takes Flight: The Splunk4Aviation Flight Sim Lands at .conf26

If you hear someone at .conf26 shouting "gear down, GEAR DOWN" across the show floor, you have found us.  The ...

Turn Cisco Telemetry Into Action with Cisco Data Fabric, powered by the Splunk ...

The surge in machine data is already hitting enterprise budgets, and the agentic era will only intensify it. ...