i installed splunk forwarder and tried to run below command : ./splunk enable boot-start --accept-license. I got below error: Can't create RC file "/etc/init.d/splunk": Permission denied. Is there a way that the RC file is created in some different path.
So if you run the above as root, and substitute splunk with the username of the service account you want to Splunk to run as, then you should be ok.
Additionally, before finalizing this, you should change the ownership of /opt/splunk to the user designated... Do a service splunk stop and then :
chown -R splunk:splunk /opt/splunk
After that, you can start splunk via the service command, or sudo to the user you specified and start it that way. Do not start Splunk as root, or any other user. It will screw with permissions and throw errors.