AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  How to include ControlM Agent Startup Script at OS Boot-Up?

    Posted Thu July 16, 2009 10:10 AM

    Originally posted by: the_smit


    Hi AIX Gurus,
    In what file in AIX should I insert my ControlM agent startup/shutdown script in order for it startup and shutdown automatically the next time I reboot my server?

    TIA!
    #AIX-Forum


  • 2.  Re: How to include ControlM Agent Startup Script at OS Boot-Up?

    Posted Thu July 16, 2009 10:29 AM

    Originally posted by: tony.evans


    Method 1

    /etc/inittab (edit using mkitab) for startup and
    /etc/rc.shutdown for shutdown

    /etc/inittab executes at boot and if /etc/rc.shutdown exists it is executed by the shutdown script

    Method 2

    Use the /etc/rc.d/ structure to put start and stop scripts into the relevant run levels. I've not played with it a great deal but my understanding at least in AIX 5.2 / 5.3 is that it doesn't quite work the same as expected in say, Linux.

    inittab finds and runs startup scripts in the /etc/rc.d/ sub-directories and the shutdown script finds and runs kill scripts in the /etc/rc.d/ sub-directories.

    AIX seems to run ALL kill scripts anywhere under /etc/rc.d/rcX.d and only the startup scripts for the relevant run level.
    #AIX-Forum


  • 3.  Re: How to include ControlM Agent Startup Script at OS Boot-Up?

    Posted Thu July 16, 2009 10:31 AM

    Originally posted by: unixgrl


    Make a script that will do this and can handle a command-line parameter of "stop" or "start". We put ours in /etc/rc.d/rc2.d but you'd want to find out where similar scripts reside on your system. In rc2.d you can have a different script for startup called (S99controlm) and stop (Kcontrolm). When you use this method, the S99 would mean its a startup script and all scripts named this way start in numerical order. In this case it would start last because of the 99.

    You can also just put it in /etc or even another filesystem that you are sure is mounted at boot time.

    Make sure /etc/inittab has an entry in it that will run your script if you put it directly in /etc/ or another location. Look at your /etc/inittab today and get an idea of what runs at boot time and look at those scripts.
    #AIX-Forum


  • 4.  Re: How to include ControlM Agent Startup Script at OS Boot-Up?

    Posted Thu July 16, 2009 10:43 AM

    Originally posted by: tony.evans


    For /etc/rc.d/ stuff here's how we do it.

    Write a single script, put it into /etc/rc.d/init.d, make sure the script accepts a single parameter of start or stop and does the right thing.

    In /etc/rc.d/rc2.d create a link (ln -s) to the script in init.d called Sxxname where xx is a number that dictates where in comparison to other scripts in the directory your script will execute.

    In /etc/rc.d/rc2.d create a link to the script in init.d called Kxxname where xx is a number which dictates when the script is run to stop your app in comparison to other scripts in the directory.

    That way you can manage only a single script (/etc/rc.d/init.d/script).
    #AIX-Forum


  • 5.  Re: How to include ControlM Agent Startup Script at OS Boot-Up?

    Posted Thu July 16, 2009 02:30 PM

    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


  • 6.  Re: How to include ControlM Agent Startup Script at OS Boot-Up?

    Posted Wed September 22, 2010 11:09 AM

    Originally posted by: j.gann


    putting an S and K script (or link) into the same rc directory is common practice on aix although aix will run your kill script on every boot before running the start script that way...

    if in doubt, read the /etc/rc.d/rc script

    other than linux aix does not make much use of runlevels and the concept of rc dirs is not used by the os itself to control any os services. think of it as a crutch to help port other unixes software.

    the native aix mechanism is SRC.
    #AIX-Forum


  • 7.  Re: How to include ControlM Agent Startup Script at OS Boot-Up?

    Posted Tue September 21, 2010 07:24 PM

    Originally posted by: Chuck.Spacey


    Sumanth_Sharma wrote:
    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.


    Could you give more details? I followed it but it does not work, why? Did I miss something? I encountered the same problem.
    #AIX-Forum