Automatic startup of a service on AIX

Posted on 2007-07-30
Medium Priority
Last Modified: 2013-11-17
I need to startup a service on AIX automatically. I have the commands written down in a small shell script.
My question is where do I put this shell script in the AIX file system such that when I reboot the system, the script executes and the service starts up automatically.

I am running AIX 5.2


Question by:pdurbha
LVL 14

Accepted Solution

sjm_ee earned 2000 total points
ID: 19598220

Expert Comment

ID: 19695595
as sjm ee says: /etc/rc.local is a very good place to put them but you also need to call it when the system starts,, we have this line on /etc/inittab

rclocal:2:once:/etc/rc.local > /tmp/rclocal 2>&1

Also, when the system starts goes by default to run level 2 , unless you changed the line

by going to run level 2 it will process the following line in /etc/inittab ...
                       l2:2:wait:/etc/rc.d/rc 2

then /etc/rc.d/rc will go to /etc/rc.d/rc2.d and execute all scripts it finds there with names starting with K and S, and will call them with them with the "stop" and "start" parameter respectively.

Make sure your script are self sufficient with the PATH variable and that the return control to the calling program (spawn a daemon and exit). A similar thing can be done for stop scripts place them on /etc/rc.d/rc6.d and name them starting with K, it will call them with "stop" as parameter when you change to run level 6 (shutdown).


Expert Comment

ID: 20286394
Forced accept.

EE Admin

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question