(AIX 5L) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d - Aix

This is a discussion on (AIX 5L) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d - Aix ; All: I've seen several posts on various forums, groups and wikis that state that AIX startup/shutdown scripts can be run by placing a "K" or "S" prefixed script (or a symlink) in the appropriate /etc/rc.d/rcX.d folder e.g. /etc/rc.d/rc2.d/ . I'll ...

+ Reply to Thread
Results 1 to 14 of 14

Thread: (AIX 5L) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d

  1. (AIX 5L) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d

    All:

    I've seen several posts on various forums, groups and wikis that state
    that AIX startup/shutdown scripts can be run by placing a "K" or "S"
    prefixed script (or a symlink) in the appropriate /etc/rc.d/rcX.d
    folder e.g. /etc/rc.d/rc2.d/ .


    I'll admit I'm a newbie to AIX, but I think I've investigated this
    enough to state that this is an partially invalid piece of advice ---
    at least with respect to shutdown.


    I know that as a newbie, I should tread carefully here, and in fact,
    I'm secretly hoping that I'll be proven wrong, so that I can learn
    something new, but I think I've performed my due diligence here. I'm
    guessing (I don't really know this) that this advice (with respect to
    shutdown) may be valid in other flavors of UNIX/Linux, but not valid
    in AIX, at least 5.3L.


    I've posted the full scripts at the bottom of my post, so that
    everyone can check my work here.


    From my examination, here is how things really work:


    The /etc/rc.d/rcX.d/ folders CAN be used for startup scripts. Near the
    end of the boot process, /etc/initab is processed. /etc/inittab
    contains the following:



    l2:2:wait:/etc/rc.d/rc 2
    l3:3:wait:/etc/rc.d/rc 3
    l4:4:wait:/etc/rc.d/rc 4
    l5:5:wait:/etc/rc.d/rc 5
    l6:6:wait:/etc/rc.d/rc 6
    l7:7:wait:/etc/rc.d/rc 7
    l8:8:wait:/etc/rc.d/rc 8
    l9:9:wait:/etc/rc.d/rc 9


    Assuming we are running at the standard run-level of "2" /etc/rc.d/rc
    2 is invoked. The rc script checks the parameter (2), validates the
    existance of the specific run-level folder (e.g. /etc/rc.d/rc2.d/),
    and then enumerates the "K" and "S" prefixed scripts.


    Now here is the first suprising (at least to me) bit of info -- at
    boot time, both the K(kill)scripts and the S(Start) scripts are
    invoked! This actually could be a minor problem if the "K" scripts
    exists!


    Now, because the "K" scripts are first executed, and then followed by
    the "S" scripts, of course, our "S" scripts "win out".


    HOWEVER -- there is nothing that I can see that would allow the "K"
    scripts to be invoked on their own. If you invoke /etc/rc.d/rc, you
    are always going to end up with the startup scripts being run. (I
    imagine it would have made more sense if rc took "start" or "kill" as
    a second parameter.


    I imagine one could write a rc.shutdown script that would infact
    invoke the "K" scripts, but it seems a waste -- might as well just
    reference them directly or link to them.


    The only reason I can see that you might want to keep "K" scripts in
    the etc/rc.d/rcX.d/ folders is that one can supposedly run a command
    such as init 2 (or telinit 2) to change your run-level which is
    supposed to re-invoke inittab. (From my experiment, simply re-
    specifiying the same run-level does not re-invoke inittab).

    (There could also be a clever script written to check the run-level,
    and then execute only the "K" scripts. But I haven't found that
    anywhere. Did i miss something?


    So, I'll sit back and let someone else educate me now! (Which I will
    welcome!). But for now, it appears to me that /etc/rc.shutdown is
    where my shutdown scripts need to be referenced.



    Dave



    (POST of /etc/rc.d/rc script follows):

    #!/bin/ksh


    IBM_PROLOG_BEGIN_TAG
    This is an automatically generated prolog.

    bos53J src/bos/etc/rc.d/rc.sh 1.3

    Licensed Materials - Property of IBM

    Restricted Materials of IBM

    (C) COPYRIGHT International Business Machines Corp. 2000,2006
    All Rights Reserved

    US Government Users Restricted Rights - Use, duplication or
    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

    IBM_PROLOG_END_TAG

    ################################################## ###########

    file name: rc
    purpose: run user-provided scripts in rc directories
    ################################################## ###########

    #run level parameter
    run_level=${1}

    #check if valid run level was requested

    case "$run_level"
    in
    01 ) echo "Invalid run level choice; levels 0 and 1 are reserved in
    AIX ";;
    a-zA-Z ) echo "Please enter a run level from 2 to 9";;
    esac

    #check if run level directory exists
    if then

    #get a list of the "kill" scripts in this directory
    k_list=$(ls /etc/rc.d/rc${run_level}.d | grep "^K" | sort -)

    #get a list of the "start" scripts in this directory
    s_list=$(ls /etc/rc.d/rc${run_level}.d | grep "^S" | sort -)

    #execute "kill" scripts
    if then
    for item in ${k_list}
    do
    /etc/rc.d/rc${run_level}.d/${item} stop
    done
    fi

    #execute "start" scripts
    if then
    for item in ${s_list}
    do
    /etc/rc.d/rc${run_level}.d/${item} start
    done
    fi

    else
    echo "Requested run level directory does not exist"
    fi

    exit 0


    (END OF SCRIPT and POST!)

  2. Re: (AIX 5L) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d



    One thing to consider for AIX is that run levels are typically used
    less than in other un*x operating systems.
    It was originally designed to use /etc/inittab and /etc/rc.shutdown
    more extensively than any run level scripts.

    (Compare the /etc/inittab from an AIX box to /etc/inittab from another
    un*x, like a Linux distribution...
    AIX has more entries, and has a default run level of 2)

    What you described for the /etc/rc.d/rc is true, but it seems to me
    that is the way rc works.
    This behaviour also matches the code on my Red Hat laptop.

    You mentioned that this question was for shutting down your
    machine...on AIX the "shutdown" command is
    actually a korn shell script.

    If you look in that script, you will see that only the kill scripts
    are run upon shutdown.
    (And they are being invoked immediately after /etc/rc.shutdown)

    So...Yes, the behaviour you described is true. But you can still use
    K scripts on shutdown.

    Hope this helps,
    Casey

  3. Re: (AIX 5L) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d

    na wrote:
    >
    > I've seen several posts on various forums, groups and wikis that state
    > that AIX startup/shutdown scripts can be run by placing a "K" or "S"
    > prefixed script (or a symlink) in the appropriate /etc/rc.d/rcX.d
    > folder e.g. /etc/rc.d/rc2.d/ .
    >
    > I'll admit I'm a newbie to AIX, but I think I've investigated this
    > enough to state that this is an partially invalid piece of advice ---
    > at least with respect to shutdown.


    It looks like you've inadequately understood it.

    > I know that as a newbie, I should tread carefully here, and in fact,
    > I'm secretly hoping that I'll be proven wrong, so that I can learn
    > something new, but I think I've performed my due diligence here. I'm
    > guessing (I don't really know this) that this advice (with respect to
    > shutdown) may be valid in other flavors of UNIX/Linux, but not valid
    > in AIX, at least 5.3L.
    >
    > ...
    >
    > From my examination, here is how things really work:
    >
    > The /etc/rc.d/rcX.d/ folders CAN be used for startup scripts. Near the
    > end of the boot process, /etc/initab is processed. /etc/inittab
    > contains the following:
    >
    > l2:2:wait:/etc/rc.d/rc 2
    > l3:3:wait:/etc/rc.d/rc 3
    > l4:4:wait:/etc/rc.d/rc 4
    > l5:5:wait:/etc/rc.d/rc 5
    > l6:6:wait:/etc/rc.d/rc 6
    > l7:7:wait:/etc/rc.d/rc 7
    > l8:8:wait:/etc/rc.d/rc 8
    > l9:9:wait:/etc/rc.d/rc 9
    >
    > Assuming we are running at the standard run-level of "2" /etc/rc.d/rc
    > 2 is invoked. The rc script checks the parameter (2), validates the
    > existance of the specific run-level folder (e.g. /etc/rc.d/rc2.d/),
    > and then enumerates the "K" and "S" prefixed scripts.
    >
    > Now here is the first suprising (at least to me) bit of info -- at
    > boot time, both the K(kill)scripts and the S(Start) scripts are
    > invoked! This actually could be a minor problem if the "K" scripts
    > exists!


    Indeed, but it's very unlikely that you'd want to both stop and start
    the same program for any one run level.

    > Now, because the "K" scripts are first executed, and then followed by
    > the "S" scripts, of course, our "S" scripts "win out".
    >
    > HOWEVER -- there is nothing that I can see that would allow the "K"
    > scripts to be invoked on their own. If you invoke /etc/rc.d/rc, you
    > are always going to end up with the startup scripts being run. (I
    > imagine it would have made more sense if rc took "start" or "kill" as
    > a second parameter.
    >
    > I imagine one could write a rc.shutdown script that would infact
    > invoke the "K" scripts, but it seems a waste -- might as well just
    > reference them directly or link to them.
    >
    > The only reason I can see that you might want to keep "K" scripts in
    > the etc/rc.d/rcX.d/ folders is that one can supposedly run a command
    > such as init 2 (or telinit 2) to change your run-level which is
    > supposed to re-invoke inittab. (From my experiment, simply re-
    > specifiying the same run-level does not re-invoke inittab).
    >
    > (There could also be a clever script written to check the run-level,
    > and then execute only the "K" scripts. But I haven't found that
    > anywhere. Did i miss something?
    >
    > So, I'll sit back and let someone else educate me now! (Which I will
    > welcome!). But for now, it appears to me that /etc/rc.shutdown is
    > where my shutdown scripts need to be referenced.


    I've never looked into this on AIX in particular, but what you describe
    above is typical for UNIX System V based startup/shutdown scripts. You
    appear to understand the mechanics correctly, but you've missed how it
    works overall.

    When the system is entering run level X, the K scripts in rcX.d are run,
    then the S scripts are run. The idea is that the K scripts stop anything
    which might be running but which should not be running when we enter run
    level X, then the S scripts start anything which should be running.

    I don't know how AIX uses the run level values, but let's assume the
    following which I've seen on other systems:

    2 - system up normally without networking
    3 - system up normally with networking
    5 - shut down
    6 - reboot

    Considering just these run levels, let's assume I have a script to
    control a networking server. I'd put an S link to this script in rc3.d
    and K link to it in rc2.d, rc5.d, and rc6.d. That way, the server gets
    started whenever the system enters run level 3, and stopped whenever the
    system enters 2, 5, or 6.

  4. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in/etc/rc.d/rcX.d

    Thanks to Casey and J.J. for their excellent replies. I had a
    feeling I was going to get educated, and I was right! Here is a bit
    more for anyone following along, some additional information that they
    might find useful.


    Of course, casey was right about shutdown being a shell script, and
    calling only the kill scripts. Duh!!! -- just goes to show what being
    a newb is all about!

    In looking at the shutdown script, it appears as I read it that the
    KillScripts in every rc.d/rcX.d will get run, since they all get
    collated together. Again, nothing to get to excited about, but not
    very obvious or intuitive. I would have expected that it would have
    checked the current run level and would have run only those K's. But
    what the hey. (For entertainment, I've cut out the script segment
    and again pasted at the bottom of this post.)

    Re JJs post --- as he notes, he hasn't worked with AIX, and in fact
    the run levels are in fact different. (In fact they are pretty much
    undefined except that 0 and 1 are "reserved" and 2 is offically
    defined as Multiuser mode with NFS resources shared. There's also a
    special a,b and c "psuedo" level.) I can see where his suggestion on
    utililing "K" scripts would be useful if AIX used them in a more
    standard method. (Although I'd still posit that it would just be
    cleaner/ more intuitive if at startup only the S scipts were run. If
    a run level change was made, firstrun the kill kill scripts in your
    current runlevel, then the startup in the level you are moving to.
    But since that is a wish and not how AIX behaves, his point is well
    taken.)


    Again, thanks to both gents, and hope posterity finds this post useful
    somehow! ;-0

















    ============ SHUTDOWN scrpt excerpt =============
    # Let system know that we are starting our shutdown sequence.
    reboot -p

    if [ $nohalt = off ]
    then
    # /etc/rc.shutdown is for adminstrators to create for
    their
    # own local needs. If it is not successful, shutdown
    will
    # abort.
    if [ -x /etc/rc.shutdown ]
    then
    sh /etc/rc.shutdown
    if [ $? -ne 0 ] ; then
    dspmsg -s 1 shutdown.cat 60 \
    "/etc/rc.shutdown failed. Shutdown aborting.
    \n"
    exit 1
    fi
    fi

    # Added to run stop scripts for all runlevels

    rcdirs=`ls /etc/rc.d | grep "rc[0-9].d"`
    echo "${rcdirs}" | while read dir
    do

    #get a list of the "kill" scripts in this directory
    k_list=$(ls /etc/rc.d/${dir} | grep "^K" | sort -)

    #execute "kill" scripts
    if [[ -n ${k_list} ]] then
    echo "${k_list}" | while read item
    do
    /etc/rc.d/${dir}/${item} stop
    done
    fi

    done

    # End of stop scripts

    ============ SHUTDOWN scrpt excerpt end =========













  5. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in/etc/rc.d/rcX.d

    On Jul 25, 5:40*pm, na wrote:

    > (Although I'd still posit *that it would just be
    > cleaner/ more intuitive *if at startup only the S scipts were run. *If
    > a run level change was made, firstrun the kill kill scripts in your
    > current runlevel, then the startup in the level you are moving to.
    > But since that is a wish and not how AIX behaves, his point is well
    > taken.)



    Thanks for this thread - I have just been struggling with the same
    issues. Being used to Solaris S & K scripts, the AIX way seems most
    strange.

    I wholeheartedly agree that the rc script should be sensible enough
    just to run the Snn scripts; even though it takes no account of
    changing run levels in the way that Solaris does.

    Actually, AIX doesn't seem to make much use of run levels, certainly
    not in the way Solaris or Linux do.

    Clearly I'm still finding my feet in the AIX world!

    Rgrds

    Peter

  6. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d

    In article <1275d8d5-f781-4359-9df5-53561a20d3f4@8g2000hse.googlegroups.com>,
    haskett1@googlemail.com writes:

    >
    > Actually, AIX doesn't seem to make much use of run levels, certainly
    > not in the way Solaris or Linux do.
    >


    I"m not an expert on Solaris (except running such boxes as hobbyist
    at home), but I suspect that there is not that much need to change
    run levels on AIX. A lot of everyday tasks (changing/increasing
    kernel parameters) can be performed in full run without the need to enter
    single user mode, let alone reboot.

  7. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in/etc/rc.d/rcX.d

    On Wed, 06 Aug 2008 12:51:19 +0000, Michael Kraemer wrote:

    > In article
    > <1275d8d5-f781-4359-9df5-53561a20d3f4@8g2000hse.googlegroups.com>,
    > haskett1@googlemail.com writes:
    >
    >
    >> Actually, AIX doesn't seem to make much use of run levels, certainly
    >> not in the way Solaris or Linux do.
    >>
    >>


    We use both, and you are correct; runlevels are vestigial in AIX.
    Everything is runlevel 2.


    > I"m not an expert on Solaris (except running such boxes as hobbyist at
    > home), but I suspect that there is not that much need to change run
    > levels on AIX. A lot of everyday tasks (changing/increasing kernel
    > parameters) can be performed in full run without the need to enter
    > single user mode, let alone reboot.


    Maintenance can be applied multi-user in AIX (a big plus over Solaris).
    Most kernel parameters are dynamic, so no /etc/system changes need be
    made (no such animal in AIX). The rest are either dynamic, or at worst
    require a full reboot. I have never, in 15 years of AIX system
    administration, had to change a runlevel.

    BTW, Solaris isn't so clean anymore. The well-known and easily
    understood Solaris 9 S & K scripts alluded to in an earlier post have
    been replaced by an awful XML-based obfuscated hodgepodge in Solaris 10.

  8. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d

    "F. Michael Orr" writes:
    >Maintenance can be applied multi-user in AIX (a big plus over Solaris).
    >Most kernel parameters are dynamic, so no /etc/system changes need be
    >made (no such animal in AIX). The rest are either dynamic, or at worst
    >require a full reboot. I have never, in 15 years of AIX system
    >administration, had to change a runlevel.


    >BTW, Solaris isn't so clean anymore. The well-known and easily
    >understood Solaris 9 S & K scripts alluded to in an earlier post have
    >been replaced by an awful XML-based obfuscated hodgepodge in Solaris 10.


    Hehe... AIX is a giant obfuscated hodgepodge to those who don't know
    their way around. Solaris 10 and it's smf are great after you learn how
    to deal with them.

    -Mike "still has to read the svcadm man page a lot..."

  9. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in/etc/rc.d/rcX.d

    On Thu, 07 Aug 2008 14:37:03 +0000, Mike Marshall wrote:

    > "F. Michael Orr" writes:
    >>Maintenance can be applied multi-user in AIX (a big plus over Solaris).
    >>Most kernel parameters are dynamic, so no /etc/system changes need be
    >>made (no such animal in AIX). The rest are either dynamic, or at worst
    >>require a full reboot. I have never, in 15 years of AIX system
    >>administration, had to change a runlevel.

    >
    >>BTW, Solaris isn't so clean anymore. The well-known and easily
    >>understood Solaris 9 S & K scripts alluded to in an earlier post have
    >>been replaced by an awful XML-based obfuscated hodgepodge in Solaris 10.

    >
    > Hehe... AIX is a giant obfuscated hodgepodge to those who don't know
    > their way around. Solaris 10 and it's smf are great after you learn how
    > to deal with them.
    >
    > -Mike "still has to read the svcadm man page a lot..."


    That may be. However, I tried to be "good", and do things the new way on
    my first Solaris 10 installation. I had to add another SSH daemon, and
    tried to set it up with the 'svcxxx' commands. The new way of handling
    system services is great for existing ones. It is less so for creating
    new ones. And I could find no Sun documentation on the subject. I ended
    up creating it as a /etc/rc3.d file, the same as Solaris 9.

    This same process, BTW, from beginning to end, was two commands in AIX.
    There may be Sun documentation that I couldn't find, but even if there
    is, it isn't as simple as it was in Solaris 9, nor as simple as it is in
    AIX.

  10. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d

    On 2008-08-11, F. Michael Orr wrote:
    > That may be. However, I tried to be "good", and do things the new way on
    > my first Solaris 10 installation. I had to add another SSH daemon, and
    > tried to set it up with the 'svcxxx' commands. The new way of handling
    > system services is great for existing ones. It is less so for creating
    > new ones. And I could find no Sun documentation on the subject. I ended
    > up creating it as a /etc/rc3.d file, the same as Solaris 9.
    >
    > This same process, BTW, from beginning to end, was two commands in AIX.
    > There may be Sun documentation that I couldn't find, but even if there
    > is, it isn't as simple as it was in Solaris 9, nor as simple as it is in
    > AIX.


    Granted, in the first few releases of Solaris 10 there was painfully
    few documentation on the whole SMF subject. Plus there were quite a
    few bugs, but this was IMHO a general Solaris 10 problem since it
    seemed to be a very rushed release after several resheduled release
    dates. Since those early days there have been quite a few articles
    on BigAdmin on how to integrate new services in the SMF:
    http://www.sun.com/bigadmin/content/selfheal/

    Once you get used to the SMF-way of things, its quite a nice and very
    sophisticated feature and much more powerful than the old rc-scripts.
    My first thought was actually: "wow, this looks like the src on AIX,
    but taken a big step further". On the AIX, Linux and Solaris systems
    i've got to work with i like the service management of Solaris 10/SMF
    the most.

    Regards,

    Frank

  11. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in/etc/rc.d/rcX.d

    On Aug 19, 3:21*am, Frank Fegert wrote:
    > On 2008-08-11, F. Michael Orr wrote:
    >
    > > That may be. *However, I tried to be "good", and do things the new way on
    > > my first Solaris 10 installation. *I had to add another SSH daemon, and
    > > tried to set it up with the 'svcxxx' commands. *The new way of handling
    > > system services is great for existing ones. *It is less so for creating
    > > new ones. *And I could find no Sun documentation on the subject. *Iended
    > > up creating it as a /etc/rc3.d file, the same as Solaris 9.

    >
    > > This same process, BTW, from beginning to end, was two commands in AIX.*
    > > There may be Sun documentation that I couldn't find, but even if there
    > > is, it isn't as simple as it was in Solaris 9, nor as simple as it is in
    > > AIX.

    >
    > Granted, in the first few releases of Solaris 10 there was painfully
    > few documentation on the whole SMF subject. Plus there were quite a
    > few bugs, but this was IMHO a general Solaris 10 problem since it
    > seemed to be a very rushed release after several resheduled release
    > dates. Since those early days there have been quite a few articles
    > on BigAdmin on how to integrate new services in the SMF:
    > *http://www.sun.com/bigadmin/content/selfheal/
    >
    > Once you get used to the SMF-way of things, its quite a nice and very
    > sophisticated feature and much more powerful than the old rc-scripts.
    > My first thought was actually: "wow, this looks like the src on AIX,
    > but taken a big step further". On the AIX, Linux and Solaris systems
    > i've got to work with i like the service management of Solaris 10/SMF
    > the most.
    >
    > Regards,
    >
    > * * * * Frank


    As another AIX newbie I really appreciate this thread.

    I have a question about the startup and shutdown order. Everything I
    am seeing says that the order is s00 then s01, etc..... on start up so
    I might have s10DB then s20LDAP then s30APPSERVER then s40WEBSERVER to
    get the application started in the correct order. I think this is how
    it works and it makes sense.

    My real question is about the shutdown order - is it still in
    ascending numerical sequence? or does it reverse and go in descending
    order? so I stop the WEBSERVER, then APPSERVER, then LDAP and then
    the DB. If it does not work this way it seems like I will kick the
    leggs out from under my application. As an alternative do I just
    number the K scripts in the opposite order as the S scripts.

    Any help is appreciated.

  12. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d

    >My real question is about the shutdown order - is it still in
    >ascending numerical sequence? or does it reverse and go in descending
    >order? so I stop the WEBSERVER, then APPSERVER, then LDAP and then
    >the DB. If it does not work this way it seems like I will kick the
    >leggs out from under my application. As an alternative do I just
    >number the K scripts in the opposite order as the S scripts.


    >Any help is appreciated.


    Run find /etc/rc.d

    sshd seems to still be started "the old way" out of the box, and if nothing
    else, perhaps you can use its startup and shutdown files as guides...

    -Mike

  13. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in/etc/rc.d/rcX.d

    On Oct 1, 3:29*pm, Mike Marshall wrote:
    > >My real question is about the shutdown order - is it still in
    > >ascending numerical sequence? or does it reverse and go in descending
    > >order? *so I stop the WEBSERVER, then APPSERVER, then LDAP and then
    > >the DB. *If it does not work this way it seems like I will kick the
    > >leggs out from under my application. *As an alternative do I just
    > >number the K scripts in the opposite order as the S scripts.
    > >Any help is appreciated.

    >
    > Run * *find /etc/rc.d
    >
    > sshd seems to still be started "the old way" out of the box, and if nothing
    > else, perhaps you can use its startup and shutdown files as guides...
    >
    > -Mike


    Mike,

    Thanks for the reply and I do have some good script examples. I was
    not too clear in my question. I have several elements of my
    application that need to be started in order and then stopped in
    reverse order. So the start up is A B C D and the shutdown is D C B
    A. So which one of these two naming options should I follow:

    Option 1
    S01A
    S02B
    S03C
    S04D

    K01A
    K02B
    K03C
    K04D

    or

    Option 2
    S01A
    S02B
    S03C
    S04D

    K04A
    K03B
    K02C
    K01D

    Thanks for your help.

  14. Re: (AIX 5L) (NOT A) MYTH: Shutdown scripts can be placed in /etc/rc.d/rcX.d


    I have two booted AIX boxes in front of me.

    On the 5.2 box, there's a /usr/samples/rc.d/samples/README.txt that
    goes into the detail you want.

    On the 6.1 box, there's nothing that I can find.


    I found the following under AIX 6.1 at
    http://publib.boulder.ibm.com/infoce...tems/index.jsp
    but it doesn't discuss run order.

    Run level script execution

    Run level scripts allow users to start and stop selected applications while changing the run level.
    Put run level scripts in the subdirectory of /etc/rc.d that is specific to the run level:

    * /etc/rc.d/rc2.d
    * /etc/rc.d/rc3.d
    * /etc/rc.d/rc4.d
    * /etc/rc.d/rc5.d
    * /etc/rc.d/rc6.d
    * /etc/rc.d/rc7.d
    * /etc/rc.d/rc8.d
    * /etc/rc.d/rc9.d

    The /etc/rc.d/rc will run the scripts it finds in the specified directory when the run level changes - first running the stop application scripts then running the start application scripts.
    Note: Scripts beginning with K are stop scripts, while scripts beginning with S are start scripts.

+ Reply to Thread