SunOS rc 筆記

6.3.0.1 RC scripts
SunOS 4.1.X uses the RC scripts rc.boot, rc.ip, rc, rc.single, and rc.local, all in /etc. The major functions performed by these scripts are listed in the next table.

SunOS 4.1.X RC Scripts
RC Script Functions
rc.boot bring up the network, matching hostnames with the interfaces

rc.ip

set the default route (required for a diskless client to mount /usr)

mount /usr (read only)

fsck local file systems

rc.ip bring up the network
rc rc.single

mount local file systems

check quotas

rc.local

add additional swap

start lpd

rc.single remount / and /usr read/write

fix up mtab

clean up /etc/ld.so.cache and /etc/utmp

use tzsetup to set the timezone in the kernel

load the keyboard translation table for the current keyboard

rc.local start the portmapper

check for .UNCONFIGURED, if there reconfigure the system

run tzsetup to set the timezone

set the domainname if running NIS

if an NIS server run ypserv

if the NIS master run ypxfrd

if an NIS client run ypbind

run the RPC keyserver, keyserv

set the netmask and broadcast for the network interfaces

set the default route again

diskless clients synchronize time-of-day with their server

if there’s no default route run the route daemon

if specified mount /tmp on swap

mount NFS files

if a name server run the named daemon

start the block I/O daemon, biod

if an NFS server start the nfsd daemons

clean up /etc/motd

start the system log daemon, syslogd

if specified check for a crash dump and save it

initialize any specialized hardware

start any local daemons, e.g. sendmail

if specified, export NFS file systems

if a diskless boot server run rpc.bootparamd

start the file status monitor and locking daemons

any other locally supplied calls

SunOS 5.X uses the RC scripts rcS, rc0, rc1, rc2, rc3, rc5, and rc6 in /sbin. These start or stop services defined in the scripts contained in the /etc/rc#.d directories. The S scripts are run during startup, lower through higher run-level. The K scripts are run during shutdown, higher through lower run-level. These RC scripts provide the functions listed in the next table.

SunOS 5.X RC Scripts
RC Script Functions
/sbin/rcS run the scripts in /etc/rcS.d
/etc/rcS.d/S30rootusr.sh configure the network, match hostnames to interfaces

set the default route

mount /usr (read only)

/etc/rcS.d/S33keymap.sh loads the keyboard mappings
/etc/rcS.d/S35cacheos.sh configures the devices when running cachefs
/etc/rcS.d/S40standardmounts.sh add physical swap space

check and remount / and /usr read/write

/etc/rcS.d/S50/S50drvconfig configure the /devices directory
/etc/rcS.d/S60devlinks configure the /dev directory
/etc/rcS.d/S70buildmnttab.sh mount file systems for single user mode
/sbin/rc0 run the scripts in /etc/rc0.d, kill all processes,

sync the file systems, unmount all partitions,

bring the system down

/etc/rc0.d/K10dtlogin initiate the CDE tasks
/etc/rc0.d/K20lp stop the line printer daemon
/etc/rc0.d/K42audit stop the audit daemon
/etc/rc0.d/K47asppp stop the PPP daemon
/etc/rc0.d/K50utmpd stop the utmp daemon
/etc/rc0.d/K55syslog shutdown the system log daemon
/etc/rc0.d/K57sendmail stop the sendmail daemon
/etc/rc0.d/K66nfs.server kill the nfs, mount, bootparam and rarp daemons
/etc/rc0.d/K68rpc kill rpc daemons
/etc/rc0.d/K69autofs stop the automount daemon
/etc/rc0.d/K70cron shutdown cron
/etc/rc0.d/K75nfs.client kill lockd, statd, and the automounter
/etc/rc0.d/K76ncsd kill ncsd daemons
/etc/rc0.d/K85rpc kill rpc daemons
/sbin/rc1 run the scripts in /etc/rc1.d, kill all processes,

unmount all partitions, leave the system in single-user mode

/etc/rc1.d/K10dtlogin initiate the CDE tasks
/etc/rc1.d/K42audit stop the audit daemon
/etc/rc1.d/K47asppp stop the PPP daemon
/etc/rc1.d/K50utmpd stop the utmp daemon
/etc/rc1.d/K55syslog stop syslog
/etc/rc1.d/K57sendmail stop sendmail
/etc/rc1.d/K65nfs.server shutdown NFS services
/etc/rc1.d/K67rpc shutdown RPC services
/etc/rc1.d/K68autofs stop the automount daemon
/etc/rc1.d/K70cron shutdown cron
/etc/rc1.d/K76ncsd kill ncsd daemons
/etc/rc1.d/K80nfs.client unmount all NFS file systems
/etc/rc1.d/S01MOUNTFSYS mount all local file systems
/sbin/rc2 set the timezone

