You are on page 1of 3

Solaris 10 System Administration ok boot –s ( Boot in single user mode ) Managing Services

# who –r ( Check run level ) % svcs -l network/login:rlogin

Basic Administration ok boot –a ( Boot interactively ) Shows the Status of the rlogin Service
By Johnell Averilla ok sync ( Synchronizes the file systems ) % svcs –a
ok boot -m milestone=all ( Ensures starting of third party services ) Show status of all services
ok boot –m verbose ( Boot in verbose mod e) % inetadm
Managing User and Groups Show status of services controlled by inetd
/etc/profile →$HOME/.profile Forgot Root Password % svcs –D milestone/multi-user
sh, ksh, bash initialization ok boot cdrom -s Displays services instances dependent on the multiuser milestone
/etc/.login → $HOME/. cshrc →$HOME/.login # mount /dev/dsk/c0t3d0s0 /a % svcs –d milestone/multi-user:default
csh initialization # cd /a/etc Display the Service Instances That the Multiuser Milestone Is
$HOME/.dtprofile # TERM=vt100 Dependent On
CDE initialization # export TERM
/etc/skel/* # vi shadow ( Remove root password hash )
Template files (local.cshrc, local.login, local.profile) copied to # cd / Disabling the rlogin Service
new user’s home directory. # umount /a # svcs -D network/login:rlogin ( Check if there are dependents )
# groupadd -g GID groupname # init 6 # svcadm disable network/login:rlogin
Add new group in local machine # svcs network/login:rlogin ( Check status if already disabled )
# useradd -u UID -g GID -d /export/home/username –s /bin/csh -c SPARC BOOT PROCESS
"Comment Here" -m -k /etc/skel username A. Boot PROM Enabling the rlogin Service
Add new user in local machine (-m automatically create home 1. The PROM displays system identification information and then runs # svcs -l network/login:rlogin | grep enabled
directory) self-test diagnostics to verify the system's hardware and memory. # svcadm enable network/login:rlogin
# /usr/sadm/bin/smgroup add -D nis:/starlite/ -- -g 103 -n 2. The PROM loads the primary boot program, bootblk. This program's # svcs network/login:rlogin
gelfs purpose is to load the secondary boot program (that is located in the
Add Group (NIS Host starlite) UFS file system) from the Enabling a Service in Single-user Mode
# /usr/sadm/bin/smuser add -D nis:/starlite/ -- -u 1004 -n default boot device. # svcadm enable -rt rpc/bind
camille -c "Camille G." -d /export/home/camille -s /bin/csh -g gelfs B. Boot programs ( The option –r recursively restarts all dependencies; -t starts service in
Add User (NIS Host starlite) 3. The bootblk program finds and executes the secondary boot temporary mode )
program, ufsboot, and loads it into memory.
Sharing a User’s Home Directory 4. After the ufsboot program is loaded, the ufsboot program loads the # svcadm restart FMRI
# svcs network/nfs/server ( Verify that the mountd daemon is running ) kernel. Restart Service ( FMRI – Fault management resource indentifier )
# svcadm network/nfs/server ( Starting mountd daemon ) C. Kernel initialization
# share ( Lists shared file systems ) 5. The kernel initializes itself and begins loading modules by using
# vi /etc/dfs/dfstab ufsboot to read the files. When the kernel has loaded enough modules Restore a Service That Is in the Maintenance State
Add the ff line: share -F nfs /file-system to mount the root (/) file # svcs -p FMRI (Determine if any process are dependent to the service)
# shareall -F nfs (Share the file systems listed in the /etc/dfs/dfstab) system, the kernel unmaps the ufsboot program and continues, using # pkill -9 PID ( Kill any dependent process still running )
its own resources. # cat /var/svc/log ( Check logs for errors )
Mounting a User's Home Directory 6. The kernel creates a user process and starts the /sbin/init process. # svcadm clear FMRI ( Restore service )
# vi /etc/vfstab This process starts other processes by reading the /etc/inittab file.
( Add the line below) D. init Howto Revert to Another SMF Snapshot
venus:/export/home/johnell - /export/home/john nfs - yes rw 7. In Solaris 10, the /sbin/init process starts /lib/svc/bin/svc.startd, # svccfg
# mkdir -p /export/home/john which starts system services that do the following: svc:> select system/console-login:default
# mountall ( All entries in vfstab are mounted ) ■ Check and mount file systems svc:/system/console-login:default> listsnap
# mount ( Lists all mounts ) ■ Configure network and devices initial
■ Start various processes and perform system maintenance tasks. running
Shutting Down and Booting In addition, svc.startd executes the run control (rc) scripts for
Shutting Down svc:/system/console-login:default> revert start
compatibility. svc:/system/console-login:default> quit
# who ( Lists all currently login users )
# shutdown –i0 –g60 –y (-i init-level –g grace period) # svcadm refresh system/console-login
Run Levels # svcadm restart system/console-login
0 – Power-Down – Shut down operating system (Power down)
Booting System S or S – Single-user – Some file-systems mounted and accessible
ok banner ( Display Harware info and PROM version ) How to Create an SMF Profile
1 – Administrative single-user- Access all available file-systems # svccfg extract> profile.xml
ok reset-all ( Clear system registers ) 2 – Multi-user – Normal operation without NFS
ok probe-ide ( Identify IDE devices ) # vi profile.xml ( Change the name of the profile in the service_bundle
3 – Multi-user – Normal operation with NFS (default run level) declaration; Remove/Add any services that should not be managed by
ok probe-scsi ( Identify SCSI devices ) 4 – Not configured by default – Available for customer use
ok printenv ( List environment variables ) this profile. Services starts with <service> ends with </service>. Or
5 – Power-Down –Same as run level 0 changed Enabled Flag. )
ok setenv (Set environment variables ) 6 – Reboot State – Shutdown to level 0 and reboot to level 3
ok boot # svccfg apply profile.xml ( Apply SMF profile )
How to Change an Environment Variable for a Service How to Modify a Command-Line Argument for an 102114
# svcs system/cron inetd Controlled Service # pgrep -f nfs -d, | xargs ps -fp
# svccfg -s system/cron:default setenv UMEM_DEBUG default Adding the Connection Logging (-l) Option to the ftp Command UID PID PPID C STIME TTY TIME CMD
# svccfg -s system/cron:default setenv LD_PRELOAD In this example, the -l option is added to the ftp daemon when it is daemon 101748 1 0 Sep 01 ? 0:06 /usr/lib/nfs/nfsmapid
# svcadm refresh system/cron started. The effect of this change can be seen by reviewing the syslog daemon 101750 1 0 Sep 01 ? 26:27 /usr/lib/nfs/lockd
# svcadm restart system/cron output after a ftp login session has been completed. daemon 101773 1 0 Sep 01 ? 5:27 /usr/lib/nfs/statd
# pargs -e ‘pgrep -f /usr/sbin/cron‘ # inetadm -l svc:/network/ftp:default | grep exec root 101793 1 0 Sep 01 ? 19:42 /usr/lib/nfs/mountd
100657: /usr/sbin/cron exec="/usr/sbin/in.ftpd -a" daemon 102053 1 0 Sep 01 ? 2270:37 /usr/lib/nfs/nfsd
envp[0]: LOGNAME=root # inetadm -m svc:/network/ftp:default exec="/usr/sbin/in.ftpd -a -l" daemon 102114 1 0 Sep 01 ? 0:35 /usr/lib/nfs/nfs4cbd
envp[1]: # inetadm -l svc:/network/ftp:default
envp[2]: PATH=/usr/sbin:/usr/bin SCOPE NAME=VALUE Adding a Run Control Script
envp[3]: SMF_FMRI=svc:/system/cron:default name="ftp" The following example shows how to add a run control script for the xyz
envp[4]: SMF_METHOD=/lib/svc/method/svc-cron endpoint_type="stream" service.
envp[5]: SMF_RESTARTER=svc:/system/svc/restarter:default proto="tcp6" # cp xyz /etc/init.d
envp[6]: TZ=GB isrpc=FALSE # chmod 0744 /etc/init.d/xyz
envp[7]: UMEM_DEBUG=default wait=FALSE # chown root:sys /etc/init.d/xyz
# cd /etc/init.d
exec="/usr/sbin/in.ftpd -a -l" # ln xyz /etc/rc2.d/S99xyz
. # ln xyz /etc/rc0.d/K99xyz
How to Change a Property for an inetd Controlled . # ls /etc/init.d/*xyz /etc/rc2.d/*xyz /etc/rc0.d/*xyz
Service # ftp localhost
Changing the tcp_trace Property for telnet Connected to localhost.
The following example shows how to set the tcp_trace property for 220 yellow-19 FTP server ready. How to Disable a Run Control Script
telnet to true. Checking the syslog output after running a telnet Name (localhost:root): mylogin
command shows that the change has taken effect. 331 Password required for mylogin. You can disable a run control script by renaming it with an underscore
Password: (_) at the beginning of the file name. Files that begin with an underscore
# inetadm -l svc:/network/telnet:default 230 User mylogin logged in. or dot are not executed. If you copy a file by adding a suffix to it, both
SCOPE NAME=VALUE Remote system type is UNIX. files will be run.Rename the script by adding an underscore (_) to the
name="telnet" Using binary mode to transfer files. beginning of the new file.
. ftp> quit # cd /etc/rcn.d
. 221-You have transferred 0 bytes in 0 files. # mv filename _filename
default inherit_env=TRUE 221-Total traffic for this session was 236 bytes in 0 transfers. Verify that the script has been renamed.
default tcp_trace=FALSE 221-Thank you for using the FTP service on yellow-19. # ls _*
default tcp_wrappers=FALSE 221 Goodbye. _filename
# inetadm -m svc:/network/telnet:default tcp_trace=TRUE # tail -2 /var/adm/messages Disabling a Run Control Script
# inetadm -l svc:/network/telnet:default Jun 21 06:54:33 yellow-19 ftpd[100773]: [ID 124999] FTP The following example shows how to rename the S99datainit script.
SCOPE NAME=VALUE LOGIN FROM localhost # cd /etc/rc2.d
name="telnet" [], mylogin # mv S99datainit _S99datainit
. Jun 21 06:54:38 yellow-19 ftpd[100773]: [ID 528697] FTP # ls _*
. session closed _S99datainit
default inherit_env=TRUE
tcp_trace=TRUE Debugging a ServiceThat Is Not Starting
default tcp_wrappers=FALSE # inetconv -i /etc/inet/inetd.conf In this procedure, the print service is disabled.
# telnet localhost Converting /etc/inet/inetd.conf Entries into SMF ServiceManifests Request information about the hung service.
Connected to localhost. Using a Run Control Script to Stop or Start a Service # svcs -xv
Escape character is ’^]’. For example, you can stop the NFS server daemons by typing the svc:/application/print/server:default (LP Print Service)
login: root following: State: disabled since Wed 13 Oct 2004 02:20:37 PM PDT
Password: # /etc/init.d/nfs.server stop Reason: Disabled by an administrator.
Last login: Mon Jun 21 05:55:45 on console # pgrep -f nfs See:
Sun Microsystems Inc. SunOS 5.10 s10_57 May 2004 Then, you can restart the NFS server daemons by typing the following: See: man -M /usr/share/man -s 1M lpsched
# ^D # /etc/init.d/nfs.server start Impact: 2 services are not running:
# pgrep -f nfs svc:/application/print/rfc1179:default
Connection to localhost closed by foreign host. 101773 svc:/application/print/ipp-listener:default
# tail -1 /var/adm/messages 101750 The -x option provides additional information about the service
Jun 21 06:04:57 yellow-19 inetd[100308]: [ID 317013 daemon.notice] 102053 instances that are impacted.
telnet[100625] 101748 # svcadm enable application/print/server
from 32802 101793 Enable the service.
How to Repair a Corrupt Repository pkgtrans
Enter the root password at the sulogin prompt. sulogin enables the root Translates an installable package from one format to another format.
user to enter system maintenance mode to repair the system. The -g option instructs the pkgtrans command to generate and store a
Run the following command: signature in the resulting data stream.
# /lib/svc/bin/restore_repository
How to Boot Without Starting Any Services Add patch to Solaris
If problems with starting services occur, sometimes a system will hang
during the boot. This procedure shows how to troubleshoot this patchrm
problem. Remove patches Solaris
Boot without starting any services.
This command instructs the svc.startd daemon to temporarily disable all
services and start sulogin on the console.
ok boot -m milestone=none
Log in to the systemas root.
Enable all services.
# svcadm milestone all
Determine where the boot process is hanging.
When the boot process hangs, determine which services are not
running by running svcs -a.
Look for error messages in the log files in /var/svc/log.
After fixing the problems, verify that all services have started.
a. Verify that all needed services are online.
# svcs -x
b. Verify that the console-login service dependencies are satisfied.
This command verifies that the login process on the console will run.
# svcs -l system/console-login:default
Continue the normal booting process.

Managing Software
Launches an installer, such as Solaris installation GUI, to add software
from the Solaris media.The installer must be available either locally or

prodreg (GUI)
Launches an installer to add, remove, or display software product
information. Use Solaris Product Registry to remove or display
information about software products that were originallyinstalled by
using the Solaris installation GUI or the Solaris pkgadd command.

Installs a signed or unsigned software package. Pkgadm Maintains the
keys and certificates used to manage signed packages and signed

Checks the installation of a software package.

Lists software package information.

Displays software package parameter values.

Removes a software package.