For Ubuntu, run this command:

sudo /opt/splunk/bin/splunk enable boot-start

user@host:~$ sudo /opt/splunk/bin/splunk enable boot-start
Init script installed at /etc/init.d/splunk.
Init script is configured to run at boot.
user@host:~$