The /opt/splunk/bin/splunk script is already very well suited to be dropped into /etc/init.d on most linux distributions so that splunk can be started and stopped automatically.
I'm requesting that reasonable comments be placed at the top of the file so that Red Hat's chkconfig (and possibly other similar programs) can be used to automatically configure splunk in the appropriate runlevels at the appropriate time. Here's my suggestion for this:
#!/bin/sh
#
- Splunk -- It's tasty.
#
- description: Splunk Log Indexer
- probe: false
- chkconfig: 345 85 1
You'll also need to touch /var/subsys/splunk during 'start', and rm -f /var/subsys/splunk during 'stop', to prevent splunk from trying to start or stop when switching between runlevels.
Finally, an installer option that asks "would you like splunk to start on boot"? Would be nice. This would simply copy the splunk startup script to /etc/init.d then run 'chkconfig --add splunk' and 'chkconfig splunk on'.
Realistically, the last bit would only need to be done on "officially" supported OSes, like RHEL and SLES, and others if you "officially" support them.