Originally posted by: SystemAdmin
Two approaches albeit similar are used.
1) Assume your startup/shutdown script is called myapp which accepts the param
start and
stop .In case you have two separate scripts for startup and shutdown, write a myapp script which acts as a wrapper and the
start function in turn invokes the startup script and
stop invokes the shutdown script.
Place your script under the default runlevel (2) rc folder i.e /etc/rc.d/rc2.d/.
Copy the same script
myapp as
Smyapp and
Kmyapp under /etc/rc.d/rc2.d/ assuming 2 is your default runlevel (as is in the case of Aix).
PS: The name
myapp is for example, the name could be anything, only remember to prefix
S and
K for start and kill/shutdown respectively (The /etc/rc.d/rc script invokes during startup/boot all /etc/rc.d/rc{runlevel}.d/S* and similarly /etc/rc.d/rc{runlevel}.d/K* during system shutdown with start and stop args respectively). Please see the /etc/rc.d/rc script yourself it is very straightforward.
2) The other similar approach is to write your scripts under /etc/rc.d/init.d/ ; most application
mysql for ex: putup their script which accepts
start stop and
restart as args under this folder.
#AIX-Forum