you can follow the standard Sys V procedure of creating start/stop shell scripts in the /etc/rc.d/* directories. I created the following two scripts:
One moves the system from run level 2 to run level 3. The second, starts both Samba and Tomcat. All of the startup scripts we create run at run level 3. (That’s our convention, not a requirement.) The directory /etc/rc2.d/samples on most AIX systems has a README.txt file and some more sample start/stop scripts.

Script #1 – /etc/rc.d/rc2.d/Ssshd

#!/bin/ksh
##################################################
# name: Ssshd
# purpose: script that will start or stop the sshd daemon.
##################################################

case "$1" in
start )
startsrc -g ssh
;;
stop )
stopsrc -g ssh
;;
* )
echo "Usage: $0 (start | stop)"
exit 1
esac

Script #2 – /etc/rc.d/rc2.d/Ksshd

#!/bin/ksh
##################################################
# name: Ksshd
# purpose: script that will start or stop the sshd daemon.
##################################################

case "$1" in
start )
startsrc -g ssh
;;
stop )
stopsrc -g ssh
;;
* )
echo "Usage: $0 (start | stop)"
exit 1
esac

AIX : To get a daemon to start when the system in rebooted.

Comments

comments

Tagged on: