| Sun Certified System Administrator for Solaris* 2.6 (Part 1) - Cramsession |
1. System Concepts
The Kernel, the shell and the File System
The three common shells for use as command interpreters are the bourne shell (sh), the C shell (csh) and the Korn shell (ksh). The Bourne shell is the default.
| Feature | sh | csh | ksh |
| Aliases | No | Yes | Yes |
| Command line editing | No | Yes | Yes |
| History capability/editing | No | Yes/Yes | Yes/No |
| History execution | No | !n | r n |
| Prompt* | $ | system name% | $ |
| Repeat last command | No | !! |
|
| Initialization file - login | .profile | .login | .profile |
| Initialization file - shell startup | No | .cshrc | user defined |
Multitasking: A processor can run more than one task
Multiuser: More than one user can run processes
Two entities (processes or systems) that cooperate to accomplish a task. A client requests a server to obtain access to information or perform some operation. The server provides the information or operation on behalf of the client. This architecture allows information or specific operations to be performed by a single entity on behalf of multiple clients. This simplifies the design of the client and provides data consistency by making a single entity (the server) responsible for the data.
Host, Network, IP Address, Client and Server
2. Installing the Solaris 2.X Software
A software package is a functional grouping of files and directories. A cluster is a logical grouping of packages. Solaris 2.X is preconfigured into software groups (collection of clusters and packages). There are four software groups (five for Sparc platforms).
| Software Group | Group Contents |
| Core | Required operating system files |
| End user system support | Windowing Environments: Common Desktop Environment (CDE), OpenWindows and Motif runtime Libraries Power Management (energy saving software) Basic networking/printer support Standard UNIX and patch utilities JAVA Virtual Machine |
| Developer system support | End user group plus: |
| Entire distribution | Developer system group plus: |
| Entire distribution plus OEM support (Sparc only) | Entire distribution group plus: |
CD-ROM drive for local installation or network interface for network installation. Solarsi 2.6 supports all sun4c and sun4d platforms along with most sun4u and sun4m platforms. A minimum of 16 MB RAM is required (32MB recommended). Depending on selected software group, 281 to 616 MB of disk space is required.
To prepare and existing system for installation:
The Solaris Interactive Installation program guides the installer step-by-step but only installs the Solaris software. Co-packaged software must be installed later using the co-packaged installation programs.
The Web Start provides a web browser usr interface that allows installation of Solaris and co-packaged software. The default option is to install all software, however only selected software can be installed using a customize option.
3. Booting the Workstation
| Command | Description |
| banner | Display power-on banner |
| .enet-addr | Display ethernet address |
| .idprom | Display formatted ID PROM contents |
| .speed | Display CPU and bus speeds (OpenBoot 3.x) |
| .traps | Display a list of SPARC trap types |
| .version | Display version and date of the boot PROM |
| devalias | Display all current device aliases |
| module-info | Display CPU speed (OpenBoot 2.x) |
| printenv | Display all current NVRAM parameters and default values |
| probe-scsi | Identify the devices attached to the on-board SCSI controller |
| probe-scsi-all | Identify the devices attached to the on-board SCSI controller and the devices attached to SBus SCSI controller(s) |
| show-disks | Display a list of the device paths for installed SCSI disk controllers |
| show-displays | Display a list of device paths for installed display devices |
| show-nets | Display a list of device paths for installed ethernet controllers |
| show-sbus | Display list of installed and probed SBus devices |
| show-tapes | Display a list of device paths for installed SCSI tape controllers |
| show-ttys | Display a list of device paths for installed tty devices |
The default boot device can be changed using by using the setenv boot-device diskn command where n is the disk number, then using the reset command to save the new boot-device value.
| OpenBoot Command | Purpose |
| probe-scsi | Test the built-in SCSI bus for connected devices |
| probe-scsi all | Test all SCSI buses |
| test-all | Test a group of installed devices |
| test floppy | Test diskette drive |
| test /memory | Test memory |
| test net | Test on-board Ethernet controller |
| watch-clock | Test system clock |
| watch-net | Monitor network connection |
The system can be booted from a different boot device and/or program using boot device file options where device is cdrom, disk, floppy, net or tape; file is the name of the program and options are -a (interactive), -h (halt after loading), -s (single user mode)
During the -a boot, alternate information can be such as physical name of root device, location of kernel, directory for modules, name of file system and type of root filesystem.
4. User Security
The id(1M) command without arguments returns the user and group IDs and corresponding user and group names of the invoking process. If effective and real IDs do no match, both are returned. If invoked with -a as an option, then all groups in which the user ID is a member will be returned. If an user name is provided as an argument, then ID and group information on that user is returned.
The superuser account, root, can perform changes to the system configuration and override file access controls because it is associated with a UID of 0. Other accounts can gain superuser privileges by being assigned a UID of 0 and in some cases a GID of 0 or using the su(1M) and providing the root password to become root.
The sysadmin group (group 14) is used to identify system accounts (logins) that are allowed to perform system administration functions. Programs such as admintool(1M) require that the user be a member of the sysadmin group to add, delete or modify the system configuration.
The chown(1M) command to used to change the ownership of a file or directory. Only the owner of the file or an account with superuser privileges can change the ownership of a file. The chgrp(1M) command to used to change the group permission of a file or directory. Only the owner of the file or an account with superuser privileges can change the group of a file.
The last(1) command displays login and logout information about users and terminals. The "last root console" will display all root sessions as well as any user's sessions on the console. The who(1) command displays the accounts currently logged into the system.
The /etc/passwd file: user-name : password : uid : gid : comment : home-dir : login-shell
The /etc/shadow file: user-name : password : last-changed : min-password-age : max-password-age : warning : inactive : expire : flag(future)
The /etc/group file: group-name : password : gid : user,user,user
To restrict superuser logins to the console, remove the comment from the CONSOLE line in /etc/default/login.
Access to the root account is controlled by the associated password.
The /var/adm/loginlog is used to record failed login attempts (root and otherwise). Use of the su(1M) command are logged in /var/adm/sulog (success and failure) while successful attempts are logged in the syslog file.
5. Adding Users and Software With admintool
Create new group: To display Group Window, select Browse then Groups. Select Edit then Add. In the Add Group Window fill in Group Name, Group ID and Member List fields. Click on OK or Apply.
Create new account: To display Users Window, select Browse then Users. Select Edit then Add. In the Add User Window fill in USER IDENTITY fields (User Name, User ID, Primary Group, Secondary Group, Comment and Login Shell), ACCOUNT SECURITY fields (Password cleared until first login, account is locked, no password - setuid only, or normal password), Minimum Changes days, Maximum Change days, Maximum Inactive days, Expiration Date, Warning days) and HOME DIRECTORY fields (check Create Home Dir and enter the full path name in Path). Click OK or Apply.
The /etc/skel directory contains three files:
Passwords can be changed using the passwd(1M) or admintool(1M) command.
To display Users Window, select Browse then Users. Highlight a user account using the mouse. To display the Modify User Window, select Edit then Modify. Fill in the selected ACCOUNT SECURITY fields (see 5.1). Click OK or Apply.
To display Users Window, select Browse then Users. Highlight a user account using the mouse. To display the Modify User Window, select Edit then Modify. Set the ACCOUNT SECURITY Password field to account is locked. Click OK or Apply.
To display Users Window, select Browse then Users. Highlight a user account using the mouse. Select Edit then Delete. In the Warning Window, click Yes to delete.
Add software package: To display Software Window, select Browse then Software. To display the Add Software Window, select Edit then Add. Highlight software package. Click Add.
Remove software package: To display Software Window, select Browse then Software. Highlight the package to remove using the mouse. Select Edit then Delete. In the Warning Window, click Yes to delete.
6. Software Package Administration Commands
Information on installed packages is displayed using: pkginfo pkg_name where pkg_name is the name of the package.
A software package is added from CD-ROM using: pkgadd -d /cdrom/cdrom0 pkg_name
A software package is removed using: pkgrm pkg_name
A software package is added from the default spool directory (/var/spool/pkg) using: pkgadd pkg_name. If a different spool directory is used it is specified using the -d argument: pkgadd -d full_path_to_spool_directory pkg_name
7. Maintaining Patches
Patch information along with security patches and other recommended patches can be obtained from Sun via the World Wide Web (http://www.sun.com) or anonymous ftp (sunsolve1.sun.com or sunsite.unc.edu). Or if a service contract is purchased, patches can be obtained from the regulary distributed patch CD-ROM.
All patches applied are listed using: showrev -p or patchadd -p
The patchadd(1M) command copies files from the patch directory, determines the Solaris version number of the managing host and the target host, updates the pkginfo file of the patched package with information about the patches that are rendered obsolete by the patch being installed, other patches required by this patch, and patches that are incompatible with this patch. During the installation errors are recorded under /var/sadm/patch/patch-number/log.
The patchrm command is used to remove a patch. All files modified by the patch are restored unless:
8. Administration of Initialzation Files
Shell variables can be setup in the .profile by adding:
VARIABLE=value; export VARIABLE
where VARIABLE is the name of the variable and value is the initial value.
The /etc/profile is executed before the account .profile. It can be used to set a default TERM type, display the current disk quota, the message of the day and indicate if the user has e-mail.
The templates under /etc/skel should be customized to reflect the configuration or intended purpose of the system. Likewise, accounts can be customized for a special purpose by modifying the initialization files.
Any system editor can be used to modify initialization files to customize the user's work environment.
9. File Permissions
The umask is the default permissions used when creating a file. Use: umask to display the default. A three digit octal value (provided as an argument to umask) is used to change the default mask. The digits (left to right) refer owner, group and other. The value of the digits indicate the permissions: read (4), write (2) or execute(1) that should be removed from files. For example, a value of 2 removes write permission. A umask of 022 removes write permission for group and others. File created 777 will be set to 755. Files created 666 become 644.
The setfacl command is used to set the access control lists of files.
When executed, files with the setuid permission execute with process UID permissions of the owner. When executed, files with the setgid permission execute with process GID permissions of the group.
A "t" in the other execute of a file or directory permission indicates the save text mode. For files, this informs the operating system to keep the executable in memory after the process using it has exited. It is designed to minimize start up time associated with frequently used programs.
When set on a directory (chmod u+t), only the owner of files or directories under the sticky directory or users with explicit write permissions can delete the files or directories. This allows protection of files and directories under directories that are world writable.
10. Administration and Configuration of CDE
The Login Manager is responsible for displaying the login screen, authenticating users, and starting a user session. The default appearance of the login screen is determined by the contents of the /usr/dt/config/C/Xresources file. To customize the login screen, copy the default Xresources file to /etc/dt/config/C and make the appropriate changes. Behavior (start, stop. etc.) of the Login manager is controled by the dtconfig command.
The Session Manager starts the desktop and restores the environment to (applications, color, fonts, etc.) back to the state when the user last exited. Also these attributes can be configured by modifying the various resources (files that contain enironmental variables and other information). The Session Manager default is usr/dt/config/sys.dtprofile, the system wide settings are under /etc/dt/config/C/sys.resources and the personal settings under home-directory/.dt/sessions/ or home-directory/.dt/display where home-directory is the home directory of the login and display is the name of the dislay.
A set of environmental variables are defined to provide desktop search paths. These are:
| For | Default | System | Personal |
| Applications | DTAPPSEARCH | DTSPSYSAPPHOSTS | DTSPUSERAPPHOSTS |
| Database | DTDATABASESEARCHPATH | DTSYSDATABASEHOSTS | DTSPUSERDATABASEHOSTS |
| Icons | XMICONSEARCHPATH XMICONBMSERACHPATH | DTSPSYSICON | DTSPUSERICON |
| Help data | DTHELPSEARCHPATH | DTSPSYSHELP | DTSPUSERHELP |
The default Front Panel is defined by the file /usr/dt/appconfig/types/C/dtwm.fp By convention, this default file should never be changed. To make system wide customizations, modify /etc/dt/appconfig/types/C/dtwm.fp. To make personal (per login) customizations, modify home-directory/.dt/types/name.fp where home-directory is the home directory of the login and name is the name choosen for the customization. If the system wide or personal customization files do not exist, create it by copying the default file.
To modify the Front Panel, add or change the PANEL, SUBPANEL, BOX, CONTROL or SWITCH definitions in the appropriate customization file. Then restart the Workspace Manager from the Workspace menu.
Actions are macros or functions written to automate desktop tasks that can be associated with icons, Front Panel controls or menu items.
Data Types are used to define or describe the attributes associated with data files. For example, it defines what action shoulkd be performed when a file is double-clicked on or is dragged and dropped onto an application icon.
The Application manager provides a graphical interface for associating a icon with an application and creating a hierarchical directory structure for groups of applications.
There are two ways to add an application to Application Manager:
Administration tasks include creating groups, modifying the search path nad removing applications and groups.
The Desktop Korn Shell (dtksh) provides a way to develop graphical user interfaces through shell scripts. The user interface capabilities are based on the Common Desktop Environment (CDE) Motif widget set, the Xt Intrinsics, and the X11 library. The dtksh is a version of ksh-93 (Korn Shell) extended to access many X, Xt, Motif, and CDE facilities including:
11. Introduction to File Systems
A sector is a grouping of bytes. A track is a grouping of sectors. A cylinder is a grouping of tracks. The number of accessible cylinders on a disk determine its actual storage capacity. This information is stored in the Volume Table of Contents (VTOC) or disk label. For Example:
512 bytes/sector
80 sectors/track
9 tracks/cylinder
720 sectors/cylinder
2500 cylinders
1151 accessible cylinders
512 * 80 * 9 * 1151 = 424,394,640 bytes or 424 MB
11.2 Displaying Device Configurations
Device configuration information is stored in the Volume Table of Contents (VTOC) or disk label. Information contained in the disk label can be displayed using the devinfo(1M), format(1M) or prtvtoc(1M) command.
Disk slices or partitions are identified by the partition table which is a portion of the disk label. This table defines the partition in terms of number, tag (use), size and starting/ending cylinders. The partition table is populated by the fmthard(1M) command and can be viewed using the format(1M) or prtvoc(1M) commands.
A file system is a structure of directories used to organize and store files. The term "file system" is used in several different ways:
| File System | Contents |
| / | System files |
| backup | Backup file system |
| boot | Information required to boot the system |
| home | User account storage space |
| opt | Application software |
| proc | System process information |
| swap | Virtual memory |
| tmp | Temporary files |
| usr | System files and utilities |
| var | System files and logs |
Use df(1)and mount(1M) to display information about mounted file systems.
By default, the mount(1M) command is aware of large files.
Use df(1) to display the amount of used and available space on each mounted file system.
Use du(1) to display the amount space used by a directory and everything under the directory.
Use quota(1M) to display the amount of space used by a user and the quotas for that user.
12. Disk Management
The mkfs(1M) or newfs(1M) utility is used to create file systems. For Sparc platforms, only the UFS type of file systems can be created. Before creating a file system on a disk, the disk must be formatted using format(1M) and the Volume Table of Contents (VTOC) must be populated using fmthard(1M). The prtvtoc(1M) utility can be used to display the VTOC. For x86 platforms, the fdisk(1M) is used to create or modify the partition table.
The fsck(1M) utility is used to check and repair file systems. The following types of file systems are supported by fsck(1M) as identified by the -F option:
| -F option | File System | Description |
| cachefs | Cache | In memory cache file system |
| s5fs | S5 | SVR3 file system |
| ufs | UFS | default SVR4 file system |
The mount(1M) utility is used to mount file systems. The following types of file systems are supported by mount(1M) as identified by the -F option:
| -F option | File System | Description |
| cachefs | Cache | Memory based CD-ROM cache |
| hsfs | High Sierra | CD-ROM file system |
| nfs | NFS | Network file system |
| pcfs | PCFS | MS-DOS diskettes |
| s5fs | S5 | x86 file system |
| tmpfs | Temporary | Memory based system I/O cache |
| ufs | UFS | Default UNIX (BSD) file system |
Not a clue.
A virtual disk management system can overcome disk capacity limitations, improve performance and reliability by supporting various RAID configurations and enhance manageability by the use of a graphical management tool.
Solstice Disksuite Volume Manager from Sunsoft is a software disk array subsystem that manages Solaris partitions to improve performance and reliability while addressing some of the disk capacity limitations.
The Veritas Volume Manager is a disk management software subsystem that in addition to addressing performance, reliability and capacity limitations, also provides performance analysis and dynamic on-line tuning to provide optimal use of storage.
Concatenation combines multiple small physical hard disk slices into a single large logical slice that can be used and managed as a single slice.
Since the data of a striped VFS is spread across the physical hard disk slices in an interlace fashion, this allows increased performance for reads and writes.
13. Script Writing
Note: Only the syntax and capabilities of the Bourne shell are described in this section.
Shell scripts can be used to automate maintenance, administrative and text processing tasks.
A shell varaiable (otherwise known as a keyword parameter) is defined and set using name=value where name is the name of variable and value is contents assigned to the variable (i.e., the variable is set to value), which can be retreived by using the phrase ${name} or if the phrase is unique, simply $name. To avoid problems when a variable is not set, defaults values and actions can be defined and used when the variable is expanded or interpreted:
| ${name:-value} | If name is set and non-null, then use its value; otherwise, use value as default |
| ${name:=value} | If name is not set or is null, then use value as its default |
| ${name:?msg} | If name is set and non-null, then use its value; otherwise print msg and exit |
| ${name:+value} | If name is set and non-null, then replace its value with value |
Positional parameters are used to reference the arguments provided on the command line when the script or function is invoked. Positional parameter $1 refers to the 1st argument, $2 refers to the 2nd arguments, etc. The $0 parameter contains the name of the script or function. The count of postional parameters is contained in $#. The parameters $@ or $* contains all the positional parameters, in order, separated by spaces, starting with $1. The shift command causes the contents of the positional parameters to be shifted. That is, the contents of $1 is discarded, $1 is set to the contents of $2, $2 is set to the contents of $3, etc. The set command can be used to overide the default values of the positional parameters.
Single quotes (') are used for literals or to prevent interpretation. Double quotes (") allow interpretation of variables and commands within a phrase. For example, echo '$parameter' will actually echo $parameter while echo "$parameter" will echo the contents of the variable $parameter, or if it is not set, echo nothing.
The grave accents (`) result in command execution. For example echo "Current directory: `pwd`" will cause the pwd command to be executed and the output from it echoed after the Current directory: phrase.
Both the input and output of a command can be redirected:
| <fubar | Use file fubar as standard input |
| >fubar | Use file fubar as standard output (create or truncate) |
| >>fubar | Use file fubar as standard output (create or append) |
| <>fubar | Open file fubar for reading and writing as standard output |
| <&digit | Use open file associated with file descriptor digit as the standard input |
| &digit | Use open file associated with file descriptor digit as the standard output |
| <&- | Close standard input |
| >&- | Close standard output |
| <<word | Here document (see next paragraph) |
Here Document: After any parameter or command substitution is performed on word, the shell reads (from standard input) up to the first line that matches word or encounters the end of file (EOF). Optionally, a hyphen (-) can be placed between the << and word, such as <<-word which causes the shell to strip leading tabs off the lines read from standard input. A shell script that uses this method to handle input is referred to as a here document since normally interactive input is accepted from a file instead of a keyboard. For example a file contains the following:
ed fubar <<!
1,$s/ABC/CBA/
w
q
!
when executed, this here document will invoke the ed editor on file fubar. In the file, all occurances of ABC will be replaced with CBA. Then the file is save (written) and the editor is exited. Not that the ! is used to delimit the input to the editor. Any character or word can be used as this delimiter, but ! is frequently used.
The purpose of an exit status is to imform the caller of a command, if the command succeeded or failed due to an error. Typically commands return zero on success and non-zero on encountering an error. The keyword parameter ${?} contains the exit status of the last executed command. When a shell script exits, the exit status of the last command is returned. However, the exit status can be defined usng the exit n command, which causes the shell to exit with a status of n.
if condition ; then list1 ; fi
If condition returns a zero exit status, then execute list1.
if condition ; then list1 ; else list2 ; fi
If condition returns a zero exit status, then execute list1 otherwise execute list2.
if condition ; then list1 ; [ elif conditionx ; then listx ; ] ... [ else list2 ] fi
If condition returns a zero exit status, then execute list1 otherwise, continue with testing the "else if" (elif) conditonals. If a conditionx returns a zero exit status, then execute the associated listx. If none of the conditionals return zero, then execute list2.
for name do list done
Set the variable name to a postional parameter then execute the commands in list. Start with postional parameter ${1} and repeat for each postional parameter available.
for name in phrase do list done
Set the variable name to a word from phrase then execute the commands in list. Start with the first word in phrase and repeat for each word available. The phrase can be a variable reference such as ${DIGITS} or a literal such as 0 1 2 3 4 5 6 7 8 9. In either situation, spaces or tabs are used to separate the words within phrase.
case word in
pattern1 ) list1 ;;
pattern2 ) list2 ;;
...
esac
word is compared against the patterns (pattern1, pattern2, ...). The first pattern that matches will result in the corresponding list to be executed.
Shell functions allow repeated portions of script to be written once and called whenever needed. The functions need to be defined before they are called. A function is defined by the following syntax:
name ( )
{
commands
}
Where name is the name of the function and commands is the content of the function.
All of the rc scripts under /etc/init.d are shell scripts along with the system and user profiles.
When a script is envoked using sh -x or contains set -x the commands and arguments are printed as they are executed. This allows viewing command/parameter substitution and is useful in identifying where errors are encountered.
14. Networks
Broadcast Bus - The cable media that is used to transmit data between computer systems.
CSMA/CD - Carrier Sense Multiple Access/Collision Detection
Ethernet Interface - The hardware device that interfaces the computer system to the Ethernet broadcast bus
Ethernet Address - Unique 8 digit hexadecimal number that identifies the computer system.
| Class | Address Range | Leftmost Bits | Network/Host | Max Hosts |
| A | 0 - 127 | 0 | NHHH | 16,777,216 |
| B | 128 - 191 | 10 | NNHH | 65,534 |
| C | 192 - 223 | 110 | NNNH | 254 |
| D | 224 - 239 | 1110 | Multicast |
|
| E | 240 - 255 | 1111 | Experimental |
|
The /etc/inet/hosts (/etc/hosts) file contains the IP addresses and host names of the local system and remote systems. The /etc/nodename file contains the name of the system. The /etc/hostname.hme0 contains either the IP address or hostname of the local system.
The who(1) command can be used to determine who is logged into the local system while the finger(1) command can be used to determine who is logged into the local or a remote system.
Commands can be executed remotely using rsh(1) and remsh(1). Or a user can login to the other machine using telnet(1) or rlogin(1) and execute commands locally.
The ftp(1), rcp(1) and tftp(1) commands can be used to copy files from one machine to another.
These files list systems that are trusted and provide remote authenication for activities associated with rlogin(1), rsh(1) and rcp(1). The .rhosts provides a private list of trusted hostname/username combinations.
The ping(1M) command can be used to test operation of the TCP/IP stack while the spray(1M) command will test the TCP/IP stack and also the operation of the Remote Procedure Call (RPC) capability.
The netstat -i command shows the state of the TCP/IP interfaces.
15. The LP Print Service
By using the BSD protocol (RFC 1179), the Solaris Print service support the Solaris 2.X, the SunOS 4.X and 5.X, and the HP-UX operating systems as print clients.
The LP Print Service is a set of software utilities that allow users to print files while they continue to work. The Print Service provides the ability to add, define/modify and delete printer definitions, provide print scheduling and supports both local and remote printers.
A print server is a system that as a loacl printer attached to it makes makes it available to other systems on the network. A print client is a system that sends its print requests to a print server.
A local printer is a printer attached directly to the local system via a serial or parallel communcation port. A remote printer is a printer attached to another system (or network interface device) that functions as a print server. To access a remote printer from a local system requires defining the local system as a client to the remote printer.
/etc/lp/model/standard is the default model for local printers
/etc/lp/model/netstandard is the default model for remote printers.
The infocmp(1M) command can be used to display a terminfo entry for a printer, if its terminfo name is known. Another method is to change to the /usr/share/lib/terminfo directory and search the subdirectories for an appropriate name.
Add local printer: To display the Printers Windows, select Browse then Printers. To display the Add Local Printer Window, select Edit, then Add then Local Printer ... Fill in Printer name, Description, Printer Port (ports such as /dev/term/a), Printer Type (postscript, HP, etc.), File Contents (PostScript, ASCII, both, none, any), Fault Notification (write superuser, mail superuser,none), Options (default printer, always print banner), and User Access List (default of all - use Add or Delete buttons to modify). Click on OK.
Add remote printer (add printer access on the print client): To display the Printers Windows, select Browse then Printers. To display the Add Access to Printer Window, select Edit, then Add then Access to Printer ... Fill in Printer Name, Print Server, Description, and Option (default printer). Click on OK.
To display the Printers Windows, select Browse then Printers. To display the Modify Window, select Edit, then Modify ... Modify Description, Printer Port (ports such as /dev/term/a), File Contents: (PostScript, ASCII, both, none, any), Fault Notification (write superuser, mail superuser,none), Options (default printer, always print banner, accept print requests, process print requests), or User Access List (use Add or Delete buttons to modify). The Printer Name, Print Server and Printer Type cannot be modified. After making changes, click on OK.
16. Print Commands
Use lp file to submit file to the default printer. Or add -d printer to specify a different printer.
Use lpstat to check the status of print requests.
Use cancel request-ID to cancel print job request-ID. The print request ID is displayed when the print request is submitted or can be determined using lpstat. or use cancel printer to cancel the print job currently printing on printer.
Use lpadmin -p printer -c class where class is the printer class and printer is a printer to be added to the class. This allows users to specify a printer class instead of a printer, The first available printer in the class is will be used. Use lpadmin -r class to delete the class.
Use lpadmin -d printer to designate printer as the default printer or set the LPDEST variable to printer
Use lpmove printer1 printer2 to move all queued prints requests from printer1 to printer2.
Use lp -I request-ID -H priority-tag where request-ID is the request ID of the print request and priority-tag is -hold, -resume or -immediate or use lp -I request-ID -q priority where priority is a number between 0 and 39 (inclusive). Use a priority of zero to move the job to the top of the queue. (The print request ID is displayed when the print request is submitted or can be determined using lpstat).
Use /usr/lib/lp/lpsched to start the LP Print Service and /usr/lib/lp/lpshut to stop the service.
17. Process Control
ps -efl
Among the arguments supported are e (all processes), f (full listing) and l long listing.
kill -s signal pid ...
at -f file -t time
The cron daemon executes commands at specified dates and times in accordance with the instructions in the appropriate crontab files.
minute hour day_of_month month day_of_week command
(0 is sunday)
The two files are /etc/cron.d/cron.allow and /etc/cron.d/cron.deny.
18. Backup and recovery
ufsdump oucf /dev/rmt/n filesystem
ufsrestore tf /dev/rmt/n
To restore the root (/) file system on a SPARC system:
# mount /dev/dsk/c0t3d0s0 /mnt (mount new system disk on temporary mount point)
# cd /mnt
# tapes
# ufsrestore rvf /dev/rmt/0 (restore root to new system disk)
# ls
# rm restoresymtable
# cd /
# umount /mnt
# fsck /dev/rdsk/c0t3d0s0
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t3d0s0 (install boot blocks)
# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t3d0s0
# init 6
To restore the root (/) file system on an x86 system:
# mount /dev/dsk/c0t3d0s0 /mnt
# cd /mnt
# tapes
# ufsrestore rvf /dev/rmt/0
# ls
# rm restoresymtable
# cd /
# umount /mnt
# fsck /dev/rdsk/c0t3d0s0
# installboot /usr/platform/`uname -i`/lib/fs/ufs/pboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t3d0s0
# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t3d0s0
# init 6
For /usr, use the same procedure except do not install the boot block and use the /usr backup tape instead.
Backup: tar cvf /dev/rmt/n directory
Restore: tar xvf /dev/rmt/n directory
mt -f /dev/rmt/n fsf count
(skip forward over count EOF marks. Use bsf to skip backwards)
Backup: ls | cpio -oc > /dev/rmt/n obs=blocksize
Restore: cpio -icvd < /dev/rmt/n
Backup: tar cf - files | rsh remotehost dd of=/dev/rmt/n obs=blocksize
Restore: rsh remotehost dd if=/dev/rmt/n | tar xvBpf -
19. Device Administration
Serial Device - a device that have been designed according to RS-232-C or RS-423 standards (this includes most modems, alphanumeric terminals, plotters, and some printers) that can be plugged into serial ports of computers that have been similarly designed.
Port - a channel through which a device communicates with the operating system. From a hardware perspective, a port is a "receptacle" into which a terminal or modem cable may be plugged. However, a port is not strictly a physical receptacle, but an entity with hardware (pins and connectors) and software (a device driver) components. A single physical receptacle often provides multiple ports, allowing connection of two or more devices.
Serial Port - a port that uses a standard communications protocol to transmit information over a communication line one binary bit at a time.
Modem - a communication device that interfaces a computer/terminal to a phone line and converts digital computer data to analog signals for transmission across the phone line.
Null Modem Cable - a cable that can be used instead of a pair of modems and phone line for short-distance communication.
Hardware Carrier Detect - a communication standard protocol signal that indicates that the carrier signal from the remote end has been detected.
Port Monitor Program - a program that continuously monitors a port for requests to log in or access printers or files.
Modems, alphanumeric terminals, plotters, and some printers are serial devices.
20. The Service Access Facility
The top level SAF process is the Service Access Controller (SAC). It initializes its environment and starts the port monitors as specified in /etc/saf/_sactab file.
The SAC is spawned by init at run level 2.
The ttymon port monitor handles connections requests via serial communication ports. The listen port monitor handles connection-oriented TLI compatible requests.
The /etc/saf/_sactab
The monitoring and setup of a connection via a communication port.
The /etc/ttydefs file
sacadm is used to start, stop, enable, disable, add or remove port monitors. pmadm is used to start, stop, enable, disable, add or remove services for particular communication ports. ttyadm is used to format and fill in information for the /etc/saf/pmtag/_pmtag table.
21. Adding Terminals and Modems
To display the Serial Ports window, select Browse then Serial Ports. Highlight the port to be used. To display the Modify Serial Port Window, select Edit, then Modify. Choose Terminal-Hardwared from the User Template menu, change other settings as required, then click on OK to configure the port.
To display the Serial Ports window, select Browse then Serial Ports. Highlight the port to be used. To display the Modify Serial Port Window, select Edit, then Modify. Choose Modem-Bidirectional from the User Template menu, change other settings as required, then click on OK to configure the port.
The tip command is used to connect to a remote system via a modem and phone line. A set of tilde commands are available to support transfer of files and communication with the remote system. The syntax of the tip command is:
tip [ -v ] [ -speed-entry ] { hostname | phone-number | device }
where speed-entry is the baud rate that should be used for the connection and the remote system is referenced by a hostname, phone-number to dial, or a dedicated device that provides a communication connection to the remote host.
The /etc/remote file contains descriptions regarding remote systems using a structure similar to the termcap file. This includes default device and phone numbers, and various communication capabilities such as parity, duplex mode and flow control. The phone number field (pn) may refer to an entry in the /etc/phones which contains the remote host phone number database.
22. Adding Terminals and Modems from the Commmand Line
Use sacadm -l to determine if a ttymon port monitor is active. If not or a separate port monitor is desired, start a ttymon port monitor (with appropriate arguments): sacadm -a -p tag -t ttymon -c /usr/lib/saf/ttymon -v `ttyadm -V` Then start up a service for the port to which the terminal will be attached: pmadm -a -p tag -s service_tag -i owner -fu -v `ttyadm -V` -m "`ttyadm -T terminal_type -d /dev/term/port -l ttydef_entry -m ldterm,ttcompat -s /usr/bin/login`"
Note that the difference between setting up a terminal (as in 22.1) and a bidirectional modem is the
-b argument to ttyadm.
Use sacadm -l to determine if a ttymon port monitor is active. If not or a separate port monitor is desired, start a ttymon port monitor (with appropriate arguments): sacadm -a -p tag -t ttymon -c /usr/lib/saf/ttymon -v `ttyadm -V` Then start up a service for the port to which the modem will be attached using pmadm -a -p tag -s service_tag -i owner -fu -v `ttyadm -V` -m "`ttyadm -b -T terminal_type -d /dev/term/port -l ttydef_entry -m ldterm,ttcompat -s /usr/bin/login`"
| Special Thanks to Darrell Ambro for writing this Cramsession. Make sure to check out his extensive Solaris study guide at: http://ns.netmcr.com/~ambro/intro.htm |
*Trademark of Sun Microsystems, Inc.