run the scripts in /etc/rc2.d

/etc/rc2.d/K20lp shutdown the line printer
/etc/rc2.d/K60nfs.server shutdown NFS services
/etc/rc2.d/S01MOUNTFSYS mount all local file systems
/etc/rc2.d/S05RMTMPFILES clean up /tmp and /var/tmp
/etc/rc2.d/S20sysetup print the system configuration

if specified save the core image

/etc/rc2.d/S21perf enable system performance accounting
/etc/rc2.d/S30sysid.net if /.UNCONFIGURED exists reconfigure the system
/etc/rc2.d/S47asppp start the PPP daemon
/etc/rc2.d/S69inet configure the default route

set the domainname

/etc/rc2.d/S70uucp clean up uucp locks
/etc/rc2.d/S71rpc start rpc

start NIS(+) daemons

/etc/rc2.d/S71sysid.sys if /.UNCONFIGURED exists reconfigure the system
/etc/rc2.d/S71yp start up NIS (up) services
/etc/rc2.d/S72autoinstall if /AUTOINSTALL exists re-install the OS
/etc/rc2.d/S72inetsvc set the default interface for multicasting

start inetd

if a name server start named

/etc/rc2.d/S73nfs.client start lockd and statd

mount NFS file systems

/etc/rc2.d/S74autofs start the automount daemon
/etc/rc2.d/S74syslog start the system log daemon
/etc/rc2.d/S75cron start cron
/etc/rc2.d/S76nscd start up the name service cache daemon
/etc/rc2.d/S80PRESERVE save edit files in /usr/preserve
/etc/rc2.d/S80lp start the line printer scheduler
/etc/rc2.d/S88utmpd start up utmpd to clean up utmp entries
/etc/rc2.d/S88sendmail start sendmail
/etc/rc2.d/S92rtvc-config set SunVideo device permissions
/etc/rc2.d/S92volmgt start the volume management daemon
/etc/rc2.d/S93cacheos.finist final cachefs settings
/etc/rc2.d/S99audit start the audit daemon
/etc/rc2.d/S99dtlogin automatically start the CDE login window on the console
/sbin/rc3 run the scripts in /etc/rc3.d
/etc/rc3.d/S15nfs.server start the processes required for remote file sharing
/etc/rc3.d/S20sample_daemon start your daemon
/sbin/rc5 run /sbin/rc0, kill off all process, unmount all filesystems
/sbin/rc6 run /sbin/rc0, kill off all process, unmount all filesystems

30.2 SunOS 4.1.X and 5.X Administrative File Differences
The following table lists some of the important files that have been changed.


















Administrative Files
SunOS 4.XSunOS 5.XComments
/boot/ufsbootBoot program.
/etc/auto.master/etc/auto_masterAutomounter configuration file.
/etc/auto.home/etc/auto_homeAutomounter configuration file.
/etc/exports/etc/dfs/dfstabFiles shared by NFS and RFS.
/etc/fstab/etc/vfstabTable of files to mount.
/etc/gettytab/etc/ttydefsTerminal definitions.
/etc/passwd/etc/passwd

/etc/shadow

Shadow password file is now used.
/etc/printcap/usr/share/lib/terminfo

/etc/lp

Database of printer and terminal characteristics.

Directory of printer information.

/etc/rc/sbin/rc#

/etc/rc#.d/

The /etc/rc#.d subdirectory scripts are now used, which each rc# script and rc#.d directory controlling the run-level #.
/etc/rc.boot""
/etc/rc.local""
/etc/rc.single""
/etc/termcap/usr/share/lib/terminfoDatabase of printer and terminal characteristics.
/etc/ttytab/etc/inittabTable of services to be started by init.
NA/etc/safDirectory of SAF services.
NA/etc/default/loginDefaults for login. Root login limited to console.
/usr/share/man/usr/share/manMan page organization has been changed. System administration man pages are in 1M. You can set an environment variable to specify the order of search for directories and sections.
/var/spool/mail/var/mailMail spool directory.
/vmunix/kernel/unix

/platform/\uname -m’/kernel/unix

The hardware independent UNIX kernel.

The hardware dependent part of the kernel.

From : http://wks.uts.ohio-state.edu/sysadm_course/html/sysadm-115.html
http://wks.uts.ohio-state.edu/sysadm-course/html/sysadm-577.html