Automatic startup of a service on AIX

Posted on 2007-07-30
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

    LVL 3

    Expert Comment

    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).

    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now