Friday 21/11/2008
This document describes some common shell level and system level operations in Solaris 10.
Unlike linux (see FC), there is no resize command so eval `resize` is not available to alter the row and column sizes. However, the rows and columns attributes of stty(1) can used to set the terminal height and width:
bash $ stty rows 90 cols 130
The kernel parameters are configured in solaris by /etc/system, which typically take the form set category:attr=value (e.g., set semsys:seminfo_semmnu=600
The parameters for the currently executing kernel can be dispalyed using either kstat(1) or sysdef(1). E.g., to show the number of cpu's on the current hardware:
bash $ kstat | grep cpu
The sysdef(1) command is more readable and includes output similar to /proc/cpuinfo, /proc/memino and lspci(1).
bash $ sysdef | less
The current filesystem for a given partition can be determined, in Solaris, by using the the name switch (-n) of df(1). E.g.,
bash $ df -n / : ufs /app : lofs /dev : lofs /proc : proc /system/contract : ctfs /etc/mnttab : mntfs /system/object : objfs /etc/svc/volatile : tmpfs /lib/libc.so.1 : lofs /dev/fd : fd /tmp : tmpfs /var/run : tmpfs
The lookback FS (lofs) allows the O/S to mount an existing location to another pathname. We can define a loopback which mounts /new/dist as the lookback filesystem on the root (/) partition. This scenario can be used to test installations of software which simulate the actual root partition by using chroot(1), without actually having to install software in the root.
bash # mkdir /tmp/newroot bash # mount -F lofs /tmp/newroot newcommand bash # chroot /tmp/newroot newcommand
Solaris paritions are mounted at boot from the entries ifeedn /etc/vfstab so to ensure that the loopback /tmp/newroot is booted, we add the relevant entry to the vfstab (last one in the following)
#
# device device mount FS fsck mount mount # to mount to fsck point type pass at boot options # /proc - /proc proc - no - ctfs - /system/contract ctfs - no - objfs - /system/object objfs - no - fd - /dev/fd fd - no - swap - /tmp tmpfs - yes size=1024m / - /tmp/newroot lofs - yes -
the prtconf(1) app will display a number of different statistics about the underlying hardware, such as the amount installed memory and related. The output is voluminous and can be effectively combined with grep(1). E.g.,
bash $ /usr/sbin/prtconf | grep size Memory size: 16384 Megabytes
5. pargs
The pargs(1) program will provide details on the process such as the command line args and execution environment. The user executing pargs must have requusite priviledges to query process information for processes not belonging to them (e.g., a non-priv'd user cannot execute pargs for a process that they don't own).
In version's of solaris prior to 10, it was possible to use the ucb version of ps (/usr/ucb/ps), providing the augxwww option argument to print the command line which with the process was started. However, since solaris 10, the /proc filesystem truncates output to about
Stuart Moorfoot © 21 Nov 2008 foo@bund.com.au