Link to home
Start Free TrialLog in
Avatar of dhite99
dhite99

asked on

Startup Order for Sun Solaris w/ Respect to Script Execution

System info:

SunOS bartx041 5.10 Generic_147440-12 sun4u sparc SUNW,Sun-Fire-V490

What I need to know is the order solaris executes the various scripts that start things like oracle databases, etc., and the order in which scripts are executed on system shutdown and where they're located.

I see in /etc there is an init.d, but there are also rc<n>.d directories, where <n> is 0-6 and "S":

rc0 -> ../sbin/rc0*
rc1 -> ../sbin/rc1*
rc2 -> ../sbin/rc2*
rc3 -> ../sbin/rc3*
rc5 -> ../sbin/rc5*
rc6 -> ../sbin/rc6*
rcS -> ../sbin/rcS*
rc0.d/
rc1.d/
rcS.d/
rc2.d/
rc3.d/

there are some "S" and "K" prefixed files in the rc<n>.d - one of the files looks to be the oracle database startup/shutdown - I guess what would help at this point is to understand the order that solaris executes the scripts in each of the init.d, rc<n>.d, etc.

Any help is as always appreciated.
Avatar of dhite99
dhite99

ASKER

Update:

Here is what I see with respect to this oracle startup/shutdown script: There seem to be a lot of copies in these directories - if you could clue me in to what is going on with all of this, I would appreciate it.

/rcS.d/K88DMoracle
/rc1.d/K88DMoracle
/rc2.d/S88DMoracle
/rc2.d/K88DMoracle
/rc3.d/S88DMoracle
/init.d/DMoracle
Avatar of slightwv (䄆 Netminder)
The rc#.d the # is the Unix run level.  They startup from 1 to whatever run level you specify.  The stop in reverse order.

The S & K scripts are set up to 'S'tart and 'K'ill.  They should add up to be 999 or 900 ( I forget which) so the startup in one order and stop in the opposite order.  They are executed in order so for example if the S script is 001 the K script would be 998.
Do you understand the order in which the Oracle scripts are executed, and that RAC nodes require individual startups?
SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dhite99

ASKER

Thanks all for comments -

Arnold - couple of follow-on questions:

Here is what is in /etc/inittab:

# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# The /etc/inittab file controls the configuration of init(1M); for more
# information refer to init(1M) and inittab(4).  It is no longer
# necessary to edit inittab(4) directly; administrators should use the
# Solaris Service Management Facility (SMF) to define services instead.
# Refer to smf(5) and the System Administration Guide for more
# information on SMF.
#
# For modifying parameters passed to ttymon, use svccfg(1m) to modify
# the SMF repository. For example:
#
#       # svccfg
#       svc:> select system/console-login
#       svc:/system/console-login> setprop ttymon/terminal_type = "xterm"
#       svc:/system/console-login> exit
#
#ident  "@(#)inittab    1.41    04/12/14 SMI"
ap::sysinit:/sbin/autopush -f /etc/iu.ap
sp::sysinit:/sbin/soconfig -f /etc/sock2path
smf::sysinit:/lib/svc/bin/svc.startd    >/dev/msglog 2<>/dev/msglog </dev/console
p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog
pt:s1234:powerfail:/usr/lib/svc/method/installupdates lock   

Open in new window


Can you identify what runlevel is set from the above? I cannot seem to see it.

In addition, regarding the svcadm manager - how would I determine if that is being used and what it executes (if anything) in addition to the legacy startup scripts?

Thanks!
Avatar of dhite99

ASKER

One other question - if I am reading the comment from slightwv  correctly, it executes all of the "S" prefixed scripts beginning at run level 1, then 2, then 3, and so on. This is to say that the "S" scripts get executed in all of the runlevels if the system is starting up. Is this correct, or does the runlevel get set to one single static number, and only those "S" scripts get executed on startup (for example, statically set the runlevel to 3, then only the scripts in RC3.d)?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The above only deals with the legacy scripts.
A similar process exists within the newer service management system which are usually executed first.
i.e. at runlevel1 svcadm based startup processes run, then the rc1.d, then runlevel2 and rc2.d and runlevel3 and rc3.d.


svcs can be used to query the installed/status of apps/services
http://unix.stackexchange.com/questions/21520/solaris-get-a-list-of-the-commands-run-at-startup-boot
http://www.princeton.edu/~unix/Solaris/troubleshoot/smf.html

To control runlevel on Solaris 10 uses smf.
http://www.linuxquestions.org/questions/solaris-opensolaris-20/default-run-level-550412/
svcadm milestone -d milestone/single-user:default will change the default runlevel on boot to single user.
Avatar of dhite99

ASKER

Excellent information, explanation, & references.

Thank you!