user9368043 wrote:You wouldn't use a bash script at all. Look at what's already in, for example, /etc/rc2.d
Does that mean that I should just put another bash script (which would just call my original bash script) into the /etc/rcX.d folder? Could I place just a link to my original script in there? And which rcX.d folder should I choose (e.g. what number)?
Thanks a lot.
I very strongly recommend you use SMF not a legacy rc script.
Since you already have the script it is a simple one line command invocation with svcbundle(1M) to get it installed and activated with proper dependencies. Unlike on Solaris 10 and Solaris 11, with svcbundle in Solaris 11.1 you don't have to create an XML manifest file for an SMF service it is really just a simple single run of svcbundle.
While an rc script can still work using SMF ensures you get better notification should your script fail - you can get an SMTP message or SNMP trap sent if the script fails - so the service will be in maintenance. The buildin dependency system in SMF ensures you can run your script at the correct point in the start up graph - with legacy rc scripts you are guessing where the correct place is.