You need to run this as root, or sudo run this command, because to modify /etc/init.d, you need admin / root privileges. Additionally you need to specify the run-as user:
./splunk enable boot-start --accept-license -user splunk
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.
... View more