Thursday, November 26, 2009

Solaris Jumpstart Howto

Here's a procedure in makig a Solaris jumpstart server.

# mkdir /jumpstart/image
# mkdir /jumpstart/config
# mkdir /jumpstart/share

# lofiadm -a /var/tmp/Solaris10_u5_1108.iso
# lofiadm /dev/lofi/1

# svcadm disable volfs
# mkdir -p /cdrom/cdrom0

# mount -F hsfs -o ro /dev/lofi/1 /cdrom/cdrom0

# cd /cdrom/cdrom0/Solaris_10/Tools
# ./setup_install_server /jumpstart/image
Verifying target directory...
Calculating the required disk space for the Solaris_11 product
... output skipped ...

# cd /
# umount /cdrom/cdrom0
# lofiadm -d /dev/lofi/1
# lofiadm
Block Device File

# cd /jumpstart/image/Solaris_10/Misc/jumpstart_sample
# cp ./check /jumpstart/config

# cp /etc/dfs/dfstab /etc/dfs/

# vi /etc/dfs/dfstab
| share -F nfs -o ro,anon=0 /jumpstart/config
| share -F nfs -o ro,anon=0 /jumpstart/image
| share -F nfs -o ro,anon=0 /jumpstart/share

# vi /etc/dfs/dfstab
| share -F nfs -o ro,anon=0 /jumpstart

# svcadm enable nfs/server
# shareall

# vi /jumpstart/config/sysidcfg
| system_locale=en_US
| timezone=MET
| name_service=NONE
| terminal=dtterm
| timeserver=localhost
| root_password="WybF.D5GwZnz2"
| network_interface=primary { netmask= protocol_ipv6=no
| security_policy=NONE
| nfs4_domain=dynamic

# vi /jumpstart/config/sun4u_profile
| install_type initial_install
| system_type standalone
| partitioning explicit
| filesys any 1024 /
| filesys any 1024 /usr
| filesys any 1024 /var
| filesys any 1024 /opt
| filesys any 1024 /export/home
| filesys any 256 swap
| cluster SUNWCreq
| package SUNWman
| package SUNWbash
| package SUNWless

# cd /jumpstart/config
# vi ./rules
| karch sun4u - sun4u_profile -

# ./check

# vi /etc/hosts
| pino

# cd /jumpstart/image/Solaris_10/Tools
# ./add_install_client \
> -e 8:0:20:0:0:02 \
> -i \
> -s tommie:/jumpstart/image \
> -c tommie:/jumpstart/config \
> -p tommie:/jumpstart/config \
> pino \
> sun4u

# svcadm enable rarp

# inetconv

# init 0
ok boot net - install

Create a finish script

# vi /jumpstart/config/sun4u_after
| {
| mkdir /a/server
| mount -F nfs -o ro /a/server
| cp /a/server/crontab.root /a/var/spool/cron/crontabs/root
| cp /a/server/hosts.header /a/hosts
| HOSTNAME=`cat /etc/nodename`
| regel=`grep $HOSTNAME /a/server/`
| echo "$regel loghost ." >> /a/hosts
| grep -v $HOSTNAME /a/server/ >> /a/hosts
| mv /a/hosts /a/etc/hosts
| | umount /a/server
| rmdir /a/server
| touch /a/noautoshutdown
| touch /a/etc/.NFS4inst_state.domain
| } > /a/server.log 2> /a/server.errlog

# vi /jumpstart/share/hosts.header
| #
| # Internet host table
| #

# vi /jumpstart/share/
| tommie
| pino # crontab -l > /jumpstart/share/crontab.root

Update the rules file

# vi rules
| karch sun4u - sun4u_profile sun4u_after

# ./check

Read the rest of this entry...

Bookmark and Share My Zimbio

Thursday, November 12, 2009

Sun INIT States

Sun init States

Solaris init states refer to the level of services provided by the system. The exact services and processes run at each init level are determined by the scripts in the /etc/rc#.d directories. The default service levels for each init state are listed below:

* 0: The system is at the PROM monitor (ok>) or security monitor (>) prompt. It is safe to shut down the system when it is at this init state.
* 1, s or S: This state is known as "single-user" or "system administrator" mode. Root is the only user on the system, and only basic kernel functions are enabled. A limited number of filesystems (usually only root and /usr) are mounted. This init state is often used for sensitive functions (such as kernel libc patches) or while troubleshooting a problem that is keeping the system from booting into multiuser mode.
* 2: Multiple users can log in. Most system services (except for NFS server and printer resource sharing) are enabled.
* 3: Normal operating state. NFS and printer sharing is enabled, where appropriate.
* 4: Usually undefined.
* 5: Associated with the boot -a command. The system is taken to init 0 and an interactive boot is started.
* 6: Reboot. This state takes the system to init state 0 and then to the default init state (usually 3, but can be redefined in the /etc/inittab file).

The init states are defined in the /etc/inittab file, which usually points at the scripts in /sbin/rcrun-level. These scripts in turn examine the contents of the /etc/rcrun-level directories. The scripts in these directories whose names begin with the letter K are run in "stop" mode first in alphabetical order. Then the scripts whose names begin with the letter S are run in "start" mode in alphabetical order.

To get to a desired run level n, each of the rc (run control) scripts from 1 to n is run. To get to run level 0, the K scripts are run in each rc#.d directory between the current run level and 0 in reverse numerical order.

In the default configuration, the rc scripts accomplish the following tasks:

* /sbin/rc0
o Stop system services/daemons.
o Terminate running processes.
o Unmount all file systems.
* /sbin/rc1
o Stop system services/daemons.
o Terminate running processes.
o Unmount all file systems.
o Bring up the system in single-user mode.
* /sbin/rc2
o Set the TIMEZONE variable.
o Stop the print and NFS services.
o Stop the vold daemon.
o Mount local filesystems, enable disk quotas (as appropriate).
o Remove temporary files.
o Create new device entries if this is the result of a boot -r.
o Save a core file if enabled.
o Configure system accounting, (as appropriate).
o Set the default router.
o Set the NIS domain.
o Set up the network interfaces appropriately.
o Start inetd.
o Start named, if appopriate.
o Start rpcbind.
o Start kerbd (the Kerberos client daemon) if appropriate.
o Start ypbind or rpc.nisd as appropriate.
o Start keyserv.
o Start statd and lockd.
o Mount NFS filesystems from /etc/vfstab.
o Start the automounter.
o Start cron.
o Start lp daemons, as appropriate.
o Start sendmail.
* /sbin/rc3
o Clean up sharetab.
o Start nfsd and mountd.
o Start rarpd and rpc.bootparamd, as appropriate.
* /sbin/rc4 is usually not defined. It can be used in a non-default configuration to achieve a tailored run level.
* /sbin/rc5
o Kill print daemons.
o Unmount local file systems.
o Kill syslogd.
o Unmount NFS file systems.
o Stop NFS services.
o Stop NIS services.
o Stop RPC services.
o Stop cron services.
o Stop statd and lockd (NFS client services).
o Kill active processes.
o Initiate an interactive boot.
* /sbin/rc6
o Stop system services/daemons.
o Terminate running processes.
o Unmount all file systems.
o Boots to the initdefault level from the /etc/inittab
* /sbin/rcS: This run level differs from 1 in the following particulars:
o Minimal network is established.
o System name is set.
o root, /usr and /usr/kvm filesystems are checked and mounted (if necessary).
o Pseudo file systems proc and /dev/ are started.
o Rebuilds device entries (for reconfiguration reboots only).

Read the rest of this entry...

Bookmark and Share My Zimbio