Professional Documents
Culture Documents
1. INTRODUCTION..............................................................................................1
1.1 Purpose and Scope ........................................................................................................................1 1.2 HP-UX vs. AIX .............................................................................................................................1
iii
5. DEVICES........................................................................................................25
5.1 Introduction ................................................................................................................................25 5.2 AIX..............................................................................................................................................25 Object Data Manager.......................................................................................................................25 Adding Supported Devices...............................................................................................................27 Adding Unsupported Devices...........................................................................................................30 Removing Devices ...........................................................................................................................31 5.3 HP-UX.........................................................................................................................................31 Adding a Device without Modifying the Kernel ...............................................................................31 Modifying the Kernel in Order to Add a Device...............................................................................36 5.4 Summary.....................................................................................................................................37
7. BACKUPS......................................................................................................49
7.1 AIX..............................................................................................................................................49 The backup Command.....................................................................................................................49 The restore Command .....................................................................................................................50 The mksysb Command ....................................................................................................................51 Tape Drives .....................................................................................................................................52 7.2 HP-UX.........................................................................................................................................53 fbackup............................................................................................................................................53 frecover ...........................................................................................................................................54 HP-UX and Cartridge Tapes: tcio ....................................................................................................55 HP-UXs Equivalent to mksysb........................................................................................................55 7.3 Interoperability Issues ................................................................................................................56 Standard UNIX Utilities ..................................................................................................................56 Interplatform Backups .....................................................................................................................57 7.4 Summary.....................................................................................................................................58
iv
8. PRINTING ......................................................................................................61
8.1 AIX..............................................................................................................................................61 The AIX Queuing System................................................................................................................61 Adding a Local Printer ....................................................................................................................62 Printing Locally...............................................................................................................................63 Printing to a Remote Printer ............................................................................................................65 AIX Print Commands......................................................................................................................68 Queue Management Commands ......................................................................................................69 8.2 HP-UX.........................................................................................................................................69 The Components of the LP Spooler..................................................................................................69 Setting Up the LP Spooler Using SAM ............................................................................................74 Setting Up the LP Spooler Using HP-UX Commands.......................................................................78 8.3 Interplatform Printing................................................................................................................83
named Data Files.............................................................................................................................99 Configuring a Primary Name Server................................................................................................99 Configuring a Secondary Name Server ..........................................................................................100 Configuring a Cache-Only Name Server........................................................................................100 Setting Up a Remote Name Server.................................................................................................101 Name Resolution Order .................................................................................................................101 10.2 HP-UX.....................................................................................................................................102 named Data Files...........................................................................................................................102 Configuring a Primary Name Server..............................................................................................102 Configuring a Secondary Name Server ..........................................................................................103 Configuring a Caching Only Name Server.....................................................................................103 Setting Up a Remote Name Server.................................................................................................103 Setting the Local Domain ..............................................................................................................104 Starting the Primary Server ...........................................................................................................104 Maintaining Network and Domain Data Files................................................................................104 Updating Domain Data Files .........................................................................................................105 Name Resolution Order .................................................................................................................105 10.3 Summary.................................................................................................................................106
vi
12.3 Summary.................................................................................................................................133
13. MAIL...........................................................................................................135
13.1 AIX..........................................................................................................................................135 Customizing the /etc/sendmail.cf file .............................................................................................135 Stopping and Starting the sendmail Daemon .................................................................................135 Mail Aliases ..................................................................................................................................135 The Mail Queue.............................................................................................................................136 Mail Logging and Statistics ...........................................................................................................137 13.2 HP-UX.....................................................................................................................................137 Using SAM to Install sendmail......................................................................................................137 Manually Installing sendmail ........................................................................................................137 Stopping and Starting the sendmail Daemon .................................................................................139 The Mail Queue.............................................................................................................................140 The System Log.............................................................................................................................140 13.3 An Interoperability Exercise: Creating Mail Hubs ...............................................................140 Sending AIX Mail to an HP-UX Hub.............................................................................................140 Sending HP-UX Mail to an AIX Hub.............................................................................................141 13.4 Summary.................................................................................................................................142
14. X11.............................................................................................................143
14.1 AIX..........................................................................................................................................143 Files and Directory Structure .........................................................................................................143 Starting X......................................................................................................................................144 Stopping X ....................................................................................................................................145 aixterms ........................................................................................................................................145 Fonts .............................................................................................................................................146 xdm...............................................................................................................................................147 The Desktop ..................................................................................................................................147 14.2 HP-UX.....................................................................................................................................147 Files and Directory Structure .........................................................................................................148 Starting X......................................................................................................................................150 Stopping X ....................................................................................................................................152 Fonts .............................................................................................................................................152 hpterms .........................................................................................................................................153 HP-VUE ........................................................................................................................................153 14.3 X11 Interoperability ...............................................................................................................155 Displaying to a Remote Host..........................................................................................................155 Turning Your Workstation into an X Terminal..............................................................................157
APPENDIX A.....................................................................................................159
Common Command Pathnames ......................................................................................................159
vii
APPENDIX B.....................................................................................................171
Creating AIX Boot Diskettes...........................................................................................................171
APPENDIX C.....................................................................................................173
A Quick Comparison of SMIT and SAM .......................................................................................173
APPENDIX D.....................................................................................................175
Alternate HP Boot Console User Interface.....................................................................................175 Accessing the Boot Console User Interface ....................................................................................175 Searching for Bootable Media........................................................................................................175 Booting from BOOT_ADMIN .......................................................................................................175
viii
Introduction
1. Introduction
1.1 Purpose and Scope
The purpose of this document is to help users and system administrators of either HP-UX or AIX machines to understand the other side, if you will, for the purposes of interoperability. This will help, for example, AIX system administrators integrate HP-UX machines into their networks, or HP-UX administrators do the same with RS/6000s. It can also assist HP field representatives understand the nature of AIX in order to aid customers moving to HP machines. Each of this documents chapters addresses a single topic but usually contains several sections: a description of the AIX way of doing things, one devoted to the HP-UX way, a comparison of the two systems regarding the topic at hand, and some tips on interoperability. The issue of interoperability, however, will be more extensive in some areas, most notably networking, than in others. The following are important to keep in mind:
This document confines its discussion to HP-UX 9.0x as found on the HP 9000/700 series workstations and AIX 3.2.5. The example commands assume the use of the KornShell. The back slash (\) at the end of a command indicates line continuation because of insufficient space on the page. In real life the command can be typed on a single line. The SMIT examples often show fastpath commands. These are shortcuts to SMIT menu items and are optional. You can start at SMIT's top-level menu and eventually get to the appropriate item. The machines used in researching the material for this guide were an HP 9000/712 running HP-UX 9.05 and IBM RS/6000 Model 340 running AIX 3.2.5..
AIX is based on UNIX System V and Berkeley Software Distribution 4.3 but is more of a hybrid of these two types of UNIX than HP-UX. AIX conforms to the Portable Operating System Interface for Computer Environments (POSIX!) and to OSF. It also contains several IBMproprietary features, such as the Object Data Manager (ODM) and System Resource Controller (SRC). Its windowing system, AIXwindows Environment/6000 is based on the X Window System with OSF/Motif and is an optional product.
2.2 AIX
Boot Process and Startup Normal Boot
If everything is configured properly, normal boot simply involves two things: 1) making sure the front panel key switch is in NORMAL position (all the way to the left), and 2) powering on the system. Everything else is automatic: the system comes up in multi-user mode, ready for someone to log in. The following sequence of events takes place when an RS/6000 is powered on or reset:
ROS IPL (Read Only Storage Initial Program Load). This phase includes a power-on selftest (POST), the location of a boot device, and loading of the boot kernel into memory. Phase 1 (Base Device Configuration Phase). This phase runs /etc/rc.boot with an argument of 1. rc.boot builds the Object Data Manager (ODM) database, makes sure that base devices are configured, initializes the Logical Volume Manager (LVM), activates the root volume group (rootvg), and checks and mounts the root file system. Phase 2. Here /etc/rc.boot is run with an argument of 2. This merges the ODM data and device files into the root file system and configures any devices not configured by Phase 1. Phase 3. This phase starts /etc/init with the process id (pid) of 1. Phase 4 (Runtime phase). Here init runs the entries in /etc/inittab and invokes /etc/rc.boot 3. The /tmp file system is mounted, the ODM database is saved for future boots, and run state is set to multi-user, at which time various subsystems such as TCP/IP and NFS, if found in /etc/inittab, are started.
Up until the runtime phase all you have as an indicator of how the boot sequence is going is the LED display on the front panel of the machine. Three-digit codes flash as the sequence progresses, and if you want to know the meaning of the codes, you have to look them up in the Diagnostics Guide. At a certain point, however, you will see either the code c32 or c33, which indicates that the runtime phase is assigning the console. c32 is for high-function terminal devices (hfts) and c33 is for serial-line terminals (ttys). After that, boot output goes to the display until finally the
Console Login: message appears, at which time the machine is completely up and in multi-user mode.
Standalone Boot
This kind of boot can be done from a local disk or tape, but most commonly it is done with diskettes. See Appendix B for information on creating bootable diskettes. There are four diskettes used in this process: a boot diskette, two display diskettes, and an installation/maintenance diskette. The procedure for booting off of these diskettes is a follows: 1. Switch the key in the front panel to Service Position (all the way to the right). 2. Insert the boot diskette into the floppy drive and power up the system. 3. When the LED reads c07, insert the first display diskette. Wait for c07 to insert the second display diskette. Then after a few minutes the system will prompt you to choose the console, asking you to press the F1 or F2 key and hit return. 4. At this point the display will take over and eventually prompt you to insert the Installation/Maintenance diskette. 5. When the system finishes processing the last diskette, it will display the Installation/Maintenance menu. Select the option that says Standalone Maintenance Shell. 6. Here you will see a # prompt, but virtually nothing is available to you. You now need to access the root volume group. At the # prompt, type the command getrootfs hdisk0.1 You are now in standalone mode.
System Shutdown
The following examples must be done while logged in as root. To shut down the system in 10 minutes:
# shutdown +10
To reboot immediately:
# shutdown -Fr # reboot
This assumes that your root file system is on hdisk0. If it is not, use hdiskx, where x is the number of the physical volume where the root file system resides.
2.3 HP-UX
Boot Process and System Startup Normal Boot
HP-UX system startup occurs in two phases:
Powering on the system or pressing the Reset button causes processor-dependent code (PDC) and I/O-dependent code (IODC) firmware to be executed. The PDC runs self-tests and locates the console, using IODC and the paths stored in Stable Storage. The PDC displays on the console screen copyright information, PDC and IODC ROM revisions, and the amount of memory configured. Then PDC displays copyright information as well as a message that reads:
Selecting a system to boot. To stop selection process, press and hold the ESCAPE key
If the Escape key is not pressed, PDC loads the initial system loader (ISL) from the primary path in Stable Storage (for example, a SCSI disk with address scsi.6.0) and transfers control to it. The ISL, scheduled by the autoboot sequence, finds the autoexecute file and executes the command specified in it (usually hpux or hpux boot disc(;0)/hp-ux). By default, the autoexecute arguments load /hp-ux. While loading, hpux displays information about the device and file being booted, the text, data, and BSS size of the kernel and the kernels startup address. CAUTION: Do not confuse the ISL utility hpux with the /hp-ux file that it loads. hpux is invoked from the ISL prompt, and, during an automatic boot, loads /hpux, a file that contains the HP-UX operating system kernel
HP-UX Startup Sequence
Once HP-UX starts (when the kernel is loaded), it searches for the root file system. Generally, the root file system is found on the disk from which HP-UX booted. After finding the root file system, the operating system starts a shell to read commands from /etc/pre_init_rc. Among these commands is fsck, which checks the root file system (currently in a read-only state). Any problems fsck encounters that it is unable to fix are caught later by /etc/bcheckrc. After fsck exits, the operating system remounts the file system in a read-write state. CAUTION: Do not modify the /etc/pre_init_rc script; it might cause the system to be unbootable.
Then, HP-UX starts its first process, /etc/init. The init process has process ID one (1) and no parent process. The init process reads /etc/inittab file to define the environment for normal working conditions. The /etc/inittab file is similar to the one found in AIX, and once the entries in that file have been started, the HP-UX machine, by default, is in multi-user state.
Standalone Boot
A standalone boot in HP-UX is a manual boot, also known as an Attended Mode boot. Pressing the Escape key at the boot banner halts the automatic boot sequence, puts you into Attended Mode, and displays the Boot Console User Interface main menu.2 The system searches the SCSI, LAN, and EISA interfaces for all potential boot devicesdevices for which boot I/O code (IODC) exists. The system then displays a table, such as the following:
Device Selection ---------------P0 P1 P2 Device Path ----------scsi.6.0 scsi.1.0 lan.ffffff-ffff.ff Device Type ----------QUANTUM PD210S HP 2213A hpfoobar
At this point, the Boot Console User Interface main menu offers the following options:
b) s) a) x) ?) Boot from specified device Search for bootable devices Enter Boot Administration mode Exit and continue boot sequence Help
Using the b) option, you can direct hpux to boot from a specific device. For example, to direct hpux to boot from the SCSI disk drive, you would type the key sequence P0. The key to booting to standalone mode is first to boot to ISL using the b) option. The ISL is the program that actually controls the loading of the operating system. To do this using the above as an example, you would type the following at the Select from menu: prompt:
Select from menu: b p0 isl
This tells the system to boot to the ISL using the SCSI drive at address 6. After displaying a few messages, the system then produces the ISL> prompt. From here you can run the hpux utility to boot the kernel to single-user (or standalone) mode:
ISL>hpux -is boot disk(scsi.6;0)/hp-ux
This essentially tells hpux to load the kernel (/hp-ux) into single-user mode (-is) off the SCSI disk drive at address 6. The -is option says to pass the string s to the init process (i), and the command init s puts the system in single-user (or standalone) mode. In fact, you will see something similar to the following after typing the above command:
Secondary Loader 9000/700 Revision 1.1 Booting disk(scsi.6;0)/hp-ux 966616+397312+409688 start 0x6c50 Kernel Startup Messages Omitted INIT: Overriding default level with level 's'
2
This process is for models 715/33, 715/50, 715/75, 725/50, 725/75, 735, and 755. See appendix D for other models.
System Shutdown
To shut down and halt using HP-UX commands when HP VUE is running, you must first stop HP VUE and then shut the system down.
From the login window, choose No Windows and log in as root. At the prompt, type init 2; exit. This will stop VUE. Log in as root again and type one of the following shutdown commands.
To shut down HP-UX for power-off, you can do any of the following:
# telinit 0 # shutdown -h -y now
then users bobby and sissy can shut down system foobar.
is started. Both machines use the AT&T-style of startup by having init read the /etc/inittab file. Both inittab files, though they may differ in some details, follow the same basic format. Both platforms support a manual boot. The IBM needs bootable media, usually diskettes, in order to do a manual boot. HP-UX requires pressing the Escape key at the appropriate time and then booting to ISL and then to standalone mode. In both cases standalone mode gives whoever performs the boot root privileges, something you should consider before doing such a thing in front of a casual user.3 The shutdown procedures for the two platforms resemble each other quite a bit. Both support the shutdown and reboot commands, as well as the telinit command to change inits run level. In the case of HP-UX, it is a good idea to stop HP VUE before rebooting. HP-UX supports running special scripts to be run at shutdown by placing them in /etc/shutdown.d. HP-UX also supports allowing users other than root to shut down a system by means of an /etc/shutdown.allow file. AIX supports neither shutdown scripts nor non-root system shutdowns.
HP machines have a secure command in the BOOT_ADMIN command set that can be used to prevent the Boot Console User Interface from appearing. Once the secure boot mode is set to on, however, the only way to turn it off is to disconnect all boot devices. This will cause the Boot Console Interface to reappear, which will enable you to issue the secure off command. IBM machines use keys to maintain security: turning the key to the SECURE position and then removing it prevents anyone from booting the machine.
3.2 AIX
Login Process
After bootup the RS/6000 displays a login prompt on what looks like a character-based terminal, but which in reality is part of what is known as a high-function terminal (hft). An hft is not just a display; it also includes the keyboard, the mouse, dials, and keypad. The hft display, along with the appropriate graphics adapter, is capable of supporting the X Window system, but what youll probably see after bootup is just ASCII text. You log in to this display and then either the X server starts automatically (depending on your system configuration), or you use a script like startx to start it manually. Logging in to the RS/6000, therefore, follows the typical UNIX login process: The getty process provides the login screen. If a user enters an id at this getty login prompt, getty starts the login process to validate the user. Unlike most UNIX systems, including HP-UX, AIXs login program checks not only /etc/passwd, which contains user names, but also a shadow password file, /etc/security/passwd, which contains the encrypted passwords of each of the users. login then starts a login shell as defined in /etc/passwd for the user, which by default is the KornShell (ksh).4 ksh then reads the users .profile. It is here in .profile that X Window frequently starts up, usually by calling the xinit command either directly or via the startx script. The xinit command starts the X server and then reads the $HOME/.xinitrc file to determine which X programs to start. The three most likely applications to run from .xinitrc are 1) an aixterm (like xterm but emulating an hft display instead of a vt100), 2) the AIX Windows desktop, an iconbased application and file management system, and 3) Motif Window Manager (mwm). (These applications will be discussed in more detail in the chapter on X Windows.) When a user exits his or her X Window session and logs out, control of the terminal returns to the init process, which spawns a new getty process, which in turn displays the Console Login on the display. The following summarizes the AIX login process:
4
A user enters an id at the login prompt. getty starts the login program to check /etc/passwd and /etc/security/passwd. login starts a login shell.
.profile calls the xinit command. xinit starts the X server and client applications Upon logout, control returns to init, which respawns another getty login.
Other RS/6000 login environments include xdm (X Display Manager), which provides an X Window login interface, and a ASCII-only display session. But the process described above is the most common.
Logout
If you are in an X Window session, stopping it by choosing End Session on the Root Menu will usually log you out. However, if your system displays an ASCII screen with a command line prompt (usually a $ prompt) after you stop X, then you have to take the additional step of closing the shell by typing either the exit command or the logout commands. The reason you might see a command line prompt after stopping the X server is because of the RS/6000 concept of virtual terminals. The hft device is capable of supporting multiple screens on a single terminal. To create a virtual terminal you simply type the open command followed by the name of the program you want to run in the new virtual terminal. If you type open ksh, or if your .profile contains such a command, then you get a second screen running a KornShell. To access other screens, you simply type the CTRL+ALT/ACTION key sequence, and the terminal displays each screen one at a time. If the X server is started by the open command, for example open xinit, it appears in its own screen. Thus ending the X Window session simply stops the X server in that particular screen and leaves other virtual terminals still running. To log out requires closing all virtual terminals, so whatever programs are running in them, be they shells or additional X servers, they must be closed in order to logout
3.3 HP-UX
Login Process
The process described below is more accurately described as the HP VUE login process. VUE is HPs Visual User Environment, a graphical user interface for HP-UX. If you were to login to a non-Windows console or were to telnet from another machine to an HP-UX system, the login process would very much be the same as that of a typical UNIX system, which involves the init, getty, and login programs. However, the /etc/inittab file of most HP machines has HP VUE as part of the default run level; in other words, HP VUE starts by default. HP VUEs login program, vuelogin (which is a customized version of xdm), provides the same functions as init, getty, and login, and does not normally read such files as /etc/profile and .profile. The vuelogin process is as follows:
init starts vuelogin upon bootup. vuelogin starts the X server. vuelogin starts another vuelogin process to actually control user logins.
10
The new vuelogin invokes vuegreet, which displays the login screen and handles the users interaction with the login screen.
When a user logs in to the vuegreet display, vuelogin runs /usr/vue/config/Xstartup if it exists, sets certain environment variables to default values, runs /usr/vue/config/Xsession, which in turn reads $HOME/.vueprofile and invokes the session manager, vuesession. Obviously, this process is a departure from the traditional UNIX login process. This is important to remember because if you are trying to customize a users environment under HP VUE, modifying the .profile file will not by default have any effect. Instead, you must modify .vueprofile
Logout
To log out if you are in an HP VUE session, choose the logout control on the Front Panel, use the log out control to end the session, or choose Log out from the workspace menu. When you log out of a regular HP VUE session, Session Manager saves information about your current session so that it can be restored the next time you log in.
3.4 Summary
Although the RS/6000 supports xdm, the most likely login configuration will be a more or less standard UNIX one involving the init, getty, and login programs. By default you login to an ASCII-like display, and one of two things happens: 1) the X server starts automatically from the users .profile or 2) you have to start X manually with either the xinit or startx commands. Although logging into an HP-UX ASCII terminal or pseudo-terminal will result in a typical UNIX login process, logging in to the console will most likely involve vuelogin, a customized version of xdm. In this case, setting a users environment does not entail changing /etc/profile or .profile because vuelogin does not normally read those files.
11
Path / /usr/bin /usr/sbin /usr/lib /etc /sbin /dev /tmp /home /export /var
Purpose Root directory Shared executables (/bin is a link to /usr/bin) Shared administrative commands Shared libraries Local configuration files Files needed to boot and mount /usr from another machine Device files directory World-writeable storage for temporary files Default location for user home directories Files needed for diskless machines Host-specific files, accounting and spool files
13
Path / /bin /usr/bin /usr/etc /usr/adm /usr/spool /etc /lib /dev /tmp
Purpose Root directory Basic commands More commands and executables System administration commands Accounting files, system administration data files Spooling directories Startup and configuration and some administration commands C libraries Device files directory World-writeable storage for temporary files
4.2 AIX
Logical Volume Manager
Before you can understand the way in which AIX handles file systems, you must have a basic understanding of the LVM, Logical Volume Manager. LVM is a disk management mechanism that represents a significant departure from traditional UNIX partitioning schemes. Among its advantages is the ability to allocate additional space to a file system without having to rebuild the disk. Under LVM, each physical disk in its entirety is a physical volume (PV). Each physical volume is divided up into chunks known as physical partitions (PPs). The size of these PPs can vary, but the default size is 4 MB. Physical partitions can be allocated to a logical volume (LV), which can contain a file system, but these physical partitions come from different places on the disk(s). Thus the term logical volume is quite accurate, for although it serves the same purpose as a traditional UNIX partition, its physical components do not represent contiguous disk space. Physical partitions, which are scattered throughout the disk(s), are represented to logical volumes via sequential logical partitions (LPs). Unless you are using disk mirroring, there is a one-to-one relationship between physical volumes and logical partitions. When you create a logical volume, you allocate a certain number of logical partitions to it. Therefore, allocating 64 logical partitions to a logical volume will create a 256MB logical volume, since the default size of the logical partitions (and its accompanying physical partitions) is 4 MB.
14
Logical volumes can and do contain paging spaces and dump areas, but most often they contain file systems. The structure of AIX file systems very much resembles those of other UNIX systems. Known as journaled file systems (JFS), AIX file systems each contain a superblock, inodes, and data blocks. Journaled file systems differ from HP-UX file systems in that the former are based on a log system which is used to reinstate a file system after a failure instead of fsck. Also, a JFS is not confined to an entire disk, as in HP-UX, and its contents do not come from a partition of contiguous disk space.
If you are installing a non-IBM SCSI disk, choose osdisk from the Disk Type listing, select the appropriate adapter in the Parent Adapter listing, and then enter the SCSI address in the CONNECTION address field. Note that SCSI hardware addresses for this field are a two-digit address with the second digit a zero. For example, if your SCSI disk hardware address is 4, then your connection address is 40. For the line that reads ASSIGN physical volume identifier choose yes. At this point all you have to do is press Enter, and the disk is designated a physical volume (PV) and assigned a physical volume identifier (PVID). The next step is to make the PV part of a volume group (VG). It is only within the context of a volume group that you can create a logical volume. A volume group consists of one or more
15
physical volumes. If you create a volume group containing both the internal and external disks, then the two disks are considered a single disk entity by LVM. In this way, a volume group containing two or more disks is something like software disk striping in HP-UX. There is a special volume group called rootvg. rootvg contains, among other things, the operating system and boot area, which in many cases should reside on only one disk. If you were to spread the rootvg over both your internal and external disks, then failure of just one of the disks would require you to reload the operating system and reconfigure it as well as restore user data from backups. The new disk can be in its own volume group, or you can add it to an existing volume group, even rootvg if you so choose. In our example so far of a machine with two disks, one internal and one external, if you chose to add hdisk1 to the rootvg, you would use SMIT (smit extendvg) or just the extendvg command:
# extendvg -f rootvg hdisk1
If you wanted to make physical volume hdisk1 its own volume group called datavg, you would use SMIT (smit mkvg) or the mkvg command:
# mkvg -f -y datavg hdisk1
You must use the varyonvg command to activate the volume group before you access it:
# varyonvg datavg
If you were to put hdisk1 into the datavg this way, then the lsvg (list volume groups) command, given our example so far, would produce:
# lsvg rootvg datavg
If you were to type the lspv (list physical volumes) command, you would get something like:
# lspv hdisk0 hdisk1 0004038485e2483a 000013403f203af5 rootvg datavg
The first column would be the physical volume label, the second column would be the hexadecimal PVID, and the third would be the volume group to which each physical volume belongs. With the new disk now recognized by the system as a physical volume belonging to the datavg volume group, it is now possible to create a logical volume. Before proceeding, it is worth noting that you can customize the creation of a logical volume to a great extent. For example, you can determine how many disks an LV can span, or whether the LV should be confined to inner edges, center, or outer edges of a particular disk. However, LVM will provide default values for these items if you prefer not to specify them yourself, and for purposes of this book we will assume the defaults. You can create a logical volume with the mklv command, but its easier to create it using SMIT. Just type smit mklv at the command line. You will first be asked to provide the volume group name (which in our case would either be rootvg or datavg), and then once you do you will see something like the following:
16
Add a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] Logical volume NAME * VOLUME GROUP name * Number of LOGICAL PARTITIONS PHYSICAL VOLUME names Logical volume TYPE POSITION on physical volume RANGE of physical volumes MAXIMUM NUMBER of PHYSICAL VOLUMES to use for allocation Number of COPIES of each logical partition Mirror Write Consistency? Allocate each logical partition copy on a SEPARATE physical volume? RELOCATE the logical volume during reorganization? Logical volume LABEL MAXIMUM NUMBER of LOGICAL PARTITIONS Enable BAD BLOCK relocation? SCHEDULING POLICY for writing logical partition copies Enable WRITE VERIFY? File containing ALLOCATION MAP [Entry Fields] [data] datavg [] # [] + [] midway + minimum + [] # 1 yes yes yes [] [128] yes parallel no [] + + + +
+ + +
Remember that in SMIT, any entry that starts with an asterisk (*), like in VOLUME GROUP name, is a required entry. So all you would have to provide in the above example is the number of logical partitions. Assuming your logical partition size is 4MB, to create a logical volume of 512MB you would fill in 128. You also have the option of providing a name, preferably one with some logic to it, for your logical volume. If not, the system will supply one for you which may be no more descriptive than lv01. In our case, we will name our LV data. Once the logical volume is created, you can then create a file system for it with either the crfs command or by typing smit crfs. If you use SMIT command, the first thing you will see is the following:
Add a File System Move cursor to desired item and press Enter. Add a Journaled File System Add a Journaled File System on a Previously Defined Logical Volume Add a CD-ROM File System
If you already have defined a logical volume, as in our example thus far, you would choose the second option, Add a Journaled File System on a Previously Defined Logical Volume. Choose the first option if you want to create a logical volume and a file system at the same time. Doing so,
17
however, gives you less control over the attributes of the new logical volume. Choosing the second option would produce:
Add a Journaled File System on a Previously Defined Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. * LOGICAL VOLUME name * MOUNT POINT Mount AUTOMATICALLY at system restart? PERMISSIONS Mount OPTIONS Start Disk Accounting? [Entry Fields] + [] no + read/write + [] + no +
The required entries are LOGICAL VOLUME name and MOUNT POINT. However, it is strongly recommended that you change the third option, Mount AUTOMATICALLY at system restart, to yes if you want the file system available after each boot. The mount point of a file system is simply a directory name that designates the starting point of the file system. For example, if you created a file system on a logical volume called data, and the mount point was the directory /usr/local/data, the file system would be mountedor made availablebeginning at the /usr/local/data directory. The mount point does not have to be an empty directory, but any files that exist in a mount point directory will not be seen or available once a file system has been mounted on that directory. Which brings us to the last step. Once a logical volume has been created and a file system for that logical volume has been created, making that file system accessible requires mounting the file system. The easiest way to mount the new file system is simply to type the mount command followed by the name of the mount point, for example:
# mount /usr/local/data
Here the newly created file system in the data logical volume is mounted on the /usr/local/data directory. AIX knows which file system to mount onto /usr/local/data because creation of a file system results in an entry in the file /etc/filesystems like the following:
/usr/local/data: dev vfs log mount check options account = = = = = = = /dev/data jfs /dev/hd8 true true rw false
The mount command will look in /etc/filesystems for an entry called /usr/local/data. If it does, and in this case it does, then it mounts whatever the dev line says (in this case /dev/data, the name of our logical volume) onto the /usr/local/data directory.
18
from most UNIX systems in that it requires the Logical Volume Manager, or LVM. LVM is a utility that manages disk space in such a way that you do not have to have contiguous disk partitions in order to create file systems. You can also expand space for a file system on the fly (provided there is unallocated space in your volume group). The essential steps to adding a disk and creating a file system on it are: 1. Connect the disk to the system. 2. Make the disk a physical volume. 3. Add the physical volume to a volume group or create a new volume group for it. 4. Create a logical volume with the characteristics you desire, such as mirroring or particular placement on the disk. 5. Create a file system to be contained in the logical volume. If you create the file system without first creating a logical volume, then AIX will create the latter for you. 6. Mount the file system. You can do all of this via the command line or through SMIT. Use SMIT if you are a novice or just like to make life easier for yourself.
4.3 HP-UX
Disk Installation and File System Creation
Setting up HP-UX for a disk drive differs considerably from that for an RS/6000. For a 700-series machine running HP-UX 9.0x there is no Logical Volume Manager. Therefore, when adding a disk you have two major tasks: 1. Creating the device file or verifying the correct device file already exists for communication with the device. 2. Ensuring the appropriate HP-UX device driver is part of the current kernel configuration. The latter is usually not necessary if you are adding a SCSI hard disk because the HP-UX kernel, like nearly all UNIX machines, supports SCSI devices. If for some reason you had a device whose driver is not part of the kernel configuration, or if the SCSI device driver is commented out of the kernel configuration file, then you will have to rebuild the kernel. For purposes of this document, however, we will assume that the SCSI driver is indeed part of the kernel. Before starting, determine how you want to use the disk: 1) as a file system, 2) as swap space only, or 3) as both a file system and swap space.
19
5. From the Actions menubar title in the Disk and File System Manager window, highlight and choose Add a Hard Disk Drive... . 6. Within the Add a Hard Disk Drive window, highlight and choose Select disk to add. 7. Within the Select disk to add window, highlight the disk you wish to add. You can identify it by its model number, select code and bus address. Activate OK. 8. Within the Add a Hard Disk Drive window, highlight and choose Set disk usage and options. 9. Within the Set disk usage and options window: Activate the highlighted menu button. Highlight and choose the disk usage you prefer (File System, Swap, or File System and Swap). In the Mount Directory: field, type in the name of the directory that will be the mount point for the file system on this disk. Press Return.
10. Turn on the check box labeled Create a new file system. 11. Several check box options appear below Create a new file system. Turn on or off any of these check box options as required by your new file system. 12. Activate OK. 13. You may need to change certain options, such as when to mount the disk and how its access permissions are set. If so, within the Add a Hard Disk Drive window, highlight and activate Modify Defaults, then within the dialog box, turn on the check boxes that apply. 14. Within the Add a Hard Disk Drive window, highlight and activate OK. 15. A Messages box appears, reporting the progress of the task. When the task if finished, activate OK. 16. Exit SAM by returning to the System Administration Manager window and activating Exit SAM. Adding a disk in this fashion automatically creates a file system on the entire hard disk, which in HP-UX is the norm: file systems are usually contained in one big partition. However, it is possible to create multiple partitions and put file systems in them on a single disk, but this is a specialized process which will be discussed separately in this chapter.
20
To install your disk drive, refer to the documentation that came with your disk and to the Installing Peripherals manual. They will describe making the physical connections, determining the physical address of your disk, and adding the disk to your systems I/O configuration. For SCSI disks, be sure to set the SCSI address to a number not being used.
Creating the Block and Character Device Files for Your Disk
Creating device files is an extensive topic which will be addressed in the next chapter, so we will be brief and use SCSI device files as examples. SCSI devices files usually take the form
/dev/[r]dsk/c201dXsY
where c201 is the controller number, dX is the device number (X is usually a number from 1 to 6), and sY (Y being an integer) is the section (or partition) number. You need to have both character and block device files for the disk you are adding. Therefore the [r] indicates that you will have one device file in the /dev/rdsk directory (for the character device files) and one in /dev/dsk. You will need to refer to the character device file when you use the newfs command to create the file system, and you will need to use the block device file with other commands such as swapon. Thus device files /dev/dsk/c201d6s0 and /dev/rdsk/c201d6s0 are for a disk on controller c201 at SCSI address 6. You can create device files using the /etc/mknod command. The mknod command has the following syntax:
mknod name type major_number minor_number
Therefore, if you were to add another SCSI internal hard disk to a 700 series machine with a SCSI address of 5, then you would type:
# mknod /dev/dsk/c201d5s0 b 7 0x201500 # mknod /dev/rdsk/c201d5s0 c 47 0x201500
For more information on major and minor numbers, see the chapter on device files.
Initializing Your Disk Using mediainit
New hard disks from Hewlett-Packard have been initialized at the factory. If your disk has been initialized, it is not necessary to initialize it again. However, when in doubt, initializing a disk with mediainit will guarantee the integrity of your disk. In the above example of installing a second internal SCSI hard disk, you would type the following to initialize it:
# mediainit /dev/rdsk/c201d5s0
Note that the character device file is used, not the block device file
Creating a New File System Using newfs
The recommended command for creating a file system on a disk is newfs. You can use newfs command without options, creating a file system based on the described in /etc/disktab for the type of disk you are adding. The /etc/disktab file describes the file system layouts and parameters for
21
supported disks; the value you specify for disk_type in the newfs command line must match an entry in /etc/disktab. For example, for the HP 2213A disk, /etc/disktab lists seven configurations. The listing in the file looks like the following:
############################################### # The HP2213A is a SCSI Coyote II # Total formatted capacity: 663 Mbytes # 512 Bytes/sector # 56 sectors/track; 16 heads; 1447 cylinders; # Total: 648256 1k sectors HP_2213A|hp2213A|hp660S|hp97548S|HP_97548S|hp2213A_64MB|HP_2213A_64MB:\ :64 MBytes reserved for swap & boot:ns#28:nt#16:nc#1302:\ :s0#583296:b0#8192:f0#1024:\ :se#512:rm#4002: HP_2213A_300MB|hp2213A_300MB|hp660S_300MB:\ :300 MBbytes reserved for swap &boot:ns#28:nt#16:nc#763:\ :s0#341824:b0#8192:f0#1024:\ :se#512:rm#4002: HP_2213A_96MB|hp2213A_96MB|hp660S_96MB:\ :96 MBytes reserved for swap & boot:ns#28:nt#16:nc#1229:\ :s0#550592:b0#8192:f0#1024:\ :se#512:rm#4002: HP_2213A_42MB|hp2213A_42MB|hp660S_42MB:\ :42 MBytes reserved for swap & boot:ns#28:nt#16:nc#1351:\ :s0#605248:b0#8192:f0#1024:\ :se#512:rm#4002: HP_2213A_noreserve|hp2213A_noreserve|HP_2213A_noswap|hp2213A_noswap|hp66 0S_noreserve|hp660S_noswap:\ :no swap or boot:ns#28:nt#16:nc#1447:\ :s0#648256:b0#8192:f0#1024:\ :se#512:rm#4002: HP_2213A_120MB|hp2213A_120MB|hp660S_120MB:\ :120 MBytes reserved for swap &boot:ns#28:nt#16:nc#1173:\ :s0#525504:b0#8192:f0#1024:\ :se#512:rm#4002: HP_2213A_150MB|hp2213A_150MB|hp660S_150MB:\ :150 MBytes reserved for swap &boot:ns#28:nt#16:nc#1104:\ :s0#494592:b0#8192:f0#1024:\ :se#512:rm#4002:
These entries seem a bit cryptic because of abbreviations like ns, nc, and s0. These abbreviations are simply setting certain disk parameters, such as number of 1K sectors per track (ns), total number of cylinders (nc), and size of the file system in 1k blocks (s0). For a complete description, see the man page for disktab. If you decide to accept the file system defaults for an entry in /etc/disktab, no options are required for the newfs command. For example, lets assume you want to create a file system for our second internal SCSI disk and use it in part for a file system and in part for swap. After checking the optional disk layouts for the HP 2213A in /etc/disktab, you determine that the layout that reserves a space of 150 MB for swap and boot (the last entry above) is appropriate. So, using the character device file you created previously, issue the newfs command to create the file system:
# newfs /dev/rdsk/c201d5s0 HP_2213A_150MB
22
If you dont have an entry for the particular disk you are adding, use the /etc/diskinfo command to get some important information about the disk and create your own entry. The /etc/disktab file contains guidelines on how to do this. If you created a file system on your disk and used an option from /etc/disktab that specified a swap area, as in our example, you can enable that swap area by using the swapon command:
# /etc/swapon -e /dev/dsk/c201d5s0
The -e option will make the space outside the file system available for swap.
Mounting File Systems
Once your new file system has been created on the new disk, /dev/dsk/c201d5s0, you mount it using the mount command. Suppose the disk will contain user files and you want /users to be the mount point. Then you would type:
# mount /dev/dsk/c201d5s0 /users
This command mounts (attaches) the file system on the disk using the device file /dev/dsk/c201d5s0 to the mount point /users. After mounting the file system, you can edit the /etc/checklist file so that the file system is automatically mounted each time you boot the system. For the file system mounted above, you would add a line in the checklist file such as:
/dev/dsk/c201d5s0 /users hfs defaults 0 3
You also need to make an entry in /etc/checklist for the swap space, such as:
/dev/dsk/c201d5s0 /users swap end 0 0 # swap at end
Here the first partition has a file system size (s1) of 205824 bytes, a block size (b1) of 16384 bytes, and a fragment size (f1) of 2048 bytes. The second and third partitions have their versions of each of these parameters. If you were to add the s1, s2, and s3 parameters, you would get 2307072, the approximate size of the disk, since no swap space is being allocated. You then use newfs to create file systems on each of the partitions by doing something like:
# # # newfs /dev/rdsk/c201d5s1 Big_Disk_noswap newfs /dev/rdsk/c201d5s2 Big_Disk_noswap newfs /dev/rdsk/c201d5s Big_Disk_noswap
The rest should be obvious, just follow the previous procedure for mounting the file systems and making entries in the /etc/checklist file.
23
24
Devices
5. Devices
5.1 Introduction
One area of significant difference between AIX and HP-UX is that of device configuration. AIX supports dynamic device configuration in which you can add devices even to a running kernel without rebooting. HP-UX can be almost as simple for such things as SCSI devices, but occasionally you might have to rebuild the kernel. AIX manages devices via the Object Data Manager (ODM), HP-UX uses a more traditional UNIX approach. This chapter will concentrate on the adding of SCSI devices, the most common type of peripherals next to printers. Adding printers will be the subject of the next chapter.
5.2 AIX
Object Data Manager
It is necessary to know something of the Object Data Manager (ODM) in order to understand the way in which AIX handles devices. The ODM manages object-oriented databases of system information. Among the databases it manages is that of device configuration. This database is made up of two object classes: the predefined object class and the customized object class. The predefined object class contains configuration information for all possible devices supported by AIX, and the customized object class contains information for devices actually on the system.
Object Classes
An object class is a collection of objects with the same definition. Object class definitions resemble C language structures and are found in the /etc/objrepos (short for object repository) directory or in the directory specified by the ODMDIR variable. For example, the object definition for customized devices attached to the system is found in /etc/objrepos/CudDv and can be obtained by typing the odmshow command.
# odmshow CuDv class CuDv { char name[16]; short status; short chgstatus; char ddins[16]; char location[16]; char parent[16]; char connwhere[16]; link PdDv PdDv uniquetype PdDvLn[48]; };
Each of the items in the CuDv object class definition is a descriptor. When an object is added to the CuDv object class, values are associated with each of the descriptors. For example, a SCSI hard disk with a location code of 00-00-0S-00 would have this code stored in the location descriptor.
25
Objects
An object is an item that belongs to an object class. Each object has a set of configuration parameters corresponding to the descriptors in the object class definition. For example, to see the objects and their associated values that make up the CuDv object class, type:
# odmget CuDv
Among the stanzas in the output, you would likely see the following:
CuDv: name = "hdisk0" status = "1" chgstatus = "2" ddins = "scdisk" location = "00-00-0S-00" parent = "scsi0" connwhere = "00" PdDvLn = "disk/scsi/1000mb"
Each of the above lines corresponds to the CuDv object class definition. The last line is important in that it illustrates the hierarchical classification of devices. As stated earlier, the ODM database consists of more than device data, but within the realm of devices there is similar class terminology, which can be confusing at times. In the last line above, for example, disk is the device class, scsi is the device subclass, and 1000mb is the device type.
Device Classes
A device class describes the basic function of the device. For example, there is a device class called adapter, a fairly generic description. A device subclass is a more specific description. sio (standard input/output) and mca (microchannel), for example, are subclasses of the adapter device class. Finally, a device type is the most specific description of the device: keyboard, tablet, mouse, and hscsi are types of the of the sio device subclass, which in turn is a member of the adapter device class. Although there are many ways to get this information, the following command provides a sorted list of currently defined devices on the system while at the same time illustrating further the concept of device classes:
# lsdev -C -F "class subclass type description" | sort adapter mca ppr POWER Gt3i Graphics Adapter adapter mca sio_1 Standard I/O Planar adapter sio fda Standard I/O Diskette Adapter adapter sio hscsi Standard SCSI I/O Controller adapter sio ient_1 Standard Ethernet Adapter adapter sio keyboard Keyboard Adapter adapter sio mouse Mouse Adapter adapter sio ppa Standard I/O Parallel Port Adapt adapter sio s1a_1 Standard I/O Serial Port 1 adapter sio s2a_1 Standard I/O Serial Port 2 adapter sio tablet Tablet Adapter bus sys mca Microchannel Bus disk scsi 1000mb 1.0 GB SCSI Disk Drive diskette siofd fd Diskette Drive fpa sys fpa1 Floating Point Processor hft node hft High Function Terminal Subsystem if EN en Standard Ethernet Network Inter
26
Devices if if ioplanar keyboard logical_volume logical_volume logical_volume logical_volume logical_volume logical_volume logical_volume logical_volume logical_volume logical_volume logical_volume logical_volume lvm memory mouse planar pty sys sys sysunit tape tcpip EN LO sys sio.kb lvsubclass lvsubclass lvsubclass lvsubclass lvsubclass lvsubclass lvsubclass lvsubclass lvsubclass lvsubclass lvsubclass vgsubclass lvm sys sio.ms sys pty node node sys scsi TCPIP ie3 lo ioplanar_1 kb101 lvtype lvtype lvtype lvtype lvtype lvtype lvtype lvtype lvtype lvtype lvtype vgtype lvdd memory mse_3b sysplanar1 pty aio sys sysunit 8mm5gb inet IEEE 802.3 Ethernet Network Inter Loopback Network Interface I/O Planar United States keyboard Logical volume Logical volume Logical volume Logical volume Logical volume Logical volume Logical volume Logical volume Logical volume Logical volume Logical volume Volume group N/A 64 MB Memory Card 3 button mouse CPU Planar Asynchronous Pseudo-Terminal Asynchronous I/O System Object System Unit 5.0 GB 8mm Tape Drive Internet Network Extension
As you can probably deduce from the command, the four columns above represent the class, subclass, type, and description of the currently defined objects on the system. Note that although the ppr (POWER Gt3i Graphics Adapter) and fda (Standard I/O Diskette Adapter) both belong to the same adapter device class, they belong to different subclasses: mca and sio, respectively.
cfgmgr
The cfgmgr command, also known as the Configuration Manager, automatically configures devices on the system. It is run twice at system boot and can be run at the command line as well. When invoked, cfgmgr reads rules from the Config_Rules object class. These rules are commands that configure devices and make them available for use by creating device files and installing drivers. To see what these rules are, use the odmget Config_Rules command. Thus one way of adding, say, an 8mm, 5GB SCSI tape drive is to: 1. Power down the system 2. Connect the drive 3. Power-on the drive 4. Boot the system
27
During system boot, cfgmgr will recognize the new device and configure it for use. If you type the following command, you will see that the drive is recognized:
# lsdev -C -c tape rmt0 Available 00-00-0S-60 5.0 GB 8mm Tape Drive
The term Available refers to the tape drives state. A device has one of three states: undefined, defined, or available. If the tape drive is undefined, it has not been configured by cfgmgr. If it is defined, its configuration data is recorded in the customized database, but the device is not available for use. Once a defined device is bound to the kernel it is in the available state. cfgmgr will make sure your device is defined and then made available. cfgmgr can also be run at the command line. If you add a device, such as the above tape drive, to a running system (even if it is a SCSI device), you have to run the cfgmgr command to make it available. Also, if you have an available but powered-down device when you reboot, the cfgmgr during bootup will set the device to a defined state. To make it available, power-on the device and rerun the cfgmgr command.
Just select the item you wish to add and press Enter. If you were to add the example 8mm tape drive to the system this way, you would select Tape Drive. The next screen would look like the following:
28
Devices
Tape Drive Move cursor to desired item and press Enter. List All Defined Tape Drives List All Supported Tape Drives Add a Tape Drive Change / Show Characteristics of a Tape Drive Remove a Tape Drive Configure a Defined Tape Drive Generate Error Report Trace a Tape Drive
Select Add a Tape Drive. You will then be presented a list of supported tape drives, something similar to the following:
Tape Drive Type Move cursor to desired item and press Enter. 1200mb-c 150mb 3490e 4mm2gb 4mm4gb 525mb 8mm 8mm5gb 9trk ost scsi scsi scsi scsi scsi scsi scsi scsi scsi scsi 1.2 GB 1/4-Inch Tape Drive 150 MB 1/4-Inch Tape Drive 3490E Autoloading Tape Drive 2.0 GB 4mm Tape Drive 4.0 GB 4mm Tape Drive 525 MB 1/4-Inch Tape Drive 2.3 GB 8mm Tape Drive 5.0 GB 8mm Tape Drive 1/2-inch 9-Track Tape Drive Other SCSI Tape Drive
This list comes from the predefined device object class. If you are adding a non-IBM SCSI tape drive, choose ost scsi Other SCSI Tape Drive. In fact, any time you add an non-IBM SCSI device of any kind, there is always a generic SCSI option in SMIT for you to use. For our example, we will choose 8mm5gb scsi 5.0 GB 8mm Tape Drive. This will produce a dialog asking to choose a parent adapter:
Parent Adapter Move cursor to desired item and press Enter. scsi0 Available 00-00-0S Standard SCSI I/O Controller
Unless you have more than one adapter, you would choose scsi0 Available 00-00-0S Standard SCSI I/O Controller.
29
Here the only required entry is the CONNECTION address, which is your SCSI address. Other parameters you can change as needed. Herein is the advantage of adding a device through SMIT: you can customize your configuration. Otherwise, using cfgmgr will add the device with default attributes. If the tape drive in this example is set to SCSI ID 6, you would enter 60 in the CONNECTION address field.5 Pressing the Enter key at this point will execute the mkdev command and this will configure the drive to an available state.
If your device is not part of the predefined object class and closely resembles one of the above objects, then using one of them when adding a device through SMIT may very well work. Often cfgmgr will do just that when it encounters an unknown device. However, if this doesnt work you have no choice but to modify the predefined object database, write the necessary device methods, write a device driver (if necessary), and install the software to support the driver. Consult Device Driver Kernel Extension Overview in InfoExplorer for more information.
Remember that connection addresses need a zero appended to the SCSI hardware address.
30
Devices
Removing Devices
When you physically remove a device from the system, cfgmgr resets the device state to defined the next time a reboot occurs in case you want to reattach it later. If you want to set the device state to defined without rebooting the system, use the rmdev command. The syntax of the rmdev is:
rmdev -l Name
Name is the logical name of the device. To find the logical names of the customized devices, use the lsdev -C command. The first column of this commands output is the logical names of the devices. Thus, to remove our example 8mm drive you type:
# rmdev -l rmt0
This keeps the rmt0 device configuration information in the customized database but sets its state to defined. To remove the drive entirely from the customized database, type:
# rmdev -d -l rmt0
The above can be done through SMIT. Just type smit device, select your device, and then choose the appropriate menu selection to remove it. You will be prompted as to whether or not you want to keep the device in the customized database.
5.3 HP-UX
HP-UX follows a more traditional method of adding a device: before a device can be used its device driver must be compiled into the kernel. The default kernel configuration of HP-UX will probably meet the needs of most systems. However, to keep the size of the kernel small, some drivers may not be present. If you need to add a device whose driver is not a part of the kernel, you will have to create a new one.
Device Files
Device files provide user-level access to the device drivers found in the kernel. These files are found in the /dev directory. Consider the following command and its output:
31
The AIX/HP-UX Interoperability Guide # ls -l /dev/console /dev/*dsk crw--w--w- 1 root sys 0 0x000000 /dev/dsk: total 0 brw-r--r-- 1 brw-r--r-- 1 /dev/rdsk: total 0 crw-r--r-- 1 crw-r--r-- 1
Apr 16 12:56
/dev/console
root root
sys sys
7 7
0x410200 0x201600
c42d0s0 c201d6s0
root root
sys sys
47 47
0x410200 0x201600
c42d0s0 c201d6s0
The first character of each line identifies the type of device file. A b denotes a block device, and a c indicates a character device. A block device transfers data a block at a time by using the system buffers. A disk drive holding a mountable file system is an example of a block device. A character device reads or writes data one character at a time. Tape drives are usually character devices. Some devices are capable of I/O in both block and character mode. Such devices require two device files: one for block and one for character mode. A hard disk is an example of a device which uses both character and block device files. For purposes of mounting the disk as a file system, you will use the block device file. For purposes of accessing the disk for backups, the character device file is used. The major and minor numbers appear immediately before the date. The major number identifies what kernel driver is being referred to by the device file. The value chosen for the major number is based on both the device driver and on the access method (block or character). For devices needing both a character and block device file, there are different character major numbers and block major numbers. You can use the lsdev command to list the device drivers and their major numbers in the system. For example:
# lsdev Character 0 1 2 3 16 17 23 24 25 47 52 121 55 Block -1 -1 -1 -1 -1 -1 -1 -1 -1 7 -1 -1 10 Driver /dev/console HP98628, HP 98626, and HP98642 /dev/tty /dev/mem, /dev/kmem, and /dev/null Master pty Slave pty raw 8042 HIL HIL HIL cooked keyboards SCSI disk IEEE 802 device SCSI tape Optical Autochanger
The first two columns document character and block major numbers respectively. A -1 in either column means that a major number does not exist for that type of driver. Note that in the example above the SCSI disk driver has both a character and a block major number. Thus a long listing of the device files for such a disk at SCSI address 6 would look like the following:
# ls -l /dev/*dsk/c201d6s0 /dev/dsk: total 0 brw-r--r-- 1 root sys
0x201600
Jan 14 16:41
c201d6s0
32
root
sys
47
0x201600
Mar 18 15:30
c201d6s0
The directory containing the block device file, with a major number of 7, is /dev/dsk, and the directory with the character device file in it is /dev/rdsk. (The letter r is used here because character mode is often referred to as raw mode; block mode is sometimes called cooked mode.) You can also see device major numbers in the /etc/master file. The minor number is an encryption of address and configuration information. It typically defines one or both of the following: 1) the devices physical address, and 2) operational information, such as tape density or rewind options in the case of tape drives. Note that the minor number and the device file name are similar. There is a reason for that, which brings us to the next topic.
Tape drive device files have the following possible values in addition to the controller number and address number:
33
h m l c n b 525|150|120
High density
of 6250 bpi
Medium density of 1600 bpi Low density of 800 bpi Indicates data compression (only for drives that support compression) Indicates no rewind upon close of device Indicates Berkeley-style tape behavior Indicates the format of a quarter-inch tape drive
Name is the device name, preferably based on the naming convention. The c or b indicates that the file is either a character device file or a block device file, respectively. Major number is derived from either the lsdev command or the /etc/master file. That leaves us with an explanation of how to form the minor number. The minor number format is 0xSFDDD where: 0x indicates hexadecimal notation (hex is required) S is the system bus module number. Remember that 20 is for core I/O, and 4 is for EISA. F is the function number. The function numbers are:
1 for SCSI
34
Devices
2 for LAN 3 for HIL 4 for serial port A 5 for serial port B 6 for parallel port
DDD is more specific information. Its format differs, depending on the driver that is used to communicate with the device.
Driver-specific Designations
Syntax
T is the target number (bus address) U is the unit number for integrated devices V specifies the volume number (0 for single file systems)
Tape drive
TDO
Autochanger
TS
Parallel printer
T00
For details on creating the appropriate minor numbers for all devices, see Chapter 14 of Installing Peripherals in the LaserRom documentation. To help determine the appropriate minor number, you can use the ioscan -f command. ioscan searches the system provides, among other things, the hardware path number for each device it finds, and it is the hardware path number that forms the basis of the minor number. For example:
# ioscan -f Class H/W Path Driver H/W Status S/W Status ======================================================= scsi 2.0.1 c700 ok(0x7071) ok disk 2.0.1.1.0 scsi ok(0x5800202) ok disk 2.0.1.2.0 scsi ok(0x201) ok tape_drive 2.0.1.3.0 scsitape ok(0x1800202) ok disk 2.0.1.4.0 scsi ok(0x201) ok disk 2.0.1.6.0 scsi ok(0x101) ok
35
The AIX/HP-UX Interoperability Guide lan hil serial serial parallel scsi disk disk disk 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 4.1.0 4.1.0.4.0 4.1.0.5.0 4.1.0.6.0 lan01 hil asio0 asio0 parallel c700 scsi scsi scsi ok(0x7072) ok(0x7073) ok(0x7075) ok(0x7075) ok(0x7074) ok(0x7680) ok(0x201) ok(0x201) ok(0x201) ok ok ok ok ok ok ok ok ok
For the SCSI disk listed above whose hardware path number is 2.0.1.1.0, for example, the appropriate minor number would be 0x201100. This can be interpreted as follows:
0x 20 1 100 Hexadecimal notation The core I/O card on system bus module 2 SCSI function number Bus address 1, unit 0, volume 0
Remember, if you have difficulty in coming up with the correct minor number, or any other part of the device file creation process, just use SAM to do it for you
36
Devices
examine /etc/master. The /etc/master file is the device information table that contains the device name, handler name, element characteristics, functions for the device, and major device number. If what you are trying to add is not in the /etc/master file, then it is not supported by HP. Lets assume you want to add a SCSI floppy drive to your system. First you would check /etc/master to make sure its supported and then add scsifloppy to the dfile. Assuming your working directory is /etc/conf, you would enter the following commands:
# # # # # # config dfile make -f config.mk mv /hp-ux /SYSBCKUP mv hp-ux /hp-ux cd / reboot
5.4 Summary
The handling of device differs greatly between AIX and HP-UX. AIX uses the Object Data Manager to handle devices, and HP-UX uses traditional AT&T-style device files and kernel drivers. The easiest way to add a device in AIX is to connect it to a powered-down system, turn it on, and boot the system. During the boot process the cfgmgr utility is run, which configures the device and adds it to the customized device configuration database. It also runs rules that create the appropriate device files. You can run cfgmgr at the command line or use SMIT to add a device. These two methods ensure that not only the appropriate device files are created, but that the ODMs customized device database is maintained. If you need to add a device not listed in the predefined device database, you can use generic entries that will work. This enables you to add devices without having to rebuild the kernel, something not done in AIX. Also, you normally do not create your device files with the mknod command, even though it exists in AIX. HP-UX requires that the appropriate driver be included in the kernel. If it is, you just attach the device to the system and create the appropriate device files with the mknod command, although many device files are already created for you in a preloaded system. If the driver is not in the kernel, you must 1) check that the appropriate driver is listed in the /etc/master file, 2) put an entry for that driver in the /etc/conf/dfile file, and 3) rebuild the kernel. After that you can create the appropriate device files. Both creating device files and rebuilding the kernel can be done through SAM, which is often the best way to go because figuring out what minor numbers to use can be a difficult task. Regardless of how device files are created, both AIX and HP-UX use device files in the same way. These files are special files that provide user-level access to device drivers, so commands like tar can be used to read to and write from tape drives. For example, in AIX you can archive files in the /home directory to tape by typing:
# tar -cvf /dev/rmt0 /home
Or in HP-UX:
# tar cvf /dev/rmt/c201d3mnb
All you have to do is remember the locations of the device files on the respective systems. The following tables will help you do that for the most commonly used devices.
AIX File System Device Files
37
Meaning Rewind on close, no retension on open, high density No rewind on close, no retension on open, high density Rewind on close, retension on open, high density No rewind on close, retension on open, high density Rewind on close, no retension on open, low density No rewind on close, no retension on open, low density Rewind on close, retension on open, low density
38
Devices
File /dev/rmt/c201d*c /dev/rmt/c201d*cb /dev/rmt/c201d*cn /dev/rmt/c201d*cnb /dev/rmt/c201d*h /dev/rmt/c201d*hb /dev/rmt/c201d*hn /dev/rmt/c201d*hnb /dev/rmt/c201d*l /dev/rmt/c201d*lb /dev/rmt/c201d*ln /dev/rmt/c201d*lnb /dev/rmt/c201d*m /dev/rmt/c201d*mb /dev/rmt/c201d*mn /dev/rmt/c201d*mnb
Meaning Rewind on close, compress data Rewind on close, compress data, Berkeley style No rewind on close, compress data No rewind on close, compress data, Berkeley style Rewind on close, high density Rewind on close, high density, Berkeley style No rewind on close, high density No rewind on close, high density, Berkeley style Rewind on close, low density Rewind on close, low density, Berkeley style No rewind on close, low density No rewind on close, low density, Berkeley style Rewind on close, medium density Rewind on close, medium density, Berkeley style No rewind on close, medium density No rewind on close, low density, Berkeley style
Note: High density is 6250 bpi, medium is 1600 bpi, and low is 800 bpi. For AT&T-style devices the tape is positioned after the EOF following the data just read. For Berkeley-style devices, the tape is not repositioned in any way.
AIX Floppy Drive Device Files
Block /dev/fd0
Character /dev/rfd0
39
Block /dev/floppy/c201d0s0
Character /dev/rfloppy/c201d0s0
40
Managing Processes
6. Managing Processes
6.1 AIX
The ps Command
AIX supports both the AT&T and the BSD form of the ps command. To use the BSD form, simply leave off the minus sign for the command options, for example:
# ps alx
The renice command, unlike in HP-UX, does not take a -n option. The syntax of renice is:
# renice Priority -p PID
Signals
Like HP-UX, AIX really has two kill commands: /bin/kill and the kill built-in KornShell command. The signals for each differ. For example:
# /bin/kill -l NULL HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ MSG WINCH PWR USR1 USR2 PROF DANGER VTALRM MIGRATE PRE GRANT RETRACT SOUND SAK # kill -l 1) HUP 2) INT 3) QUIT 4) ILL 5) TRAP 6) LOST 7) EMT 8) FPE 9) KILL 10) BUS 11) SEGV 12) SYS 14) 15) 16) 17) 18) 19) 20) 21) 22) 23) 24) 25) ALRM TERM URG STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ 27) 28) 29) 30) 31) 32) 33) 34) 35) 36) 37) 38) MSG WINCH PWR USR1 USR2 PROF DANGER VTALRM MIGRATE PRE bad trap bad trap 40) 41) 42) 43) 44) 45) 46) 47) 48) 49) 50) 51) bad bad bad bad bad bad bad bad bad bad bad bad trap trap trap trap trap trap trap trap trap trap trap trap 53) 54) 55) 56) 57) 58) 59) 60) 61) 62) 63) bad trap bad trap bad trap bad trap bad trap bad trap bad trap GRANT RETRACT SOUND SAK
41
The AIX/HP-UX Interoperability Guide 13) PIPE 26) bad trap 39) bad trap 52) bad trap
AIX also has a killall command that any user can run to kill all of his or her processes except the sending process. The syntax is:
# killall -Signal
The next level is that of subsystem. In the above command, we have the inetd subsystem listed in each of the subserver stanzas. To see a list of all subsystems, use the odmget SRCsubsys command:
# odmget SRCsubsys SRCsubsys: subsysname = "lpd" synonym = "" cmdargs = " " path = "/usr/lpd/lpd" uid = 0 auditid = 0
42
Managing Processes standin = "/dev/console" standout = "/dev/console" standerr = "/dev/console" action = 1 multi = 0 contact = 3 svrkey = 0 svrmtype = 0 priority = 20 signorm = 0 sigforce = 0 display = 1 waittime = 20 grpname = "spooler" SRCsubsys: subsysname = "inetd" synonym = "" cmdargs = "" path = "/etc/inetd" uid = 0 auditid = 0 standin = "/dev/console" standout = "/dev/console" standerr = "/dev/console" action = 2 multi = 0 contact = 3 svrkey = 0 svrmtype = 0 priority = 20 signorm = 0 sigforce = 0 display = 1 waittime = 20 grpname = "tcpip" ...
Related subsystems form a subsystem group, the highest level of the SRC. Subsystem groups can be ascertained from the above command by means of the grpname descriptor. Thus the above output shows the lpd subsystem being part of the spooler subsystem group, and inetd a subsystem of the tcpip subsystem group. An easier way to view all the subsystems and subsystem groups is to use the lssrc -a command:
# lssrc -a Subsystem syslogd sendmail portmap inetd snmpd keyserv biod nfsd rpc.mountd rpc.statd rpc.lockd qdaemon writesrv Group ras mail portmap tcpip tcpip keyserv nfs nfs nfs nfs nfs spooler spooler PID 3363 4646 4908 5167 5428 6206 6465 8010 10067 10325 10583 5981 1631 Status active active active active active active active active active active active active active
43
The AIX/HP-UX Interoperability Guide infod lpd iptrace gated named routed rwhod timed llbd nrglbd ypserv ypbind ypupdated yppasswdd infod spooler tcpip tcpip tcpip tcpip tcpip tcpip ncs ncs yp yp yp yp 13684 12151 active active inoperative inoperative inoperative inoperative inoperative inoperative inoperative inoperative inoperative inoperative inoperative inoperative
The most commonly used SRC commands are startsrc, stopsrc, and refresh, each of which takes the following options: -s -g Apply this command to a subsystem, using the subsystem name provided in the lssrc -a command Apply this command to a subsystem group, using the subsystem group name provided in the lssrc -a command
The names of these commands imply their purpose: to start a subserver, subsystem, or subsystem group, use the startsrc command. For example, to start the rpc.mountd subsystem (which is actually the rpc.mountd daemon) type:
# startsrc -s rpc.mountd
This command starts all the subsystems (daemons) that comprise the nfs subsystem group: nfsd, biod, rpc.mountd, rpc.lockd, and rpc.statd. To stop a subsystem or subsystem group, use the stopsrc command in exactly the same way. To stop and restart daemons, or to have daemons reread a configuration file such as /etc/inetd.conf, use the refresh command. For example:
# refresh -s inetd
Cron
AIX supports an AT&T-style crontab file with each one-line entry containing the following:
The minute (0 through 59) The hour (0 through 23) The day of the month (1 through 31) The month of the year (1 through 12) The day of the week (0 through 6 for Sunday through Saturday)
44
Managing Processes
AIX also supports a convenient option to the crontab command: the -e option. This option will load the contents of your crontab file into an editing session. The editor used is determined by the value of the EDITOR variable. Once you save and exit from the editing session, your changes become your new crontab file and take effect immediately. Officially, the crontab spool directories are found in /var/spool/cron, although there is a link from /usr/spool to /var/spool in AIX for compatibility with previous versions of the operating system.
6.2 HP-UX
ps, nice, and renice
The HP-UX ps command is strictly AT&T-style. Therefore a complete listing of every process is:
# ps -elf
Priorities range from 0 (highest priority) to 256 (lowest priority), and are classified by the following:
Real-time priority (0-127) Reserved for processes started with rtprio() system calls. System priority (128-177) Used by system processes. User priority (178-256) Assigned to user processes.
HP-UX uses the AT&T version of nice values, which run from 0 to 39 with a default of 20. 39 is the lowest priority, 0 the highest. The HP-UX version of renice has the following syntax:
# renice -n priority_change PID
The new system nice value is equal to 20 + priority_change, and is limited to the range from 0 through 39. If priority_change is a negative value, priority is increased provided the user has appropriate privileges.
Signals
HP-UX signals look like the following. For the HP-UX kill command:
# /bin/kill -l NULL HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR VTALRM PROF POLL WINCH STOP TSTP CONT TTIN TTOU URG LOST DIL
45
The AIX/HP-UX Interoperability Guide 11) 12) 13) 14) 15) SEGV SYS PIPE ALRM TERM 26) 27) 28) 29) 30) CONT TTIN TTOU URG LOST
The HP-UX killall command is a procedure used by /etc/shutdown to kill all active processes not directly related to the shutdown procedure. It is not used in the same way as in AIX. killall is chiefly used to terminate all processes with open files so that the mounted file systems are no longer busy and can be unmounted.
Cron
crontab files are found in /usr/spool/cron/crontab and should not be edited directly. Unlike in AIX, there is no -e option to crontab. Therefore to change your cron table you should do the following:
# crontab -l > cron.new # vi cron.new # crontab cron.new # rm cron.new
Of course, you can use any text editor besides vi if you want. The one-line entries in crontab files are the same for AIX.
6.3 Summary
AIX supports both the BSD and AT&T versions of the ps command; HP-UX does not. AIX also supports the nice and renice commands, though the nice values differ from those in HP-UX. AIX nice values are from -20 to 20, whereas HP-UXs are from 0 to 39. Both operating systems have two versions of the kill command: /bin/ksh and the ksh built-in, each of which have slightly different signal values. Both systems have similar cron tables, but AIX has a nifty -e option to the crontab command. HP-UX supports the top command, but AIX does not. The biggest difference to be found with regard to process management between AIX and HP-UX is AIXs System Resource Controller, a daemon that can start, stop, or refresh a daemon or a group of daemons by means of a special set of commands. This mechanism allows for logical startup of several daemons at once as well as for orderly shutdown of daemons. Therefore, in the various rc files of AIX, you will see startsrc commands rather than commands to start individual daemons.
46
Managing Processes
Interoperability Notes
Process management between the two systems, with the exception of the System Resource Controller, is similar. To kill a process you can use the most common signals, such as SIGHUP, SIGABRT, SIGKILL, and SIGTERM, which have the same values. Also, since the KornShell is the default shell on both systems, the shell built-in kill and the bgnice option to the ksh set command work the same way.
47
Backups
7. Backups
Note: The AIX examples in this chapter use an 8-mm tape drive using the /dev/rmt0 device file, which has the following characteristics: rewind on close, no retension on open, high density. The HP-UX examples use a 4-mm DAT drive with the /dev/rmt/c201d3m device file, which has rewind on close and medium density characteristics.
7.1 AIX
The backup Command
backup and restore are proprietary AIX commands that provide file system dumps and recovery as well as backup of individual files and directories. These commands resemble dump and restore and are provided in addition to the standard UNIX utilities of tar, cpio, dd, and pax. Doing a file system dump with the backup command is known as backing up by i-node format in AIX parlance. The basic syntax of backing up a file system by i-node is:
# backup -f Device -DumpLevel -u File system
Device can be a file or a device file. DumpLevel is a numeric value from 0 to 9, where 0 represents a full file system backup. The other dump levels represent incremental backups: an n level backup includes all files modified since the last n - 1 level backup. If you do not specify a dump level, backup defaults to a level 9 backup. The -u option updates the /etc/dumpdates file, a log of your backups used by backup when doing an incremental backup. You should unmount a file system before backing it up, the root file system being the exception, of course. If you dump the root file system, file systems mounted on root, including journaled file systems, are not backed up.6
Examples
Do a full backup of the /home file system to tape, rewinding upon close:
# umount /home # backup -f /dev/rmt0 -0 -u /home # mount /home
Back up the root file systems files that have changed since the last 0-level backup to tape, rewinding upon close:
# backup -f /dev/rmt0 -1 -u /
In the first example we used the mount point of /home as the name of the file system. You can do that; in fact, it is easier to remember to do it this way. However, the /etc/dumpdates file will record the name of the file system using the raw device file instead of the mount point. In the case of /home that raw device file is /dev/rhd1 (by default the /home file systems device files are /dev/hd1 and /dev/rhd1). Dont be confused by this. If you prefer you can use either the raw device or block device file name in the backup command instead of the mount point. To get the
49
block device file name of a file system, use the lsfs command. From that you can determine the raw device file name by prepending the letter r to the block device file name. To back up individual files and directories use the -i option (for individual files). This is also known as backing up by name. The basic syntax is:
# backup -f Device -i
To use this option you must provide backup with a list of names as standard input by typing the names of each file after typing the command (ending the list with a Ctrl-D), using redirection, or using either the find command or the cat command. In the examples that follow the -q option is used to prevent AIX from prompting you to mount the backup media:
# backup -f /dev/rmt0 -iq /.profile /etc/profile /home ^D # backup -f /dev/rmt0 < /tmp/filelist -iq # cat /tmp/filelist | backup -f /dev/rmt0 -iq # find /home -print | backup -f /dev/rmt0 -iq
The last example above will back up the contents of the entire /home directory, but in the two examples before that, if you have /home listed in /tmp/filelist, only the directory name will be backed up. To construct the command in KornShell syntax so that it backs up directory trees as well as files, type the following:
# find $(< /tmp/filelist) -print | backup -f /dev/rmt0 -iq
To see a list of the files and directories scroll on your screen while backup is running, use the -v option. To save this output, redirect standard output or use the tee command.
# find $(< /tmp/filelist) -print | backup -f /dev/rmt0 -iqv >\ /var/adm/backed.up.files # find $(< /tmp/filelist) -print | backup -f /dev/rmt0 -iqv | tee |\ /var/adm/backed.up.files
Examples
Restore an entire file system backed up by i-node from tape.:
# restore -f /dev/rmt0 -r
50
Backups
You do not have to unmount the file system before restoring in this manner, but be sure to change directories to the appropriate file system first because restore assumes relative path names. To restore individual files backed up by i-node, use the -i option. This will start restore in interactive mode, which will step you through the process of restoring your files. For example:
# restore -f /dev/rmt0 -i
Extract all files from tape and display file names while doing so (-v, for verbose):
# restore -f /dev/rmt0 -xv
To avoid frustration in restoring files, it is extremely important that you know whether files backed up by name were done so using full or relative pathnames. To find out, use the -T option to get a list of files, for example: List files from the file /archive/backup1 created by the backup command:
# restore -f /archive/backup1 -T
Use the names of the files or directories exactly as listed in the output, even if the path names begin with a dot, such as ./home/partlist
51
Backup the System Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] WARNING: Execution of the backup command will result in the loss of all material previously stored on the selected output medium. This command backs up only rootvg volume group. no [] +
FORCE increase of work space if needed * Backup DEVICE or FILE (example: /dev/rfd0)
Simply insert the device file name of your tape drive, such as /dev/rmt0, and choose yes for FORCE increase of work space if needed. The latter is necessary if your system takes more than one tape for the backup. Keep in mind that mksysb creates an image backup of the root volume group only! If you have other volume groups, you must have separate backups for those.
Tape Drives
It is important to understand how AIX handles tape drives because you may find yourself unable to restore files from a tape you thought contained a good backup. One of the attributes in AIXs configuration of a tape drive is that of block size, the amount of data read or written in a single operation. When a tape drive is added to AIX, a default block size is configured for you. Frequently that block size is 512 bytes. However, you can change the block size through SMIT or with the chdev command. If you have a backup tape written with a block size of 512 bytes, but your AIX driver reads in 1024-byte blocks, you will not be able to restore the contents of the tape unless you change the block size to 512 bytes. For example:
# chdev -l rmt0 -a block_size=512
If you want, you can let the application or command, such as dd, determine the block size, in which case you can specify that your tape drive block size is variable in length. To do so use 0 as the block size:
# chdev -l rmt0 -a block_size=0
If you are reasonably confident that you have a valid backup on tape, and you just cant read it no matter what you do, try changing the block size of the tape device until it works. Just remember: restoration of data from a tape can only work if the block size used in the restore is the same as that of backup block size. For tape operations AIX uses the tctl command, similar to HP-UXs mt command. The syntax of tctl is:
# tctl -f Device Subcommand Count
52
Backups
Moves the tape forward the number of file marks specified by Count. Moves the tape backwards the number of file marks specified by Count. Rewinds the tape. Erases all contents on the tape and rewinds it. Fast-forwards, then rewinds the tape
7.2 HP-UX
fbackup
Like AIX, HP-UX has a proprietary scheme for backups in addition to the standard UNIX utilities. This scheme includes the fbackup and frecover commands. The basic syntax of the fbackup command is:
# fbackup -f Device [0-9] [-u] [-i path] [-e path] [-g graph]
Because fbackup does not by default write to standard output, the -f option is not optional. Device can be a file, device file, or a remote device file. A remote device file takes the form machine:/dev/device_name. You can specify - as the device to have fbackup write to standard output. The [0-9] option provides for incremental backups using the same scheme as that for AIXs backup: an n level backup includes all files modified since the last n - 1 level backup. The -i, -e, and -g options provide a means of specifying which portions of a file system you want backed up. If you recall, AIXs backup command backs up either entire file systems, or individual files. fbackup allows you to include a file system with the -i option and exclude portions of it with the -e option. For example:
# fbackup -f /dev/rmt/c201d3m 0 -i /usr -e /usr/tmp
This command does a full backup to tape of the /usr file system with the exception of the /usr/tmp directory tree. You can also place your inclusion and exclusion parameters in a graph file. A graph file is a text file containing the path names of the files and directories you either want included or excluded from your backup. These path names are preceded with either an i (denoting inclusion) or an e (denoting exclusion). For example, if your graph file contains the following lines:
i e e i e /usr /usr/tmp /usr/lib /users /users/guest
Then the /usr file system will be backed up with the exception of the /usr/tmp and /usr/lib directory trees, and the /users file system will be backed up with the exception of the /users/guest directory tree. If the name of this graph file is /usr/local/backup/graph1, then your command would look something like:
# fbackup -f /dev/rmt/c201d3m 0 -g /usr/local/backup/graph1
fbackup uses the usr/adm/fbackupfiles/dates file to record backup information for purposes of doing incremental backups. (This is similar to AIXs /etc/dumpdates file.) This file is not updated unless you use the -u option, which is only available with the -g option.
53
Examples
Perform a level-8 backup to /dev/rmt/c201d0m using the graph file /usr/local/graph, and update the /usr/adm/fbackupfiles/dates file:
# fbackup -f /dev/rmt/c201d0m 8 -u -g /usr/local/graph
Back up everything under the current directory except subdir to /dev/rmt/c201d0m on system roberts:
# fbackup -f roberts:/dev/rmt/c201d0m -i . -e ./subdir
frecover
The frecover command is the counterpart to the fbackup command. frecover can restore only files backed up with fbackup. There are four basic modes of operation for frecover. Recover everything on a backup volume:
# frecover -r
Read the index from the backup volume and write it to path:
# frecover -I path
As you can see, fbackup resembles AIXs restore commands options in the form of -r and -x. frecover -r and frecover -x have some options in common:
frecover -x | -r [ -fhoFX ]
frecover defaults to /dev/rmt/0mn, but you can use -f to specify a different device, including a remote device. The -h option is used to restore only directories but not the files contained in them. The -o option is used to force frecover to overwrite a newer file with an older one. Normally frecover does not do this. The -F option causes frecover to strip all the leading directories from the path names of files being recovered. This allows you to restore files backed up with full path names to different directories. The -x option makes all recovered files relative to the current directory. If, for example, you restored the file /usr/bin/vi and your current directory was /users/root, then the restored files new path would be /users/root/usr/bin/vi. For the frecover -x mode the -g option is available. This allows you to use a graph file in the same way as with fbackup. The file format of the graph file is the same. This is useful for partial recoveries.
Examples
Recover all files from medium-density tape:
54
Examples
Make relative backup on cartridge tape /dev/rct/0s0:
# find . -print | cpio -o | tcio -o /dev/rct/0s0
The first dd puts a boot area on the tape, making it a bootable image. Once the boot image is on tape, the tape is not rewound. The next dd appends an image of the SCSI disk at address 6 to the tape. Be sure to use the appropriate disk device file. This whole process takes about one hour for a 660MB HP2213 disk.
55
Once created, the tape can be used to completely restore the disk: 1. Insert the tape into the DDS tape drive. 2. Boot to ISL from the tape:
BOOT_ADMIN> b scsi.addr_of_dds ipl
Command backup restore fbackup frecover dump rdump rrestore tar cpio dd tcio
HP-UX no no7 yes yes yes yes yes yes yes yes yes
This is not quite true. There is a restore command in HP-UX, but it is the counterpart to the dump command.
56
Backups
Interplatform Backups
The following backup commands have been tested on an HP Model 712 and an IBM RS/6000 355.
Of course you can use rcp instead of ftp or rlogin or telnet instead of remsh. A quicker way to do the above is to use remsh and tar in a pipe, but this works only if your .rhosts is set up properly. For example:
# tar -cvf - .vue | remsh RS_node "(cd /tmp; tar -xvf -)"
This command writes the archive of .vue to standard output (the - option) and sends that output to the tar command on the RS/6000 and puts the unpacked files in /tmp. Instead of remsh AIX has the rsh command. So the above command going the other direction would look something like:
# tar -cvf - doc | rsh HP_node "(cd /usr/local; tar -xvf -)"
This backs up the subdirectory doc and puts it in the HP's /usr/local directory. You can also use cpio to copy a directory tree:
# find /.vue -print | cpio -ov | remsh RS_node cpio -idv
Archive the HPs .vue directory onto the 8mm tape drive of the RS/6000:
# tar cvf - /.vue | remsh RS_node dd of=/dev/rmt0 obs=20b
57
Archive the RS/6000s /doc directory onto the 4mm DAT drive of the HP:
# tar cvf - /doc | rsh HP_node dd of=/dev/rmt/c201d3m obs=20b
Restore the contents of the tape from an RS/6000 drive to the HP:
# remsh RS_node dd if=/dev/rmt0 bs=20b | tar xvfb - 20
These examples are for using the RS/6000s backup command to write to an HP drive. HP-UX cannot restore the files; you have to use AIX.
# find /usr/local/data -print | backup -f - -iv | rsh HP_node dd\ of=/dev/rmt/c201d3m # rsh HP_node dd if=/dev/rmt/c201d3m | restore -xvf Examples using pax
pax, short for portable archive exchange, is great for interplatform backups and restores. Both HP-UX and AIX support the pax command, which looks and acts the same on both systems. By default pax writes to standard output (with the -w option) and reads from standard input (with the r option). Without the -w or -r option pax simply lists the files contained in an archive. To archive verbosely the /doc directory from the HP to the RS/6000s tape drive:
# pax -wv /doc | remsh RS_node dd of=/dev/rmt0 obs=64k
To restore the contents of the above archive on the RS/6000 from the RS/6000:
# dd if=/dev/rmt0 ibs=64k | pax -r
To copy the directory /usr/local/data from the RS/6000 to the HP using the network:
# pax -wv /usr/local/data | rsh HP_node pax -rv General Tips
Variable block mode depends on the block size specified by the command itself (for example, the b option in tar). Because other systems, including HP, often break up larger reads and writes into approximately 64K chunks, it is a good idea to keep your block sizes at no more than that amount. Remember that if you are using an IBM 8mm tape drive, set the fixed block size to 1024 to avoid wasting tape. For example,
# chdev -l rmt0 -a block_size=1024
7.4 Summary
AIX and HP-UX support a wide variety of backup utilities, ranging from the proprietary to the universal. AIXs proprietary commands are backup and restore, based on dump and restore.
58
Backups
backup can do a file system dump or it can back up individual files. restore can restore an entire file system or individual files as well. AIX writes to tape either fixed-length blocks or variablelength blocks. You can configure the system for one or the other by using SMIT or the chdev command. For network backups or when the application determines block size, it is best to set the block size to variable length. Instead of having the mt command, AIX has the tctl command, which is very similar to mt. HP-UXs proprietary backup utilities are fbackup and frecover. These commands resemble backup and restore to an extent but are much more versatile, particularly in the area of graph files and network backups. To improve performance while writing to a cartridge tape, HP-UX supplies the tcio command. Interplatform backups are possible using standard UNIX utilities like tar, cpio, dd, and pax, and the networking commands of rsh (AIX) and remsh (HP-UX). These commands need the appropriate .rhosts entries in order to work properly. If you write to another systems tape drive, you must use a common command like tar if you want to eventually restore to the other system. But, for example, if you use backup to write to an HP-UX machines tape drive, you can only restore your files to an AIX system. For best portability, use pax, the portable archive exchange command.
59
Printing
8. Printing
In discussing UNIX printing, we have to be careful about the terms we use to avoid confusion. The respective documentation for AIX and HP-UX often use similar terms but with different meanings. In this document the following terms will be used consistently:
Remote printer A printer that is physically connected to another computer and accessed over a network
Network-based printer A printer or plotter that is directly connected to the local area network
8.1 AIX
The AIX Queuing System
To print in AIX you use a proprietary queuing system that is not confined to printing alone. In other words, the queuing system accepts jobs other than print jobs. For purposes of this discussion, however, we will assume all jobs are print jobs. You can submit print jobs with the enq command, the general queuing command, or you can use the qprt, lp, or lpr commands. AIX provides lp and lpr for purposes of compatibility with AT&T and BSD-style printing, but they do not represent completely different printing subsystems; they are simply front ends that do the same thing. All three print commands, qprt, lp, and lpr, call the enq command when invoked. enq submits jobs to a queue, either one you specify or a default queue. In AIX-speak a queue is an ordered list of requests for a specific device.8 This device is known as a queue device, and is not the printer or even its device file. A queue device is actually a set of parameters for the print device. To illustrate this, lets look at a sample /etc/qconfig file. /etc/qconfig is the master configuration file for the queuing system. It is an ASCII file consisting of stanzas that describe queues and their associated devices. For example, an entry might look like the following:
lp0: device = pdev0 pdev0: file = /dev/lp0 header = never backend = /usr/lpd/piobe
Queue lp0 is listed with an associated queue device of pdev0, which has three configuration parameters. file is the special device file of the printer. header specifies whether or not header
InfoExplorer, Queuing System Overview for System Management. HP-UX defines a queue as a directory used by the lp spooler to hold print jobs for each print destination until they can be printed. Thus the concept of queue is quite different.
61
pages are printed; in this case, no. backend is the program that actually sends jobs to the printer; in this case it is /usr/lpd/piobe. The basic steps of the print process are: 1. enq, either directly or through the qprt, lp, or lpr commands, submits jobs to a queue as defined in /etc/qconfig and places them in the /usr/lp/qdir directory. 2. The qdaemon awakens and places the print spool file in /var/spool/qdaemon. The qdaemon, which is started at boot time, tracks print requests and printer availability. When a printer becomes available, qdaemon submits the job to the printer backend. 3. The backend program sends the job to the printer and at the same time keeps status of the print job in the /usr/lpd/stat directory. This directory is consulted when you use one of the queue checking programs: qchk, lpstat, or enq -A commands.
2. Select Add a Printer/Plotter. 3. From the Printer/Plotter Type menu, select the printer that either matches or closely resembles your printer. 4. From the Printer/Plotter Interface menu, select either parallel, rs232, or rs422, depending on your connection. 5. From the Parent Adapter menu select the appropriate adapter. For parallel you should see only one choice:
ppa0 Available 00-00-0P Standard I/O Parallel Port Adapter
6. From the Add a Printer/Plotter menu type in the value for PORT number. If you are not sure what the port number is, press the F4 key in the field to get a list of port numbers. Press Return. 7. SMIT then adds the printer to the customized configuration database and displays the following message:
lp0 Available
The device file created for this process is /dev/lpN, where N is 0 for the first printer, 1 for the next printer, and so on.
62
Printing
Printing Locally
Adding a printer device to the system and creating its device file is not enough to get printing going on the RS/6000. You must create a virtual printer for every queue you plan on creating.
Virtual Printers
A virtual printer is a set of attributes that define a specific software view of a real printer.9 For example, if you attach a printer that supports only ASCII data streams, then you would create a virtual printer that sets up ASCII printing. If you have a PostScript printer, you need a PostScript virtual printer. If your printer supports multiple data streams, such as ASCII, PostScript, and PCL, you need to create a virtual printer for each. You create virtual printers for each workstation hosting a printer and for each workstation printing to a network-based printer. Use the mkvirprt command to create a virtual printer. The following is an example of creating a virtual printer for a local HP LaserJet IIIsi. It assumes that the LaserJet device was added by the process described above in Adding a Local Printer.
# smit mkvirprt No. 1 2 3 4 Description Printer or Plotter Attached to Host Printer or Plotter Attached to Xstation Printer or Plotter Attached to ASCII Terminal Network Printer (Hewlett-Packard JetDirect) -> 1
Under the Name column is the list of all printers by device name added to the system. Pressing Return here means you want to create a virtual printer for the first device listed, in this case lp0. At this point you get a list of printers. Following is a partial list.
63
No. 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
Description IBM 5589 Model H01 IBM 6180 Color Plotter IBM 6182 Auto Feed Color Plotter IBM 6184 Color Plotter IBM 6185-1 Color Plotter IBM 6185-2 Color Plotter IBM 6186 Color Plotter IBM 6252 Impactwriter IBM 6262 Printer IBM 7372 Color Plotter Canon Laser Shot LBP-B406S/D/E, A404E, A304E Dataproducts BP2000 Line Printer Dataproducts LZR 2665 Laser Printer Hewlett-Packard LaserJet II Hewlett-Packard LaserJet III Hewlett-Packard LaserJet IIISi Hewlett-Packard LaserJet 4 OKI MICROLINE 801PS Printronix P9012 Line Printer Plotter -> 51
In this example we choose number 51, representing the HP LaserJet IIISi. What follows is a series of questions.
Header pages wanted? (n=none; a=each file; g=each job): -> (n) Trailer pages wanted? (n=none; a=each file; g=each job): -> (n) NOTE: The hplj-3si printer supports multiple print data streams. Each of the data streams will now be configured individually. -------------------- PostScript -------------------Enter print queue name (or, ! to bypass configuration): -> (ps)ps1 Should this queue be the default queue? -> (y) hplj-3si (PostScript) configured for print queue ps1 -------------------- PCL -------------------Enter print queue name (or, ! to bypass configuration): -> (pcl)pcl1 hplj-3si (PCL) configured for print queue pcl1
In the first two questions we accepted the default value (n). Then we were informed that this printer supports multiple data streams: PostScript and PCL, for each of which we had to create a virtual printer. The first virtual printer was for the PostScript data stream and was given a queue name of ps1. The second was for a PCL virtual printer and was given the queue name of pcl1. The creation of these two virtual printers resulted in the following entries in the /etc/qconfig file:
ps1: device = lp0 lp0: file = /dev/lp0 header = never trailer = never access = both
64
Printing backend = /usr/lib/lpd/piobe pcl1: device = lp0 lp0: file = /dev/lp0 header = never trailer = never access = both backend = /usr/lib/lpd/piobe
The queue ps1 was made the default queue and therefore appears first in /etc/qconfig. Each queue has the same queue device because we are printing to the same printer. However, if we want to print in PostScript mode, we use the first queue; for PCL, the second. For example, For queue ps1:
# enq -Pps1 file # qprt -Pps1 file # lp -dps1 file # lpr -Pps1 file
2. Select Host Access for Printing. 3. Select Add a Remote Host. 4. In the Add a Remote Host screen, fill in the name of your print client in the Name of Remote HOST field.
65
The terminology here is confusing, but try to remember: what is local to you is remote to the remote workstation. You are adding a remote host name to the print servers list of authorized print client workstations This list is the /etc/hosts.lpd file.. 5. Return to the first menu by pressing the F3 key three times. Select lpd Remote Printer Subsystem. 6. Select Start Using the lpd Subsystem. 7. Select Start BOTH Now and at System Restart. This selection starts the lpd and puts an entry into the /etc/inittab file for it to start upon boot.
For NAME of queue to add, type in anything you want. It is a good idea, however, to use some kind of logical naming system, such as rlp0 (remote line printer 0). For DESTINATION HOST for remote jobs, type the hostname of the print server. Leave the FILTER fields the default unless you are printing to an HP-UX machine. See the section on Interplatform Printing for more information. For name of QUEUE on remote printer, type the name of the print servers local queue; typically it is lp0. For NAME of device to add, type anything you want, again something like drlp0 (device for rlp0) might be useful. Leave the BACKEND PROGRAM pathname /usr/lpd/rembak. This backend is designed to send print jobs to a print server running the lpd. Thus when you print to a remote printer in AIX, the print job goes through two print queues. It is processed locally and passed to the remote backend (/usr/lpd/rembak), which then passes the job to the remote lpd, at which time the print job is processed as a local print job on the remote printer. When you type the lpstat command to get status on a print job you will see two queues listed, something like:
# lpstat Queue Dev ------- ----rps1 drps1 lp0 dlp0 Status Job Files User PP % Blks Cp Rnk ------- --- ------------- ---------- ---- -- ----- --- --READY READY
66
Printing
In this case queue rps1 prints to the remote queue lp0. Both queues service the same print job.
Enter number from list above (press Enter to terminate): Enter the printer hostname: -> p2410l3si
Here we chose option 4 and entered the hostname of the printer, in this case p241013si. The next screen asks if you want to make this printer a boot/tftp server. In most cases you choose 2, for no.
No. 1 2 BOOTP/TFTP Server Make this system a BOOTP/TFTP server Do NOT make this system a BOOTP/TFTP server -> 2
The next screen displays possible printers. The example that follows shows a list that has been scrolled through a few times:
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 IBM 7372 Color Plotter Canon Laser Shot LBP-B406S/D/E, A404E, A304E Dataproducts BP2000 Line Printer Dataproducts LZR 2665 Laser Printer Hewlett-Packard LaserJet II Hewlett-Packard LaserJet III Hewlett-Packard LaserJet IIISi Hewlett-Packard LaserJet 4 OKI MICROLINE 801PS Printronix P9012 Line Printer Plotter PostScript Printer Bull PR-88 ASCII printer Bull Compuprint Pagemaster 201 in HP-II Mode Bull Compuprint Pagemaster 411 in HP-II Mode -> [ 44 more ]
51
67
Thus we created two queues, one for the PostScript data stream, and one for PCL. The PCL queue was made the default queue, and no header or trailer pages were configured for this printer. Our /etc/qconfig file looks like:
pcl: device = hp@p2410l3si hp@p2410l3si: file = /var/spool/lpd/pio/dev/hp@p2410l3si header = never trailer = never backend = /usr/lib/lpd/pio/etc/piojetd p2410l3si ps: device = hp@p2410l3si hp@p2410l3si: file = /var/spool/lpd/pio/dev/hp@p2410l3si header = never trailer = never backend = /usr/lib/lpd/pio/etc/piojetd p2410l3si
Both queues are for the same network-based printer. At this point you would submit jobs to the appropriate queue, either PCL or PostScript.
68
Printing
To bring down the entire queuing system, allowing queued jobs to finish before doing so:
# qadm -G Queue
8.2 HP-UX
The Components of the LP Spooler
The components of the lp spooler are:
Printer names Printer classes Print destinations System default printer Printer interfaces Printer models Device files Line printer scheduler
69
Printer Names
When you configure a printer into the lp spooler, you assign it a name that you will use when you later submit print requests. This name is referred to as the printer name. Printer names can contain up to 14 characters, which can be alphanumeric or underscores. The name may or may not be the same as the device file name. Some correspondence between the printer name and device file name is suggested. The printer name is the name of the printer that shows up when you request the status of the printer queue with the lpstat command. A hypothetical system hypo1 has the following printers defined in its lp spooler. The printers have the following names:
laser1 laser2 phred letterhead invoices check_printer
Printer Classes
You can treat a group of printers as if they were one printer. A printer class is a name that you can use to refer to the group of printers. When submitting a print request you can specify a particular printer name or a printer class name. When submitting a print request to a printer class, the print requests will print on the first available printer in the group rather than on a specific printer. Printers that are members of a printer class can still be referenced individually. Creating a printer class is optional. On the hypothetical system hypo1, three of the printers are grouped into a printer class called laser.
Printer class: laser1 laser2 phred laser
Printer class names can contain up to 14 characters, which can be alphanumeric or underscores. Printer class names and printer names on the same system cannot be the same name. Printer names and class names must all be unique. Printer classes cannot include remote printers. A printer class must contain at least one printer. A printer can only belong to one printer class at a time. To remove a printer from a printer class, you must remove the printer from the lp spooler and readd without specifying a printer class
70
Printing
Print Destinations
Several of the commands for the lp spooler require you to specify a print destination. A destination is the name of a printer or printer class. For our example system hypo1, possible destinations are:
Printer class: laser1 laser2 phred invoices check_printer letterhead laser
Printer Interfaces
A printer interface, also known as an interface script, is the final stage of the lp spooler. It is the part of the lp spooler that is responsible for sending data to a printer. Each printer that you have defined for use by the lp spooler has its own interface script (shell script) that resides in the /usr/spool/lp/interface directory. When printers are added to the lp spooler, an interface script is copied from /usr/spool/lp/model to /usr/spool/lp/interface and given the printer name. If we were to list the directory /usr/spool/lp/interface on our hypothetical system hypo1, it would contain the printer interface files laser1, laser2, phred, letterhead, invoices, and check_printer. The entry for the class name laser would be located in the directory /usr/spool/lp/class; it would not be found in the interface directory.
Printer Models
There are printer interface script models you can choose from that have been created for you in the /usr/spool/lp/model directory. Many of them have names that match the model numbers of Hewlett-Packard Printers and Plotters. When you configure your printer into the lp spooler, you must specify which printer model interface script you want to use. The model will be automatically copied from the /usr/spool/lp/model directory into the /usr/spool/lp/interface directory and given the name that you specified as your printer name.
71
If you have an HP printer, you will probably find a model script that matches its model number or name. Those interface model scripts that match your printers typically do not need to be changed. If you know how to do shell programming, you can customize printer interface model scripts to meet your specific printing needs. If you do not have an HP printer, try using the dumb interface model. You might have to modify it to be able to use all of the features of your non-HP printer, but dumb should work for basic ASCII text printing. If the dumb printer interface model script does not work, contact your printer supplier for a UNIX line printer spooler interface script or try the script that most closely matches your non-HP printer type.
Device Files
Device files are not part of the lp spooler; they are special files that define the necessary device driver and hardware address needed to communicate with a particular physical device (in this case a printer). The printer name referred to by the lp spooler and the name of the device file for a printer are not required to be the same, but a correspondence is recommended. You can create printer device files using SAM or HP-UX commands when you add a printer to the lp spooler. SAM creates a device file for you. If necessary, SAM can override the default device file naming convention. When you configure a printer into your lp spooler, you must supply the name of your printers device file.
Local Printer
A local printer is a printer that is physically connected to your system.
72
Printing
Remote Printer
A remote printer is a printer that is not physically connected to your system, but can be accessed by your system through a local area network (LAN). To configure a remote printer into your local lp spooler, you must be able to access the remote system via a LAN. The process of adding a remote printer is similar to that of adding a local printer, though you will need to supply some slightly different information.
Network-Based Printer/Plotter
A network-based printer or plotter is connected directly to the local area network (LAN). A network-based printer or plotter is not physically connected to any system.
Remote Spooling
If you have several systems connected to a Local Area Network (LAN) and would like the systems to share the use of a printer, you can set up the lp spoolers of the systems that are not physically connected to the printer to automatically send their print requests (via the LAN) to the lp spooler of the system that does have the printer. The systems without printers act as though they were a user on the system with the printer, submitting print requests to that systems lp spooler. This is accomplished by a special program known as the Remote Spooling Daemon (rlpdaemon). The rlpdaemon program runs in the background (on the system with the printer) monitoring the incoming LAN traffic for any remote print requests from other systems. When these requests arrive, the rlpdaemon program submits them to its local lp spooler on behalf of the remote user. In addition to remote print requests, the remote spooling daemon must also handle cancel and status requests from remote systems. There are special interface scripts on the remote systems that issue cancel and status requests. These special interface scripts have a lot in common with printer interface scripts. They have a model directory that can hold sample versions of these scripts, and they have an interface directory where the scripts currently in use reside. The cancel and status models are copied into their respective interface directories automatically when adding a remote printer. The directory /usr/spool/lp/cmodel contains a sample interface script, rcmodel, that sends a remote cancel command to the system with the printer. When you configure a remote printer into your lp spooler, the cancel model script is copied into the /usr/spool/lp/cinterface directory and is given the same name as the printer. The directory /usr/spool/lp/smodel contains a sample of an interface script, called rsmodel, which sends a remote status command to the system with the printer. When you configure a remote printer into your lp spooler, the status model script is copied into the /usr/spool/lp/sinterface directory and is given the same name as the printer.
73
It is unlikely that you will need to customize the remote cancel and status model scripts. If you do customize these remote control scripts, you must copy them to a different file name to avoid destroying your changes when updating the system with the update utility. Configuring a remote printer into your lp spooler requires additional information beyond what is needed to configure a local printer. In addition to the information you normally supply when configuring a local printer into your lp spooler, you will need to tell your system:
The name of the system with the printer The interface script to use when it issues a remote cancel request The interface script to use when it issues a remote status request The name of the printer (as it is defined in the lp spooler of the remote system) where you want your printouts to be printed.
The name you are giving to this printer or plotter. Printer names can be up to 14 characters in length, and the characters must be alphanumeric (A-Z, a-z, 0-9) or an underscore (_). The name of the device file that the printer or plotter will use. SAM creates the device file for you. SAM uses the default device file named lp_printer-name. You can override the default device file name by specifying your device file name when filling in the printer information. The model script from the /usr/spool/lp/model directory, for example, laserjetIIISi for an HP LaserJet IIISi. The print request priority for this printer. The default is zero (0). The class to which the printer or plotter will be added (optional). Printer class names can be up to 14 characters in length, and the characters must be from the set (A-Z, az, 0-9). The underscore (_) character is allowed in printer class names. In addition, decide whether to make this device your systems default printer.
3. Run SAM. 4. Highlight Peripheral Devices and activate the Open control button. 5. Highlight Printers and Plotters and activate the Open control button. 6. Highlight Printers/Plotters and activate the Open control button.
74
Printing
7.
Choose Add a Local Printer/Plotter > and the menu item associated with the printer interface type from the Actions menu. NOTE: The printer driver must be part of the kernel to add the printer to the lp spooler. If the printer driver is not currently configured into the kernel, SAM prompts you to add the driver(s) and reboot the system.
8. Highlight the interface to which you connected the printer and fill in and additional information (port number or bus address) and activate the OK control button. If an interface entry is not listed, activate the Diagnose Missing Card control button. 9. Fill in the printer interface dialog box fields, choose from the menu button values, and turn on and off check box values. 10. Activate the OK control button.
Whether you wish to make this device your systems default printer. The name of the remote system to which the printer or plotter is attached. The name of the remote printer or plotter. The cancel model on the remote system (optional). The status model on the remote system (optional). Whether you wish to allow any user to cancel any printing request. Whether the remote printer is on a system using BSD (Berkeley Software Distribution) UNIX. Using BSD disables any lp -oparm options. BSD systems do not understand the -o option.
3. Run SAM 4. Highlight Peripheral Devices and activate the Open control button. 5. Highlight Printers and Plotters and activate the Open control button. 6. Highlight Printers/Plotters and activate the Open control button. 7. Choose Add a remote printer/plotter > and the menu item associated with the printer interface type from the Actions menu. 8. Fill in the printer interface dialog box fields and turn on off check box values. 9. Activate the OK control button. To configure a remote printer into your lp spooler, you must be able to access the system with the printer via a local area network (LAN). The process of adding a remote printer is similar to that of
75
adding a local printer, though you will need to supply SAM with some slightly different information. Remote printers cannot be members of a printer class.
The name you are giving to this printer or plotter. The printer node name. The model or interface that the printer will use. The link-level address of the network card installed in the printer. The TCP-IP protocol printer requires an Internet Protocol (IP) address. The priority for this printer. The class to which the printer or plotter will be add. In addition, decide whether you wish to make this device your systems default printer.
3. Run SAM 4. Highlight Peripheral Devices and activate the Open control button. 5. Highlight Printers and Plotters and activate the Open control button. 6. Highlight Printers/Plotters and activate the Open control button. 7. Choose Add a network-based printer then Add TCP-IP protocol printer... from the Actions menu. 8. Fill in the printer interface dialog box fields and turn on and off check box values. 9. Activate the OK control button.
76
Printing
To stop the LP spooler: 1. Run SAM. 2. Highlight Peripheral Devices and activate the Open control button. 3. Highlight Printers and Plotters and activate the Open control button. 4. Highlight Printers/Plotters and activate the Open control button. 5. Choose Shut down printer spooler from the Actions menu.
Disabling a Printer
1. Run SAM. 2. Highlight Peripheral Devices and activate the Open control button. 3. Highlight Printers and Plotters and activate the Open control button. 4. Highlight Printers/Plotters and activate the Open control button. 5. Highlight the printer you want to disable in the object list. 6. Choose Disable printer from the Actions menu. NOTE: When you use SAM to enable or disable a printer, SAM performs both the accept/reject operation and the enable/disable operation. If you wish to disable a printer but still accept requests for that printer (letting them accumulate in the request directory for the printer), you must use the HP-UX commands method to disable the printer.
Enabling a Printer
To enable a printer using SAM: 1. Run SAM. 2. Highlight Peripheral Devices and activate the Open control button. 3. Highlight Printers and Plotters and activate the Open control button. 4. Highlight Printers/Plotters and activate the Open control button.
77
5. Highlight the printer you want to enable in the object list. 6. Choose Enable printer from the Actions menu.
Add the printer to the lp spooler with the lpadmin command. There is an example later in this section. The command has the following basic syntax:
/usr/lib/lpadmin -ppname -vdevfile -mmodel [-d]
where pname is the name that you use to refer to this printer when using the various lp spooler commands, devfile is the name of the device file to be used to communicate with this printer, model is the script you would like to model your printers interface script after. The lpadmin command will make a copy of this model script and place it in the directory /usr/spool/lp/interface, with the name you specified in the -p option described above. -d specifies that you want this printer to be the system default printer. When using the lpadmin command, do not put any spaces between the options and their respective values. Allow print requests to enter the request directory for the newly added printer with the accept command:
/usr/lib/accept pname
where pname is the name you gave to this printer in the lpadmin command. Enable the newly added printer to process print requests with the enable command:
/usr/bin/enable pname
78
Printing # /usr/lib/lpshut
where pname is the name that you will use to send print requests to this printer. For devfile, since the printer is not physically connected to your local system, use the /dev/null device file. model is the remote model script /usr/spool/lp/model/rmodel. A copy of this file will be put in the /usr/spool/interface directory with the name you specified in pname. -d specifies that you want this printer to be the system default printer. cmodel is /usr/spool/lp/cmodel/rcmodel, used to forward a cancel request over to the remote systems lp spooler. The lp spooler copies /usr/spool/lp/cmodel/rcmodel to the /usr/spool/lp/cinterface directory with the name you specified in pname. smodel is the status model script /usr/spool/lp/smodel/rsmodel, used to forward a status request over to the remote systems lp spooler. The lp spooler copies /usr/spool/lp/smodel/rsmodel to the /usr/spool/lp/sinterface directory with the name you specified in pname. remsys is the name of the remote system to which the printer is physically connected. rpname is the printer name as it is defined on the remote system. Allow print requests to enter the request directory for the newly added remote printer with the accept command:
# /usr/lib/accept pname
Enable the newly added remote printer to process print requests with the enable command:
79
You only need to use the -ob3 option if your print request will be printed on or pass through a system that uses the Berkeley Software Distribution (BSD) style lp spooler. BSD systems use three-digit (rather than four-digit) print request-ID numbers (these are the numbers returned when you send something to print). The -ob3 option disables any lp -oparm options. BSD systems do not understand the -o option to the lp command. Use the -orc if you want to restrict users to canceling only their own print requests.
Examples
To add a remote printer, referred to locally as letterhead, physically connected to the system hypo2 that uses the BSD style print request-ID numbers, and is known on the remote system as memos:
# /usr/lib/lpadmin -pletterhead -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormhypo2 -ob3 -orpmemos
To add a remote printer, referred to locally as remote_drafts, physically connect to the system system13, known on the remote system as old_reliable, and requires a printer priority of 3:
# /usr/lib/lpadmin -premote_drafts -v/dev/null -mrmodel -ocmrcmodel \ -osmrsmodel -ormsystem13 -g3 -orpold_reliable
To allow print requests to enter the request directory for the newly added remote printers:
# /usr/lib/accept letterhead # /usr/lib/accept remote_drafts
You can issue individual commands for each printer class or you can combine the printer classes in one command. To reject print requests for a printer or printer class, use the reject command:
# /usr/lib/reject [-r"message"] name [-r"message"] [name]
where message is a message to be displayed when users obtain status information about the printer or printer class, name is the name of the printer or printer class whose request directory is being prohibited from receiving print requests.
Examples
To accept print requests for the laser1, laser2, phred, invoices, check_printer printers and the laser printer class:
# /usr/lib/accept laser1 # /usr/lib/accept phred # /usr/lib/accept invoices laser2 check_printer laser
To reject print requests for the laser1, laser2, phred, invoices, check_printer printers and the laser printer class:
# /usr/lib/reject -r"Printer on loan to seismology lab." laser1 # /usr/lib/reject -r"Printers being serviced" laser1 check_printer # /usr/lib/reject -r"Invoice forms on order" invoices \ -r "printers are being serviced" laser1 laser2 phred laser
You can issue individual commands for each printer or you can combine the printers in one command separated by spaces. To disable a printer to process print requests, use the disable command:
# /usr/bin/disable [-r"message"] pname [-r"message"] [pname] Examples
81
where req-ID is the print request identification number, and printer is the printer name. To list print request identification numbers, use the lpstat command. The cancel command has several useful options that allow you to do things such as cancel all print requests that you have submitted or cancel all requests associated with a particular printer or printer class. Here are a few helpful cancel options and their descriptions: -a -e -i -u user Remove all requests a user owns on the specific printer. The owner is determined by the users login name and host name on the machine where the lp command was invoked Empty the spool queue of all requests for the specified printer. Only users with superuser capabilities can use the -e option Cancel only local requests. Remove any requests queued belonging to user. Multiple -u options are allowed. Only users with superuser capabilities can use the -u option.
Examples # cancel laser-3456 # cancel phred-2152 # cancel letterhead-1547 # cancel laser-3456 phred-2152 letterhead-1547
If no options are given, lpstat displays the status of all requests made by the user. The -t option lists the following additional information:
Status of the lp spooler System default printer List of class names and their members
82
Printing
List of printers and associated device files Status of each print request directory (accepting or rejecting). If a reason was specified when the requests were rejected the reason is displayed. Status of each printer (enabled or disabled). If a reason was specified when the printer was disabled, the reason is displayed. Priority for each printer List of print requests for each printer that includes the following attributes for each print request: Print request identification number Name of user that submitted the print request Priority Date and time submitted File name Size
4. For printing from and HP-UX client to an AIX print server, be sure to choose the BSD option when adding a remote printer using SAM.
83
Configuring TCP/IP
9. Configuring TCP/IP
9.1 AIX
AIX supports a number of different networking technologies, including Ethernet, Token-ring, and Fiber Distributed Data Interface (FDDI). For purposes of this discussion we will assume Ethernet, since its use is so widespread. You must have the bosnet.tcpip.obj software installed in order to configure TCP/IP. On most UNIX systems you configure TCP/IP with commands such as ifconfig and route, and then make your configuration permanent by editing startup files. You can do this with AIX, but since TCP/IP configuration is part of the ODM database, it is best to use SMIT to do all your configuration.
2. On the Available Network Interfaces screen, select the appropriate interface. Upon bootup cfgmgr recognizes the network card and configures it into the ODM database. 3. On the Minimum Configuration & Startup menu, fill in, as a minimum, the HOSTNAME, Internet ADDRESS fields. Also specify whether or not you want to start TCP/IP now or at bootup in the START Now field. 4. Additional parameters that can be configured with this screen are network mask, name service, gateway, and cable types. If you leave the Network MASK field blank, AIX will provide you with a default value based upon the class of the systems IP address. For the CABLE Type field, bnc specifies thin cable and dix specifies thick; for other types, choose N/A.
85
Example
Minimum Configuration & Startup To Delete existing configuration data, please use Further Configuration menus Type or select values in entry fields. Press Enter AFTER making all desired changes. * HOSTNAME * Internet ADDRESS (dotted decimal) Network MASK (dotted decimal) * Network INTERFACE NAMESERVER Internet ADDRESS (dotted decimal) DOMAIN Name Default GATEWAY Address (dotted decimal or symbolic name) Your CABLE Type START Now [Entry Fields] [a2410bjv] [15.24.48.58] [255.255.248.0] en0 [15.41.144.101] [nsr.hp.com] [15.24.55.253] N/A no + +
2. Choose the Set the Hostname menu item. 3. Fill in the new hostname in the HOSTNAME field.
Adding a Route
1. Start SMIT:
# smit mkroute
2. Fill in the values for DESTINATION Address and Default GATEWAY Address. For Destination Type you have a choice between net and host. AIX provides a default value of 1 for the METRIC field.
86
Configuring TCP/IP
Add Static Route Type or select values in entry fields. Press Enter AFTER making all desired changes. Destination TYPE * DESTINATION Address (dotted decimal or symbolic name) * Default GATEWAY Address (dotted decimal or symbolic name) * METRIC (number of hops to destination gateway) [Entry Fields] net + [] [] [1] #
Removing a Route
Removing a route in SMIT looks much as the same as adding a route. Just type in the following and fill in the appropriate values:
# smit rmroute
If you want to flush the routing table temporarily but keep the routing information in the database, accept the defaults. If you want to clear the ODM of routing information, select yes for Flush Routing Table in the Configuration Data Base.
87
3. Make the appropriate changes as needed. If you leave the BROADCAST ADDRESS field blank, AIX will provide a default based on the subnet mask.
Example
Change / Show a Standard Ethernet Interface Type or select values in entry fields. Press Enter AFTER making all desired changes. Network Interface Name INTERNET ADDRESS (dotted decimal) Network MASK (hexadecimal or dotted decimal) Current STATE Use Address Resolution Protocol (ARP)? BROADCAST ADDRESS (dotted decimal) [Entry Fields] en0 [15.24.48.58] [255.255.248.0] up + yes + []
2. Select the Remove a Network Interface option. 3. Select the appropriate interface. CAUTION: SMIT removes the interface without prompting!
88
Configuring TCP/IP
Domain Nameserver (/etc/resolv.conf) Move cursor to desired item and press Enter. Start Using the Nameserver List All Nameservers Add a Nameserver Remove a Nameserver Stop Using a Nameserver ------------------------------Set / Show the Domain Remove the Domain
Use this as a means to edit the /etc/resolv.conf file or use a text editor to do so.
Use this as a means to edit the /etc/hosts file or use a text editor to do so.
Editing /etc/inetd.conf
To edit /etc/inetd.conf and ensure the ODM database is updated: 1. Start SMIT:
# smit inetdconf
89
inetd Subservers Move cursor to desired item and press Enter. List All inetd Subservers Add an inetd Subserver Change / Show Characteristics of an inetd Subserver Remove an inetd Subserver
Use the menu selections to add or remove entries to the /etc/inetd.conf and update the ODM. If, however, you edit /etc/inetd.conf with a text editor you must use the inetimp command to update the new information in the InetServ object class in the ODM.
Follow the menus to make the changes you desire. As with the /etc/inetd.conf file, you must use inetimp to update the ODM after using a text editor to change the /etc/services file.
Editing /etc/hosts.equiv
To create entries to or modify /etc/hosts.equiv using SMIT: 1. Start SMIT:
# smit hostsequiv
90
Configuring TCP/IP
Host Access (/etc/host.equiv) Move cursor to desired item and press Enter. List All Remote Hosts Add a Remote Host Remove a Remote Host
Editing /etc/ftpusers
To edit /etc/ftpusers: 1. Start SMIT:
# smit ftpusers
91
Type or select values in entry fields. Press Enter AFTER making all desired changes. Use BSD Style rc Configuration [Entry Fields] no +
A caveat about the above procedure: after selecting yes you will not have System Resource Controller (SRC) support. In other words, you cant use commands like refresh -s inetd. If you want flat file configuration and SRC support, uncomment the commands in /etc/rc.net under the heading Traditional Configuration. Below is that section in commented form:
################################################################## # Part II - Traditional Configuration. ################################################################## # An alternative method for bringing up all the default interfaces # is to specify explicitly which interfaces to configure using the # ifconfig command. Ifconfig requires the configuration information # be specified on the command line. Ifconfig will not update the # information kept in the ODM configuration database. # # Valid network interfaces are: # lo=local loopback, en=standard ethernet, et=802.3 ethernet # sl=serial line IP, tr=802.5 token ring, xt=X.25 # # e.g., en0 denotes standard ethernet network interface, unit zero. # # Below are examples of how you could bring up each interface using
92
Configuring TCP/IP # ifconfig. Since you can specify either a hostname or a dotted # decimal address to set the interface address, it is convenient to # set the hostname at this point and use it for the aress of # an interface, as shown below: # #/bin/hostname robo.austin.ibm.com >>$LOGFILE 2>&1 # # (Remember that if you have more than one interface, # you'll want to have a different IP address for each one. # Below, xx.xx.xx.xx stands for the internet address for the # given interface). # #/usr/sbin/ifconfig lo0 inet loopback up >>$LOGFILE 2>&1 #/usr/sbin/ifconfig en0 inet 'hostname' up >>$LOGFILE 2>&1 #/usr/sbin/ifconfig et0 inet xx.xx.xx.xx up >>$LOGFILE 2>&1 #/usr/sbin/ifconfig tr0 inet xx.xx.xx.xx up >>$LOGFILE 2>&1 #/usr/sbin/ifconfig sl0 inet xx.xx.xx.xx up >>$LOGFILE 2>&1 #/usr/sbin/ifconfig xt0 inet xx.xx.xx.xx up >>$LOGFILE 2>&1 # # # Now we set any static routes. # # /usr/sbin/route add 0 gateway >>$LOGFILE 2>&1 # /usr/sbin/route add 192.9.201.0 gateway >>$LOGFILE 2>&1
9.2 HP-UX
Using SAM to Edit /etc/hosts
Note the following information before you begin:
SAM edits only the /etc/hosts file; it does not edit an NFS, NIS, or BIND Name Service database. If you must go through a gateway to reach the remote system that you are adding connectivity information about, SAM will prompt you for the gateways hostname and IP address. With this information, SAM will automatically configure the necessary routing (by executing an /etc/route add host command and adding it to /etc/netlinkrc). If you use only one gateway to reach all systems on other parts of the network, use the Modify Default Gateway action (under the Internet Connectivity screen of the Remote Connectivity area) to avoid having to enter the same gateway information every time SAM prompts you for it.
The following steps tell how to use SAM to automatically add entries to /etc/hosts: 1. Start SAM. 2. Select the Networking/Communications menu item. 3. Select the Remote System Connectivity menu item. 4. Select the Internet Connectivity menu item. 5. Select the Add action.
93
Note: The Remove action lets you delete /etc/hosts file entries. If you have to reach the remote system through a gateway, this action also removes the associated /etc/route add host command from the /etc/netlinkrc file.
6. Fill in the form according to its instructions. View the help screens for information about filling in the form. 7. Select apply to enter additional names of systems to be configured (use apply as a shortcut to remain in the add screen). Then, press OK when you are done with the screen. 8. Repeat steps 4 through 7 to add connectivity to more remote systems. 9. Exit the Internet Connectivity screen by selecting Exit from the List menu. From the Remote System Connectivity screen, select Exit SAM to exit from SAM.
Edit the /etc/netlinkrc file to remove the corresponding /etc/route add default entry for the gateway.
Editing /etc/inetd.conf
You can modify /etc/inetd.conf if you have special requirements, but it is properly configured when you receive it with the LAN product. Anytime inetd is started up, it reads the/etc/inetd.conf file. If you modify the /etc/inetd.conf entry for a service, use the inetd -c command to reconfigure inetd while it is still running. The /etc/inetd.conf file contains an entry for each ARPA server started by inetd on your host, with the exception of rcp, whose server is remshd. sendmail, named, and gated provide their own daemons, and their servers are not started by inetd.
Editing /usr/adm/inetd.sec
The /usr/adm/inetd.sec file is a security file used by the daemon inetd. The /usr/adm/inetd.sec file provides an extra security layer beyond any security check done by the services. It allows the node manager to determine how many remote services can run simultaneously on the local host and which hosts or networks are allowed to remotely use the local host. This check is done before the services security check. The inetd daemon reads the /usr/adm/inetd.sec file and checks the address of any host requesting a service. The inetd daemon only allows the requesting host to access a particular service if it is not forbidden by /usr/adm/inetd.sec.
94
Configuring TCP/IP
NOTE If inetd is running, it rereads /usr/adm/inetd.sec when you make changes to it. Your changes are applied to any services started up after the file is reread, but not to any services currently running.
where number is the maximum number of simultaneous remote services allowed. If MAXNUM is declared, it must be the first line of data in the file. MAXNUM default is 1000.
95
Creating /etc/ftpusers
The /etc/ftpusers file is a security file for ftpd. You must create this file if you want to use it. ftpd checks locally for this file before allowing a remote login to the local host. If the remote user specifies an account on the local host that is listed in /etc/ftpusers, the remote connection is denied.
Creating /etc/hosts.equiv
If you have already manually configured an /etc/hosts.equiv file with entries other than those of the form hostname or hostname username do not use SAM to configure /etc/hosts.equiv. SAM does not recognize, display or add entries of other forms (such as +, -, %, or +@example_nfsnetgroup). 1. Start SAM 2. Select the Networking/Communications menu item. 3. Select the Security menu item. 4. Select the Remote Login menu item. 5. Select the Add action. 6. Fill in the form according to its instructions. View the help screens for information about filling in the form. 7. Select apply to enter additional names of systems to be configured (use apply as a shortcut to remain in the add screen). Then, press OK when you are done with the screen. 8. Repeat steps 5 through 7 to allow or deny remote systems easy access (via rcp, remsh, or rlogin) to the local system. 9. Exit the Remote Login screen by selecting exit from the List menu. From the Security screen, select Exit SAM to exit from SAM.
96
Configuring TCP/IP
NOTE: The Required choice deletes all /etc/hosts.equiv file entries for the remote system you specify. Use this choice to remove unwanted entries. You may also modify the list of users that are currently allowed access without a password. Choose Select - Not Required and change the list of remote login names as desired.
NOTE: If you are the superuser, the Required choice deletes all $HOME/.rhosts file entries for the remote system you specify. Use this choice to remove unwanted entries.
7. Select apply to enter additional names of systems to be configured (use apply as a shortcut to remain in the add screen). Then, press OK when you are done with the screen. 8. Exit the Remote Login screen by selecting exit from the List menu. 9. From the Security screen, select Exit SAM to exit from SAM.
97
/bin/nodename /etc/rlbdaemon, the remote loop back daemon /etc/syslogd /etc/netnfsrc, the script that starts NFS /etc/inetd /etc/netbsdrc, the script that starts ARPA/BSD networking services /etc/netnfsrc2, which makes NFS mounts and starts automounter /etc/netnssrc, which starts NS services
9.3 Summary
TCP/IP is a standard product, but configuring it differs considerably in AIX and HP-UX. Like so many items in AIX, networking configuration by default is part of the ODM configuration database. Therefore changes to networking files such as /etc/inetd.conf and /etc/services require the inetimp command to update the ODM. It is easier, however, to use SMIT to configure TCP/IP because doing so insures that the ODM is brought up to date automatically. You do have the option in AIX to configure TCP/IP using the traditional commands ifconfig and route, and to make your changes permanent by either editing the /etc/rc.net file, in which case you retain SRC support, or editing /etc/rc.bsdnet, entailing no SRC support. HP-UX has a traditional means of configuring TCP/IP. However, using SAM can make the process a lot easier. HP-UX also has a /usr/adm/inetd.sec file, which AIX does not, that adds an extra layer of security for TCP/IP.
98
Name of the default domain Primary name server designation and names of named hosts data file and named reverse hosts data file. Name of the local file (e.g., named.local)
2. Edit the /etc/named.ca file to include the names and addresses of the root servers. 3. Edit the /etc/named.domain_namelocal file. Include the following:
Start of authority of the zone and the default time-to-live information. Name server (NS) record. Pointer (PTR) record.
Start of authority of the zone and the default time-to-live information for the zone Name-to-address resolution information on all hosts in the name servers zone of authority Name server records for all primary name servers in the zone
Start of authority of the zone and the default time to live information
99
Address to name resolution information on all hosts to be in the name servers zone of authority
If you choose BOTH, SMIT starts named and then edits /etc/rc.tcpip to get it to start up on each boot.
You may want to enter records to specify the name, domain, and address of the name server. 5. Enable the named daemon using the following SMIT fastpath:
# smit stnamed
100
You may want to enter records to specify the name, domain, and address of the name server. 5. Enable the named daemon using the following SMIT fastpath:
# smit stnamed
To create a new /etc/resolv.conf file, either choose the Start Using the Nameserver option, and then the Create a New /etc/resolv.conf File option, or you can type the following at the command line:
# smit stnamerslv2
See Setting Up a Remote Name Server in the HP-UX section for more information on /etc/resolv.conf.
101
10.2 HP-UX
named Data Files
Four types of standard data files specify the data for a domain: db.cache, db.127.0.0, db.[domain], and db.[net]. 1. The names and internet addresses of the root name servers: db.cache. 2. Address resolution information for local loopback: db.127.0.0 3. The names and internet addresses of name servers for the zone directly below it: db.[domain] 4. Reverse address resolution information: db.[net] Naming the domain data files db.[name] is a Hewlett-Packard convention.
Using hosts_to_named
hosts_to_named automatically converts host table entries to name server format and creates a primary boot file. It also creates the standard data files, db.cache, db.127.0.0, db.[domain], and db.[net]. However, it does not fill in the cache file, db.cache, with the root server names and addresses. You must do this manually. Once the host table has been translated, the name server files can be maintained directly, or the translation can be repeated after each change to the host table. To run hosts_to_named, you need to know the name of the domain and the network numbers of networks in the domain. The syntax of hosts_to_named is as follows:
# hosts_to_named -d domain -n network-number [options]
-d -n
specifies the domain for which data is to be created. specifies the network number for which data is to be created.
The following example creates name server data for networks 15.19.13 and 15.19.8 in the domain div.inc.com.
# hosts_to_named -d div.inc.com -n 15.19.13 -n 15.19.8
NOTE: For the name server to run, the boot file, named.boot, must be in the /etc directory. Because hosts_to_named places the files it creates in the directory you are in when you execute the command, you must do one of the following: 1. Use the -b option of hosts_to_named to specify the boot file as /etc/named.boot, or
102
2. Move named.boot to the /etc directory after running hosts_to_named elsewhere. Refer to the hosts_to_named man page for a complete description of this command and available options.
domain followed by the default domain name. The domain entry is needed only when the hostname (hostname) of the local system is not a domain name. nameserver followed by the Internet address (in dot notation) of a name server that the resolver should query. Up to three name servers may be listed here. search followed by up to six domains separated by spaces or tabs. The first domain in the search list must be the local domain. The domain and search keywords are mutually exclusive.
103
NOTE When the name server is unavailable, NIS or /etc/hosts is used for hostname and address resolution. However, certain remote server configurations may not detect that the remote name server host(s) is unavailable and thus will not use NIS or /etc/hosts for lookups. The following configurations may exhibit this behavior: 1. The remote server host is down. 2. More than one remote server is listed in /etc/resolv.conf and all the remote server hosts are unreachable.
2. Create /etc/resolv.conf and add a domain or search entry. For example, create an /etc/resolv.conf file that contains the following line:
domain div.inc.com
If you enter /etc/named without any arguments, it reads the default boot file /etc/named.boot, reads any initial data, and listens for queries. If the name server boot file is in the /etc directory, the /etc/netbsdsrc file will automatically start the name server at boot time. The procedure for starting other types of servers is the same as above. Refer to the named entry in the HP-UX Reference for information on additional options.
104
Instead, use:
indigo.div.inc.com fred
A utility is available to convert the hostnames in .rhosts and hosts.equiv to fully qualified domain names automatically. The shell script convert_rhosts, found in /etc/newconfig/bind, accepts input conforming to the syntax in hosts.equiv and converts it to fully qualified domain names. Instructions for using this utility are in the comments at the beginning of the script itself.
105
10.3 Summary
DNS is much the same on both AIX and HP-UX. The differences lie in the names and locations of named files:
AIX name and location /etc/resolv.conf /usr/sbin/named /usr/sbin/named-xfer /etc/named.boot /etc/named.ca /etc/named.local /etc/named.data /etc/named.rev HP-UX name and location /etc/resolv.conf /etc/named /etc/named-xfer /etc/named.boot /etc/named.data/db.cache /etc/named.data/db.127.0.0 /etc/named.data/db.[domain] /etc/named.db.[net]
106
NIS
11. NIS
11.1 AIX
NIS Maps and Commands
On AIX 3.2.5 /etc/yp is a link to /var/yp. In the latter on servers is the domainname subdirectory containing all the maps, and the following files:
Makefile Makefile.pre_ix26157 aliases.time binding group.time hosts.time netid.time passwd.time protocols.time publickey.time rpc.time services.time updaters
The make command uses the Makefile in this directory and can be used to create maps and to push them. Unlike HP-UX, there is no ypmake script. Makefile calls the makedbm command to build maps, create *.time files, and push the maps. The Makefile refers to various yp commands in the /usr/etc/yp directory, but actually, all the commands in that directory are links:
chmaster -> /usr/sbin/mkmaster chslave -> /usr/sbin/mkslave chypdom -> /usr/sbin/chypdomlsmaster -> /usr/sbin/lsmaster makedbm -> /usr/sbin/makedbm mkalias -> /usr/sbin/mkalias mkclient -> /usr/sbin/mkclient mkkeyserv -> /usr/sbin/mkkeyserv mkmaster -> /usr/sbin/mkmaster mknetid -> /usr/sbin/mknetid mkslave -> /usr/sbin/mkslave mrgpwd -> /usr/sbin/mrgpwd revnetgroup -> /usr/sbin/revnetgroup rmkeyserv -> /usr/sbin/rmkeyserv rmyp -> /usr/sbin/rmyp stdethers -> /usr/sbin/stdethers stdhosts -> /usr/sbin/stdhosts udpublickey -> /usr/sbin/udpublickey ypinit -> /usr/sbin/ypinit yppoll -> /usr/sbin/yppoll yppush -> /usr/sbin/yppush ypset -> /usr/sbin/ypset ypxfr -> /usr/sbin/ypxfr ypxfr_1perday -> /usr/sbin/ypxfr_1perday ypxfr_1perhour -> /usr/sbin/ypxfr_1perhour ypxfr_2perday -> /usr/sbin/ypxfr_2perday
107
2. Change $DIR/passwd to the pathname of the actual password file, such as /etc/passwd.nis:
DIR=/etc if [ -x /usr/etc/rpc.yppasswdd -a -f $DIR/passwd.nis ]; then startsrc -s yppasswdd fi
3. Then enter the following command before starting the yppasswdd daemon:
# chssys -s yppasswdd -a '/etc/passwd.nis -m passwd'
2. Start SMIT:
# smit mkmaster
108
NIS
Configure this Host as a NIS Master Server Type or select values in entry fields. Press Enter AFTER making all desired changes. HOSTS that will be slave servers Can existing MAPS for the domain be overwritten? EXIT on errors, when creating master server? START the yppasswdd daemon? START the ypupdated daemon? START the ypbind daemon? START the master server now, at system restart, or both? [Entry Fields] [] yes + yes + no + no + yes + both +
* * * * * *
4. In the HOSTS field, enter the names of your slave servers if you have any or going to have any. This is all thats required. If you want a more secure setup, you can choose yes to START the yppasswdd daemon and START the ypupdated daemon. See the man page for these daemons for more information. If you accept the default value of both for START the master server now, at system restart, or both, SMIT will call ypinit -m, start the appropriate daemons, and make changes to the /etc/rc.nfs file to make the changes permanent.
2. Start SMIT:
# smit mkslave
Enter the name of your master server. If the defaults are fine, press Enter. SMIT will run ypinit s and make sure the necessary changes are made to /etc/rc.nfs to make the changes permanent.
109
# smit chypdom
2. Start SMIT:
# smit mkclient
Managing yp Daemons
You can manage all the yp daemons using SMIT or on the command line using SRC commands. 1. To use SMIT type:
# smit ypstartstop
3. Follow the menu items to stop or start the appropriate daemons. Each selection above gives you the option of starting or stopping daemons immediately, at system restart, or both. You can start or stop yp daemons using SRC commands, either individually or as a group. To stop all yp daemons:
# stopsrc -g yp
110
NIS
Following is excerpts from /etc/rc.nfs. To manually configure yp in /etc/rc.nfs, edit the following stanzas with a text editor:
# Uncomment the following lines and change the domain # name to define your domain (domain must be defined # before starting NIS). if [ -x /usr/bin/domainname ]; then /usr/bin/domainname elmo fi ... if [ -x /usr/etc/ypserv -a -d /etc/yp/`domainname` ]; then startsrc -s ypserv fi if [ -x /usr/etc/ypbind ]; then startsrc -s ypbind fi if [ -x /usr/etc/keyserv ]; then startsrc -s keyserv fi if [ -x /usr/etc/rpc.ypupdated -a -d /etc/yp/`domainname` ]; then startsrc -s ypupdated ... #Uncomment the following lines to start up the NIS #yppasswd daemon. DIR=/etc if [ -x /usr/etc/rpc.yppasswdd -a -f $DIR/passwd ]; then startsrc -s yppasswdd fi
11.2 HP-UX
NIS Maps and Commands
On HP-UX 9.0x /etc/yp is a link to /usr/etc/yp. In the latter is the domainname subdirectory containing all the maps, and the following files:
Makefile longfiles makedbm mkalias revnetgroup stdhosts ypinit ypmake
111
The AIX/HP-UX Interoperability Guide yppoll yppush ypserv.log ypset ypxfr ypxfr.log ypxfr_1perday ypxfr_1perhour ypxfr_2perday
The file ypmake is a shell script that builds one or more maps on a master NIS server. If no arguments are specified, ypmake either creates maps if they do not already exist or rebuilds maps that are not current. yppush is then executed to notify slave NIS servers of the change and make the slave servers copy the updated maps to their machines. If any maps are supplied on the command line, ypmake creates or updates those maps only. The make command can be used instead of ypmake. The Makefile in /usr/etc/yp calls the ypmake script to actually construct the maps. Better performance is achieved if ypmake is called.
112
NIS
CHANGE: /usr/etc/rpc.yppasswdd /etc/passwd -m passwd PWFILE=/etc/passwd TO: /usr/etc/rpc.yppasswdd /etc/passwd.nis -m passwd\ PWFILE=/etc/passwd.nis
If in the future you need to run ypmake and you have restricted access to the master server as just described, enter the following line:
# /usr/etc/yp/ypmake passwd PWFILE=/etc/passwd.nis
If you want to make this node a master server of the domain name that you set in Step 1, enter:
# /usr/etc/yp/ypinit -m
If you want to make this node a master server of a different domain name than the one you set in Step 1, enter:
# /usr/etc/yp/ypinit -m DOM=XXX
XXX represents the domain name for which you are setting this node to be a master server. 3. The system asks whether you want the procedure to quit at the first non-fatal error. Do one of the following:
Respond no or n for ypinit to continue regardless of the errors. After the procedure finishes, correct all errors that occurred. Respond yes or y for ypinit to quit at the first error. Correct each error as it occurs. This procedure takes longer since you have to correct the errors one by one and run ypinit until no more errors occur.
4. The ypinit script prompts you for a list of hosts that will become servers.
113
# domainname nis_domain_name
2. Execute ypserv.
# /usr/etc/ypserv
3. Execute ypbind.
# /etc/ypbind
You will need to use this same NIS domain name for all clients and servers within this NIS domain. 3. Set NIS_MASTER_SERVER to a value other than zero. Changing this variable permits users to change their NIS password:
NIS_MASTER_SERVER=1
2. Execute ypinit with the -s parameter in one of two ways: If you want to make this node a slave server of the domain name that you set in Step 1, enter:
# /usr/etc/yp/ypinit -s master_server_name
If you want to make this node a slave server of a different domain name than the one you set in Step 1, enter:
# /usr/etc/yp/ypinit -s master_server_name [DOM=XXX ]
XXX represents the domain name for which you are setting this node to be a slave server.
114
NIS
3. The system asks whether you want the procedure to quit at the first non-fatal error. Do one of the following:
Respond no or n for ypinit to continue regardless of the errors. After the procedure finishes, correct all errors that occurred. Respond yes or y for ypinit to quit at the first error. Correct each error as it occurs. This procedure takes longer since you have to correct the errors one by one and run ypinit until no more errors occur.
4. Since the slave server is also a client, customize the files which traditionally implement the database.
2. Execute ypserv.
# /usr/etc/ypserv
3. Execute ypbind.
# /etc/ypbind -ypsetme
A zero in the NIS_CLIENT, NIS_MASTER_SERVER, or NIS_SLAVE_SERVER field disables the node from working as a client, master server, or slave server respectively.
2. Set NISDOMAIN to the same NIS domain name used on all clients and servers within this NIS domain.
NISDOMAIN=nis_domain_name
115
The AIX/HP-UX Interoperability Guide /etc/passwd /etc/group /etc/hosts /etc/protocols /etc/netgroup /etc/rpc /etc/networks /etc/services
2. Execute ypbind.
# /etc/ypbind -ypsetme
Note: A zero in the NIS_CLIENT field disables the node from working as an NIS client
11.3 Summary
There are many common features of NIS on each platform: the yp daemons have the same name and function, domains work the same, commands like ypwhich, ypset, and ypinit work the same. The differences lie in configuring NIS on each platform. AIX supplies a number of scripts that make configuring NIS relatively easy: mkmaster, mkslave, mkclient, chypdom. If you use SMIT to configure NIS, then you are actually providing parameters for these scripts. HP-UX does not have equivalent commands, but it does provide the ypmake script to make map propagation easier. You also use SRC commands in AIX to control the yp daemons. Each system has a different way of creating NIS maps: on AIX it involves editing /var/yp/Makefile while on HP-UX you have to change /usr/etc/yp/ypmake. Each of these scripts differs in its makeup. However, they ultimately call the makedbm command and produce maps that can be read across platforms. For example, if you have a map of user account names called /etc/auto.user, regardless of which platform the corresponding .dbm and .pag files are created on, they can be read by NIS utilities on any system, as long as that system is in the same domain.
116
NFS
12. NFS
12.1 AIX
Controlling NFS Daemons
You can stop and start most NFS daemons either by using SRC commands or by using SMIT, which ultimately calls SRC commands. The exceptions are rpc.rexd, rpc.ruserd, rpc.rwalld, and rpc.rsprayd, which are started by inetd. The following subsystems are part of the nfs group: nfsd, biod, rpc.lockd, rpc.statd, and rpc.mountd. To start the nfs group, type:
# startsrc -g nfs
This starts all of the daemons of the nfs group as well as the appropriate number of each. For nfsd and biod the default number of daemons is eight. To change these defaults, you must do one of the following: 1. Run the smit chnfs command. 2. Run the chnfs command, for example:
# chnfs -n4 -b4
The chnfs command stops currently running nfsds and biods, updates the ODM database to reflect the new defaults (in this case four daemons each), and then restarts the daemons using SRC commands. The chssys command changes the cmdargs descriptor in a subsystem definition, in this case the biod subsystem. Therefore anytime you run the following command:
# startsrc -s biod
the value of the -a parameter is used to determine the number of biods to start, in this case six. You can start any subsystem with the startsrc -s command or stop one with the stopsrc -s command. For example:
# startsrc -s rpc.lockd # stopsrc -s rpc.mountd
The file that controls the NFS (and NIS for that matter) daemons on startup is /etc/rc.nfs. To disable NFS upon bootup, either remove the line containing that file name from the /etc/inittab file or run the smit rmnfs command and select restart in the STOP NFS now, system restart or both field. To enable NFS upon bootup it is best to use the smit mknfs command because it is easy to make a syntax error trying to edit /etc/inittab by hand. Note that /etc/rc.nfs controls the startup of both NFS and NIS. If you want to disable NIS but not NFS you can comment out the appropriate lines in /etc/rc.nfs or run smit rmypserv or smit rmypclient. Do not remove the rcnfs line in /etc/inittab if you want only to disable NIS.
117
+ +
The required entries are PATHNAME of directory to export, MODE to export directory, and EXPORT directory now, system restart or both. Fill in these parameters and press Enter. SMIT will create or update the /etc/exports file and then run the exportfs -a command. The other parameters are optional and can be determined by consulting the exports man page. Run the smit chnfs command. To start the NFS daemons, 1. Run SMIT:
# smit mknfs
Pressing Enter at this point starts all the daemons of the nfs group and puts an entry in the /etc/inittab file to make the changes permanent.
118
NFS
The required entries are denoted by the asterisk (*), are fairly obvious, and have default values which you will in most cases prefer. However, a couple entries need some additional explanation. For MOUNT now, add entry to /etc/filesystems or both? the default value is now. If you accept the default, SMIT will make the mount, but the mount will be in effect only until system restart or
119
until you explicitly unmount the file system with the umount command. Selecting the value of both will not only result in the mount but also an entry in the /etc/filesystems file. As explained in the chapter on disks and file systems, /etc/filesystems is AIXs equivalent to HPUXs /etc/checklist file, which determines which file systems are mounted on bootup. Both files will mount networked file systems as well as local ones; the only difference is their format. If, for example, you mounted the file system /doc from the machine elmo and had an entry for that mount in /etc/filesystems, that entry would look something like:
/doc: dev vfs nodename mount options account = = = = = = "/doc" nfs elmo false bg,hard,intr false
This example also illustrates the other entry in the mknfsmnt screen which needs a little explanation: /etc/filesystems entry will mount the directory on system RESTART. The default value is no, which results in a mount=false line in /etc/filesystems, like in the one above. This means that the remote file system will not be mounted by default upon system restart. If the line reads mount=true, then the system will attempt to make the NFS mount upon system restart. If it cannot because the server is unavailable, then additional mount requests will occur in the background (options=bg denotes this). In some cases it is better to have the mount parameter be false. If, for example, you have several mounts from the same server and it is down, the boot process will not be bogged down by attempting to make remote mounts for each networked file system, in which case it might be better to have an /etc/rc.local file to complete the mounts once everything else is up and running. For additional information on the options available in making NFS mounts, see the mount, mknfsmnt, and filesystems man pages.
Configuring Automount
The basic configuration steps are listed below and detailed in the sections that follow. 1. Configure the nodes for NFS if they are not already configured. 2. Create the master map file. 3. Create the map files.
120
NFS
4. If you will be using NIS to administer the maps, integrate the maps with NIS. 5. Start automounter.
where:
DirectoryPath is the full pathname of the directory that triggers automount. AutomountMapName is the file that contains the map information.
Create Maps
Automount maps are usually named auto.xxx, where xxx is the name of the map. The name does not have to correspond to any mount points, but it is recommended that the map name correspond to the directory contents (for example, auto.man for man pages). As with all NIS maps, names must be 10 characters or less if you have file systems that do not allow file names longer than 14 characters. This is because NIS adds four-character suffixes (.dir and .pag) to the map name. The format of the map entries is:
key [-mount options] server:directory
where:
key is the name of the subdirectory under the mount directory. mount options can be any valid NFS mount options. This field is optional. Mount options specified here override any mount options specified in the master map. server:directory specifies the remote server name and the path of the remote file hierarchy (file system or directory) to mount.
Automount recognizes special characters in direct and indirect maps to be used for substitutions and to escape other characters. They are: & * can substitute key values into the directory path names is recognized as a catch all entry (a wildcard). It is the last or only entry in a map. It matches all keys and provides a value for the & substitutions that may
121
exist in the right-hand side of a map. For example: * -ro,intr server:/users/& + mapname The contents of another map can be included within the current map. If mapname is a directory with no slashes, automount interprets it as an NIS map. If the directory has slashes then automount looks for a local map with that name.
Start Automounter
The full pathname in AIX is /usr/sbin/automount. The options found in the automount man page are the same as those for the HP-UX version. You can also start automount by typing the smit mkautomnt command. If you want to start automount on bootup, the best place to put it is at the end of the /etc/rc.nfs file, something you will have to do manually since SMIT doesnt do it for you.
10
122
NFS
12.2 HP-UX
Using SAM to Configure an NFS Client
At the SAM Main window, highlight Networking/Communications and activate the OPEN button. 1. At the Networking/Communications window, highlight Networked File Systems (NFS) and activate the OPEN button. 2. Highlight Remote File Systems Mounted and activate the OPEN button. This edits your /etc/netnfsrc file. 3. To add remote directories to be mounted, choose Add from the Actions menu and then enter the information about the remote directory you want to mount to. Enter the Remote System Name. This is the system name where the directory or file you wish to access resides. Enter the Remote Directory Name. This is the name of the directory you wish to access. Enter the Local Directory Name. This is the local directory where you want the remote directory to be mounted. Choose when to mount. You have two mount options to choose from: Now and On Boot. If Now is chosen, the directory will be available when the information in this window has been accepted. If On Boot is chosen, the directory will be available when this system is booted. Choose Access Permissions. Write protection provides the type of access the user will have on the remote directory. There are two options to choose from: Read-Only,
123
meaning the user can only read the information in the directory and Read/Write, meaning the user can read and write to the directory. Set User ID execution. This indicates whether the user must have a user ID when trying to access the remote directory. Choosing Yes means a user ID is not required. Change Default Mount Options. This takes you into the NFS Mount Options window. You can change the following mount options: Choose one of the mount options. There are two choices: Hard mounted directories or files cause NFS to retry a request until the server responds. Soft mounted directories or files abort requests after one attempt. Read Buffer Size (rsize). This specifies the maximum read request size used in communicating with the server. Write Buffer Size (wsize). This specifies the maximum write request size used in communicating with the server. 4. When you are finished entering mount information, activate the OK button to perform the task and return to the Add Remote Directory window. 5. When you are finished entering the remote directory information, activate the OK button to add this remote directory information to your /etc/hosts file. 6. In the Remote File Systems Mounted window, you can enable the NFS client by choosing Enable NFS client from the Actions menu. You should see the remote directory information displayed in the window.
124
NFS
Select asynchronous writes. Yes means that asynchronous write will be done. No means no asynchronous writes will be done. Specify Permission for File Access. Selecting read only will cause the Read Only Access window to be displayed. The window enables you to add, modify or remove remote systems to have read-only access to your local directory. Selecting read/write will cause the Read/Write Access window to be displayed. This window enables you to add, modify or remove remote systems to have read/write access to your local directory.
4. In the Local File Systems Exported window, you can enable the NFS server by choosing Enable NFS server from the Actions menu. You should see the local directories and the directories access information displayed in the window.
Edit /etc/netnfsrc
The /etc/netnfsrc file activates the NFS daemons and servers. To define the node as an NFS server, set the NFS_SERVER variable to any digit other than zero. Set START_MOUNTD to
125
any digit other than 0. mountd can be started from netnfsrc on inetd. If mountd has an entry in inetd.conf the START_MOUNTD should be 0. If the node is also a client, you may want to set the NFS_CLIENT variable to any digit other than zero now. If the node is also a server for PCNFS requests, set the PCNFS_SERVER variable to any digit other than zero.
Client Only NFS_CLIENT=1 NFS_SERVER=0 Server Only NFS_CLIENT=0 NFS_SERVER=1 START_MOUNTD=1 Both Client and Server NFS_CLIENT=1 NFS_SERVER=1 START_MOUNTD=1 Neither Client nor Server NFS_CLIENT=0 NFS_SERVER=0 PC-NFS Server PCNFS_SERVER=1 START_MOUNTD=1
You can refer directly to the comments for editing instructions and for descriptions of each activity executed by /etc/netnfsrc:
#!/bin/sh ## Configured using SAM by root on Tue Jul 18 14:41:23 1995 ## @(#)netnfsrc: $Revision: 1.51.109.9 $ $Date: 92/08/18 13:48:27 $ # netnfsrc -NFS startup file ## # Depending on the configuration parameters you set within, # this script sets up some or all of the following: # NIS specific: # domainname -the NIS domain name # # and starts up some or all of the following programs: # portmap -RPC (program_#,version) -> port_# mapper # nfsd -NFS daemons # biod -async BIO daemons # pcnfsd -PC-NFS daemon # NIS specific: # ypbind -NIS client process (all NIS nodes) # ypserv -NIS server process (NIS server only) # yppasswdd -NIS password daemon (NIS master server only) ## # NFS_CLIENT -1 if this node is an NFS client, 0 if not # NFS_SERVER -1 if this node is an NFS server, 0 if not
126
NFS # Note: it is possible for one host to be a client, a server, both # NFS_SERVER -1 if this node is an NFS server, 0 if not # Note: it is possible for one host to be a client, a server, both # or neither! This system is an NFS client if you will be # NFS mounting remote file systems; this system is a server # if you will be exporting file systems to remote hosts. # See Also: nfsd(1M), mount(1M). ## NFS_CLIENT=1 NFS_SERVER=1 ## # START_MOUNTD -1 if this script should start rpc.mountd. # 0 if /etc/inetd.conf has an entry for mountd. # Note: rpc.mountd should be started from netnfsrc. However, it # can be started from either netnfsrc or inetd, and # MUST only be configured in one place. ## START_MOUNTD=1 ## . . . ## #PCNFS_SERVER # # ## PCNFS_SERVER=0 -1 if this node is a server for PC-NFS requests. This variable controls the startup of the pcnfsd(1M) server. See Also: pcnfsd(1M).
The inetd security facility works only when the inetd executes a server. For the RPC services that do not exit after each service request, inetd provides a security check only for the first request. Successive requests bypass the inetd and are subject only to the security checking performed by the individual RPC services. However, you can make the inetd perform a security check for every RPC request by doing both of the following steps: 1. Add the -e option to the /etc/inetd.conf entry for the RPC service. 2. Specify the RPC service in the first field of /usr/adm/inetd.sec. NOTE: Adding the -e option makes the RPC server respond slower since it has to restart for each request.
Example
The rpc.mountd program is the server for the mount command and reads /etc/exports to see what the available directories or files are and to whom they are exported. It also keeps a list of all
127
mounted directories or files. The -e option forces inetd to perform a security check for rpc.mountd on every request.
How many remote services can run simultaneously on the local host. Which hosts are allowed to remotely use the local host.
On the first line in /usr/adm/inetd.sec, enter the maximum number of simultaneous remote services to be started by inetd as shown in the following example:
MAXNUM number
Each entry in /usr/adm/inetd.sec has the following format (enter either allow or deny):
service_name allow/deny host_specifier(s)
Where: service_name Name of a valid service (include RPC services) with an entry in /etc/inetd.conf For RPC services, service_name is the name of the service that matches its program number in /etc/rpc. This entry must have a corresponding entry in /etc/inetd.conf which contains the -e option. Specify only one service per entry. If an entry in /usr/adm/inetd.conf specifies the service name and nothing else, inetd allows all hosts to attempt access. allow/deny The allow entry instructs inetd to approve the host or network for access to the specified service. The deny entry instructs inetd to disapprove the host or network for access to the specified service. host_specifier(s) Name of a host or a network listed in /etc/hosts or /etc/networks, or an internet address in the standard internet notation. You can specify more than one host or network by separating each host_specifier with a blank or tab.
128
NFS
You can use the asterisk (*) or dash (-) in any field of a network or host address. You cannot use aliases.
Reboot
After you finish the configuration procedure, execute /etc/netnfsrc or reboot the system to activate the daemons and servers. The rebooting process does not unmount any of the servers directories or files that were remotely mounted by other network nodes. However, these nodes will not be able to access any of the servers files until the server is operating again.
Automount
The basic configuration steps are listed below and detailed in the sections that follow. 1. Configure the nodes for NFS if they are not already configured. 2. Create the master map file. 3. Create the map files. 4. If you will be using NIS to administer the maps, integrate the maps with NIS. 5. Start automounter.
129
The format for direct map entries in the master map is:
/direct map [-mount options]
where:
mount directory is the absolute path of the mount directory for the indirect map. Automount manages this directory. The directory should not be an existing directory, if a local directory by the same name already exists, automount will cover it. /- indicates that the entry is for a direct map. indirect map or direct map is the file name or NIS map name of the indirect map or direct map. If the map name is prefaced with a plus (+), automount searches for an NIS map. This field can also be one of the following special maps: -hosts -password -null Indicates the hosts map. The name of the remote host is used as the subdirectory name under the mount directory. Indicates the password map Cancels a previous map for the indicated mount directory. For example, if you use this in a local master map, it cancels the entry in the NIS auto.master map.
mount options can be any NFS mount options. Mount options in the master map are overridden by mount options in the indirect/direct maps.
130
NFS
By convention, maps are usually created under /etc/autoconfig or /etc. If you use NIS to administer the maps, you should create the source files under the ypmake (1m) source directory; the default ypmake source directory is /etc.
Indirect Maps
Each indirect map has a mount directory associated with it that is controlled by automount. The mount directory contains symbolic links to the actual mount points under /tmp_mnt. The mount directory is specified on the automount command line or in the master map. The format of the indirect map entries is:
key [-mount options] server:directory
where:
key is the name of the subdirectory under the mount directory. mount options can be any valid NFS mount options. This field is optional. Mount options specified here override any mount options specified in the master map. server:directory specifies the remote server name and the path of the remote file hierarchy (file system or directory) to mount.
Automount recognizes special characters in direct and indirect maps to be used for substitutions and to escape other characters. They are: & * can substitute key values into the directory path names is recognized as a catch-all entry (a wildcard). It is the last or only entry in a map. It matches all keys and provides a value for the & substitutions that may exist in the right-hand side of a map. For example: * -ro,intr server:/users/& The contents of another map can be included within the current map. If mapname is a directory with no slashes, automount interprets it as an NIS map. If the directory has slashes then automount looks for a local map with that name.
+ mapname
Direct Maps
Direct maps can contain any number of unrelated mount points. No common mount directory is maintained. The format of the direct map entries is:
key [-mount options] server:directory
where:
key is the absolute path of the mount point. mount options can be any valid NFS mount options. This field is optional. Mount options specified here override any mount options specified in the master map. server:directory specifies the remote server name and the path of the remote file hierarchy (file system or directory) to mount.
131
The special characters listed above are also valid for direct maps.
In the block
for ARG in $*; do case "$ARG" in
add an entry for auto.master and auto.xxxx before the *) in the case statement as follows:
auto_master ) if [ `expr "$MAPS" : ".* auto.master.*"` -eq 0 ]; then MAPS="$MAPS auto.master" fi;; auto_xxxx ) if [ `expr "$MAPS" : ".* auto.xxxx.*"` -eq 0 ]; then MAPS="$MAPS auto.xxxx" fi;;
132
NFS
You should also modify /usr/etc/yp/ypinit on the master server. Add auto.master and auto.xxxx to the list of MASTER_MAPS.
Start Automounter
Automount is started by executing /usr/etc/automount at boot time. It is executed by default from the /etc/netnfsrc2 file. You can specify map information on the command line. Any map information you specify is read before information in the NIS map auto.master and takes precedence over the NIS map. See automount(1m) for specific command line options.
12.3 Summary
NFS, originally a Sun product, works mostly the same in both AIX and HP-UX. However, some of the details differ, as always. AIX controls NFS daemons through the System Resource Controller (SRC) while HP-UX allows for direct commands. Both operating systems system management tools (SMIT and SAM) support NFS configuration, which in most cases is the preferred way to go. Automatic NFS mounts on bootup are controlled by /etc/filesystems (AIX) and /etc/checklist (HP-UX). Though the format of each file differs, the principle in each is the same. Both systems support automount, though you have to configure it manually on each. The biggest difference in the automount area is its integration with NIS. Otherwise, NFS has the same look and feel across AIX and HP-UX platforms. Both platforms export file systems listed in /etc/exports via the exportfs command. Both systems have nfsds, biods, rpc.mountd, rpc.lockd, and rpc.statd. Since NFS uses the External Data Representation (XDR) protocol, there is no problem in data representation across the two systems.
133
13. Mail
13.1 AIX
AIX user agents are mail, mailx, and Mail, all of which are the same program since these are all hard links to the same executable. This program most closely resembles the mailx program found on HP-UX systems. Another user agent, mhmail, just composes, sends, and files messages. The default routing agent is the sendmail program, and the default delivery agents are /usr/bin/bellmail (for local users), Basic Networking Utilities (BNU, a version of UUCP), and SMTP (for TCP/IP).
To stop the sendmail daemon using the SRC type the following:
# stopsrc -s sendmail
Mail Aliases
AIX keeps mail aliases in /etc/aliases. In addition to aliases you provide, this file must contain an alias for each of the following:
135
/etc/aliasesDB/DB.dir /etc/aliasesDB/DB.pag
The sendmail queue processing interval, as in HP-UX, is set with the -q option to the sendmail command. To process the mail queue once:
# sendmail -q
To change the processing interval permanently, edit the following line in /etc/rc.tcpip to the value you desire:
qpi=30m
136
AIX supports the mailstats command. For this command to work the /etc/sendmail.st file must exist with permissions 660.
13.2 HP-UX
HP-UX user agents are mail, mailx, and elm. mail is the standard AT&T program, whereas mailx is HP-UXs version of BSDs /usr/ucb/mail. The default routing agent is the sendmail program, and the supported delivery agents are /bin/rmail (for local users), UUCP, HPs OpenMail, X.400, and SMTP. You have two ways to configure mail. You can: 1. Use SAM with the supplied sendmail configuration file, which provides basic connectivity appropriate for many installations. 2. Install and start it manually, as explained in the Manually Installing sendmail section of this chapter.
137
To install sendmail, you must do the following: 1. Install a sendmail configuration file as /usr/lib/sendmail.cf. 2. Make sendmail executable. 3. Create system-wide mail aliases. 4. Invoke the sendmail daemon.
sendmail is normally run setuid to root (mode 5555). The default configuration is believed to be safe. However, it is possible to misconfigure sendmail so that it inappropriately promotes the privilege of ordinary users. If sendmail does not run setuid to root, this risk is eliminated. Note that this causes sendmail to ignore the S mailer flag (not specified in the mailers defined in the default configuration file) and the values of the u and g configuration options, since it is unable to setuid to these users when executing mailers. sendmail can be run non-setuid (mode 1555) if the following changes to the default configuration are made: 1. The queue directory (by default /usr/spool/mqueue) must be writeable by all (mode 0777). 2. The alias database (by default /usr/lib/aliases.dir and /usr/lib/aliases.pag) must be writeable by all (mode 0666). If these files do not already exist, the superuser must first create them and then chmod them:
# /usr/lib/sendmail -bi # chmod 666 /usr/lib/aliases.dir /usr/lib/aliases.pag
Making these changes creates some security risk. Anyone will be able to delete mail from the mail queue. However, no one will be able to read other peoples mail in the mail queue.
138
The -bd mode initializes the sendmail daemon to receive mail from the network. The -q30m flag causes sendmail to process the mail queue every 30 minutes. Whenever your system is rebooted, if sendmail is executable, the /etc/netbsdsrc script does the following: 1. Starts the sendmail daemon to accept SMTP connections from the network and to process the mail queue every 30 minutes. 2. Logs the restart of the sendmail daemon in the mail log, usually /usr/spool/mqueue/syslog.
run by the superuser, kills a sendmail daemon started with -bd, whether or not it was started with the -q interval flag. It does not kill a sendmail daemon started only with -q interval. You must kill this type of daemon by finding its process ID and killing it explicitly. NOTE: Do not kill sendmail with kill -9. This may cause sendmail to corrupt the alias database. Use kill-15 instead. The sendmail frozen configuration file is /usr/lib/sendmail.fc. To freeze the configuration file, issue one of the following commands as superuser:
# /usr/lib/sendmail -bz # /etc/freeze
To use SAM to refreeze the configuration and kill and restart the sendmail daemon, do the following:
139
1. Start SAM. 2. Select the Networking/Communications menu item. 3. Select Services Enable/Disable. 4. Select the sendmail menu item. 5. Select the Restart action. 6. Fill in the form according to its instructions or answer the prompt in the window. View the help screens for information about filling in the form. 7. Exit the Services Enable/Disable screen to a previous level by selecting Exit from the List menu. Then, to exit the Networking/Communications screen, select either Previous Level to exit to a previous level or Exit SAM to exit from SAM. 8. Select apply to enter additional names of systems to be configured (use apply as a shortcut to remain in the add screen). Then, press OK when you are done with the screen.
140
Mail # server machine. Note that this is similar to what would occur if # the mail spool directory were remote-mounted from the mail server. # For this reason, this macro can be used to achieve the same effect # as remote-mounting the mail spool directory, but without the access # and locking problems that can sometimes occur with remotely mounted # filesystems. # #DLMailServerName # ###################################################################
If, for example, your mail hubs hostname was elmo, you would need to create a line that reads:
DLelmo
Mail sent to dylan@sadie, for example, would be directed to the machine elmo, even if elmo was an HP-UX box, provided of course that sadies /etc/sendmail.cf file contains the above line and that the user dylan was recognized on both systems. The user dylan would then have to either log on to sadie to get his messages, or the /usr/mail directory on sadie would have to be mounted on /var/spool/mail on elmo. NFS mounts of the respective mail spooling directories on both systems seem to have no problem with permissions as long as they are exported read-write with either root access granted to machines within the domain or with the anonymous userid set to 0. Remember that making the above change in /etc/sendmail.cf is not enough: you have to rebuild /etc/sendmail.cfDB and refresh the sendmail daemon.
141
To:
R$+ $:$1<@$S> add local domain
Assuming that the above sendmail.cf file belongs to the HP-UX machine called elmo, mail sent to dylan@elmo would be routed to dylan@sadie, an AIX machine. You can export /usr/mail from elmo for NFS mounting to /var/spool/mail on sadie. Again, the export must either grant root access or set the anonymous userid to 0.
13.4 Summary
AIX and HP-UX have similar mail agents in mail and mailx, respectively, but there the similarity ends. AIXs mailx is actually a hard link to mail. HP-UXs mail program is the old AT&T version and is not found in AIX. elm is packaged with HP-UX but not AIX. Each of the two systems sendmail files look and feel much the same, though their locations are different. Below lists the major files and their locations.
AIX /etc/sendmail /etc/sendmail.cf /etc/aliases /etc/aliasesDB/DB.dir /etc/aliasesDB/DB.pag /etc/sendmail.cfDB /var/spool/mail /var/spool/mqueue /usr/share/lib/Mail.rc /usr/sbin/mailq /usr/sbin/mailstats /etc/sendmail.st HP-UX /usr/lib/sendmail /usr/lib/sendmail.cf /usr/lib/aliases /usr/lib/aliases.dir /usr/lib/aliases.pag /usr/lib/sendmail.fc /usr/mail /usr/spool/mqueue /usr/lib/mailx/mailx.rc /usr/bin/mailq /usr/bin/mailstats /usr/lib/sendmail.st
142
X11
14. X11
14.1 AIX
AIXs version of the X Window system is called AIXwindows, a separately purchased product that includes the X Window System and Motif. It also includes a graphical user interface (GUI) called the AIXwindows Desktop. With AIX 3.2.5 you can get either AIXwindows Environment/6000 Version 1.2.4, which is based on X11R4, or Version 1.2.5, which provides support for X11R5 and binary compatibility for X11R4. The material in this chapter is based on the latter.
The command mwm is a link to /usr/lpp/X11/Motif1.1.4/bin/mwm. The following commands in /usr/lpp/X11/bin are actually links to files in the /usr/lpp/X11/Xamples directory:
aixwm appres atobm bitmap bmtoa demodr demomon
143
The AIX/HP-UX Interoperability Guide editres fsinfo fslsfonts fstobdf listres oclock pcfsnfdir pcftobdf showfont showrgb twm viewres xbiff xcalc xclipboard xconsole xcrtca xditview xdpr xdpyinfo xedit xfd xfontsel xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xman xmh xprop xrefresh xsccd xscope xset xstdcmap xwininfo xwud
The /usr/lpp/X11/Xamples directory contains binaries compiled by IBM but are not officially supported. You can build new versions of these binaries as well as other utilities and demos, such as xev, by running the imake and make utilities. Complete instructions on doing so are found in /usr/lpp/X11/Xamples/README. The location of the xinitrc and xserverrc files, as well as xmodmap key mappings are found in /usr/lpp/X11/defaults. The sample Xdefaults file is /usr/lpp/X11/defaults/Xdefaults.tmpl.
Starting X
The default configuration of AIX has an ASCII-type of display, called an hft, as the login terminal. You can start the X server at the shell prompt on an hft by typing xinit or startx. The older style
144
X11
of xinit was a script, but with X11R5 it is an executable that initializes the X server and starts a client, which by default is an aixterm. xinit looks for a startup file in the following order: 1. The command line 2. XINITRC variable 3. $HOME/.xinitrc 4. /usr/lib/X11/$LANG/xinitrc 5. /usr/lpp/X11/defaults/xinitrc startx is a script that sets the DISPLAY variable, starts the X server, and then starts clients. startx looks for a startup file in the following order: 1. The command line 2. XINITRC variable 3. The users .Xinit, .xinit, .Xinitrc, .xinitrc, or .xsession file If no startup file is found, startx starts the window manager specified by the command line or indicated by the appropriate configuration file, such as .mwmrc. If no such file exists or no window manager is specified on the command line, startx starts mwm by default. startx reads the resource file specified in the command line or, if not supplied, the resources from one of the following: .Xdefaults, .xdefaults, .Xresources, or .xresources.
Stopping X
You can stop the X server by selecting End Session from the Root Menu or by pressing the Ctrl+Alt+Backspace key combination.
aixterms
The default terminal emulator on AIX is an aixterm, which emulates a High Function Terminal (or hft, see Chapter 2 for more information on hfts). If you telnet, rlogin, or rsh to a machine that does not have aixterm terminal definitionsand HP-UX machines are among thoseyou can set the TERM variable to vt100, vt102, vt220, vt320, or xterm to use programs like vi properly, or you can add aixterm terminfo entries by doing the following: 1. On the HP-UX box, cd to /tmp. 2. ftp to the RS/6000. 3. While in ftp change directories to /usr/share/lib/terminfo. 4. Do a get on ibm.ti. 5. Quit ftp. 6. Back on the HP machine, type the following command:
# tic ibm.ti
This procedure will put aixterm terminfo entries into the HPs /usr/lib/terminfo/a directory.
145
For purposes of interoperability some people like using xterms in order to avoid procedures like the above. However, there are problems in doing so. For example, if you run the smitty command in an xterm instead of an aixterm you will not have all the normal function keys available to you. This is also true for the smit command run remotely via telnet, rlogin, or rsh. Instead, you have to use escape sequences for certain functions. Also, the tn3270 command works best in an aixterm.
Fonts
If you have X11R4 instead of R5 installed, you will find fonts in /usr/lpp/X11/lib/X11/fonts, and these fonts will be in bdf or snf format. For X11R5 the fonts are in /usr/lib/X11/fonts and are in pcf format. AIXwindows proprietary fonts are in the top level of this directory. If you want access to these fonts from an HP X server you can install them by: 1. Copying them into the HPs /usr/lib/X11/fonts/misc directory (or any directory, though this one makes sense). 2. Running the mkfontdir utility:
# cd /usr/lib/X11/fonts/misc; mkfontdir
Note: This works only if the fonts are in pcf format. Use utilities like snftobdf and bdftopcf to get older formats into pcf, then do the above.
To verify the font server type (assuming youre using the KornShell):
# export FONTSERVER=server_name:7500; fsinfo
or
# fsinfo -server server_name:7500
To list the font server fonts (assuming youre using the KornShell):
# export FONTSERVER=server_name:7500; fslsfonts
To get the font client to include the font server fonts in its font path:
# xset +fp tcp/server_name:7500
146
X11
xdm
If you want to use X Display Manager, you can configure the system with the xdmconf utility. This utility, along with all the other xmd-related files are found in /usr/lpp/X11/lib/X11/xdm. For compatibilitys sake there is a link from /usr/lib/X11/xdm to this directory. xdmconf will configure xdm to run at bootup via the SRC if TCP/IP is set up. The SRC command to start xdm is placed at the end of /etc/rc.tcpip. If TCP/IP is not set up for your machine, then xdm will be placed in /etc/inittab for startup by init. To remove xdm configuration, type the following:
# cd /usr/lib/X11/xdm ; ./xdmconf -d
The Desktop
The graphical user interface on AIXwindows is the Desktop. It is started by default in the xinitrc file by the xdt3 command. You can start the Desktop manually by entering this command in the background:
# xdt3 &
There are three forms the AIXwindows Desktop takes: the General Desktop (for newbies), the Power Desktop (for experienced users), and the Admin Desktop (for system administrators). You can go to any of these Desktops by choosing File->Load Desktop in the Desktop menu bar. Customizing of the Desktop can be accomplished using the Preference Editor, which is available by selecting Options and then Preferences in the Desktop menu bar. More detailed configuration of the Desktop is governed by rule files. These files determine things such as icon appearance, drop behavior, and menu behavior of the Desktop through a mechanism known as the Deskshell programming language. The system-level rule file is /usr/lpp/xdt3/$LANG/xdtsysinfo. The system-level resource file is /usr/lib/X11/app-defaults/Xdesktop3.
14.2 HP-UX
The X11 server for HP-UX 9.0x conforms to the X11R5 release of the X Window System from the X Consortium. Hewlett-Packard does not provide or support the entire core MIT distribution. Many of these programs or clients are sample implementations or perform tasks that are accomplished by other clients in Hewlett-Packards graphical user interface, Visual User Environment (VUE). The primary differences between the core MIT distribution and the HewlettPackard X11 release are listed below.
Terminal Emulation hpterm is the primary terminal emulator. xterm is also provided and supported.
Bitmap Editing
147
Font Display Handled by the terminal emulation option -fn override. xfd is supplied but not supported.
A number of unsupported core MIT clients and miscellaneous utilities are provided in /usr/contrib/bin. In addition, the entire core MIT distribution, compiled for Hewlett-Packard platforms, can be obtained from HPs users group INTERWORKS for a nominal fee. See the release notes for details. Many other utilities, window managers, games, toolkits, etc. are included as user-contributed software in the MIT distribution, or are available using anonymous ftp on the Internet. See your site administrator for details.
The include files for OSF/Motif and X11 are delivered for HP-UX 9.0x in subdirectories with names specific to their release:
/usr/include/Motif1.1 /usr/include/Motif1.2 /usr/include/X11R4 /usr/include/X11R5
Shared libraries are also delivered in subdirectories with names specific to their release:
/usr/lib/Motif1.1 /usr/lib/Motif1.2 /usr/lib/X11R4 /usr/lib/X11R5
The Motif and X libraries ship as shared libraries in HP-UX 9.0x run-time products. HP-UX developers products include archived libraries for X11R5 and Motif1.2. Applications that use shared libraries incorporate an absolute path to the location of the shared library. The libraries were relocated to subdirectories in /usr/lib so that applications can run on a system that uses either Motif 1.1 or Motif 1.2. The header files appear in release-specific subdirectories so that developers can use release-specific versions of Motif and X. All versions of HP-UX 9.0x contain this directory structure. Hewlett-Packard has selected a set of the X Consortium clients to support for the HP-UX release 9.0. Some clients that were supported in earlier releases are no longer supported. This is due to current and announced future level of X Consortium support for certain clients, as well as new functionality in R5. In addition, several new clients are not supported
148
X11
Six clients supported in 8.* releases are not supported for the 9.0 release. Five of these clients are supplied in the 9.0 release, but may not be supplied in the future. These clients are: bitmap Replaced by vueicon, the VUE icon editor. If you use the unsupported 9.0 version of bitmap, note that it is substantially different from the 8.* version. See the bitmap man page for complete information. This function was a sample implementation. You can use a terminal emulator and an editor to get the same functionality. The functionality of xcutsel is now contained in hpterm. You can display font graphics on any application by specifying -fn as a commandline option. You can display font metrics by using xlsfonts. The functionality of xrefresh is now handled by the window manager.
The sixth client, bdftosnf, is not supplied with 9.0 since it has been replaced by bdftopcf. The new clients not supported are columns, dr_vue, xdpyinfo, xprop, and vuefincalc. The executable files and man pages for all the unsupported clients are installed in /usr/contrib/bin/X11 and /usr/contrib/man, respectively. In order to use these clients, be sure that your PATH environment variable contains /usr/contrib/bin/X11. Use env to see the current setting of your environment variables. The online man page access utility man looks in /usr/contrib/man by default, so you dont need to modify the MANPATH environment variable.
Supported Clients
bdftopcf fs gwind gwindstopxload hpterm mkfontdir mwm resize rgb sb2xwd stconv stlicense stload stmkdirs stmkfont vueicon vuelogin X x11start xauth xclock xcmsdb xhos xinit
149
The AIX/HP-UX Interoperability Guide xinitcolormap xlsfonts xmodmap xpr xrdb xseethru Xserver xset xsetroot xterm xwcreate xwd xwd2sb xwdestroy xwininfo xwud
Unsupported Clients
bitmap columns dr_vue vuefincalc xclipboard xcutsel xdpyinfo xfd xprop xrefresh
Starting X
On HP systems, the X Window System is normally started via the Visual User Environment (VUE), which uses xdm (X Display Manager) technology rather than xinit to start X. When VUE is not used, the normal method of starting X is via the x11start script which is simply a wrapper around xinit providing environment and command line setup appropriate for HP systems. Specifically, x11start performs the following startup tasks:
PATH environment variable set-up appropriate for the X environment X server startup Selected client(s) startup from a specific client file General user resource loading from a specific resource file
The /usr/bin/x11start script The /usr/bin/X11/xinit program The default client script, /usr/lib/X11/sys.x11start The default resource file, /usr/lib/X11/sys.Xdefaults
150
X11
Customized client and resource files can be created by copying the default files to $HOME/.x11start and $HOME/.Xdefaults, respectively, and then customizing them. Customized files that exist (with the appropriate permissions) will be used by the x11start components in place of the default files. Client options pass from the x11start command line to all clients in the .x11start file that have a $@ parameter. The options replace the parameter. This method is most often used to specify a display other than the usual one on which to display the client. You can, however, use the command-line option to specify a non-default parameter, such as a different background color. The default .x11start file starts the following clients:
Server options are preceded with a double hyphen (--). If the option following the double hyphen begins with a slash (/) or a path and a slash, it starts a server other than the default server. If the option begins with a colon followed by a digit (:#), it specifies the display number (0 is the default display number). Additional options specified after the server or display refer to the specified server or display. See the XSERVER page in the reference section for more information on server options.
Examples
# x11start
This starts the default xinit server and executes the client script (either /usr/lib/X11/sys.x11start or $HOME/.x11start) without passing arguments to either.
# x11start -bg black -fn 24x36
This starts the default xinit server and executes the client script, passing it all of the arguments. If the default client script is used, -bg black -fn 24x36 is passed to both mwm and hpterm since both of their default command lines contain $@. If the default client script is used, the actual xinit command executed is xinit /usr/lib/X11/sys.x11start -bg black -fn 24x36.
# x11start -fg white -- :1
This starts the default server on display 1 and executes the client script with the arguments, -fg white. If the customized client script is used, the xinit command line is xinit $HOME/.x11start fg white -- :1.
# x11start -- Xhp -a2 -t 5
This starts the server, Xhp with the arguments, -a2 -t 5 and then executes the client script without any arguments. NOTE: Beginning with the next release of HP-UX, x11start and its components (xinit, sys.x11start, and sys.Xdefaults) will not be supported. Instead, startup will be via the program vuelogin, which is directly based on the X Consortiums startup mechanism, xdm. vuelogin is not tied to the VUE environment (and xdm is not) and can be used to start up a non-VUE standard X session without using xinit. The main difference between the xinit startup method and the xdm or vuelogin method is that the former starts the X server, whereas the latter operates with the X server pre-started automatically. This is consistent with X terminals.
151
Stopping X
After stopping all application programs, stop the window system by holding down the Ctrl and Left Shift keys, and then pressing the Reset (Pause-Break) key. This stops the display server, and with it the window system.
Fonts
A font server is shipped with Hewlett-Packards X11R5 distribution but, by default, is not automatically started. To start the font server, execute:
# /usr/bin/X11/fs -daemon
This starts a font server in its default configuration (see below for information on modifying font server configuration). Any X server started on the same system after the font server is started will automatically gain access to the fonts provided by that font server, including the licensed scalable Intellifont and Type 1 fonts in the /usr/lib/X11/fonts/ifo.st and /usr/lib/X11/fonts/type1.st directories. By default, a font server accepts connections from font clients (such as X servers) at TCP address 7000, and configures itself according to information in the file /usr/lib/X11/fs/config. Both of these defaults can be overridden with command-line options. See the fs(1) man page for more information. Once you have determined your font server configuration -- one font server per machine, a centralized font server, or whatever -- and determined which machines you wish to use as font hosts, you should configure these hosts to start a server whenever they boot. You can do this by adding the appropriate commands to the /etc/rc startup file. For example, add the following definition to the function definitions at the beginning of the file:
start_fontserver() { if [ -x /usr/bin/X11/fs ] then echo "starting fontserver" /usr/bin/X11/fs -daemon fi }
You also need to add start_fontserver to the appropriate list of startup actions in the Actions based on system type section. As defined above, whenever the host boots, a font server starts at the default TCP address of 7000 using the default configuration file /usr/lib/X11/fs/config. If the font server is to be run on the same machine as the X server and if the font server is started before the X server, the font server does not need to be added to the font path of the X server. However, if the font server is started after the X server is already running, or if a font server is running on a different machine than the X server, then the font server must be added to the font path of the X server as follows:
# xset +fp tcp/:7000
This adds the font server port to the front of the font path list searched by the X server. If you are adding a font server that is not running on the same machine as the X server, the xset command is extended to also specify the font server host:
152
Once the font server is running and has been added to the font path of an X server, the server must rehash its fonts. This is also done with the xset client via:
# xset fp rehash
hpterms
The hpterm client emulates a Term0 terminal. The syntax of the hpterm client is as follows:
# hpterm [-options] [&]
There are too many options to cover here. Refer to the hpterm man page for all the options available. Two different flavors of hpterm are available. The one built on X11R4 versions of Xlib, Xt, and Motif 1.1 is delivered by default. The version built on X11R5 versions of Xlib, Xt, and Motif 1.2 is delivered in /usr/bin/X11/hpterm.R5.sh.Z, which is a compressed shar file. To install this version, uncompress and unshar hpterm.R5.sh.Z. For more information on how to choose between the R4-based hpterm and the R5-based hpterm, see README.hpterm in hpterm.R5.sh.Z. When running block mode applications, it may be necessary for hpterm to identify itself to application programs as some terminal other than X-hpterm. Most applications understand the terminal id 2392A. Newer applications also understand the terminal id 700/92 while older applications may only understand the terminal id 2622A. To set the terminal identification string, use the -ti command line option, the termId resource, or the TermId class. To put hpterm terminfo entries on an RS/6000: 1. cd to /tmp 2. Type the following command to put the hpterm terminfo entry into an ASCII file:
# untic hpterm > hpterm.ti
This will put the appropriate terminfo entries in /usr/share/lib/terminfo/h on the RS/6000.
HP-VUE
The HP Visual User Environment (HP VUE) is a graphical user interface that is based on the X Window system. The X Window System can be run alone, or as part of HP VUE. HP VUE consists of six components, known as managers:
153
Validates user login Starts and later saves the users session The users workspace and window manager Application launcher, file, and directory browser Interactive application resource customizer On-line help and man page browser
vuelogin is the first interface the user sees. It provides services similar to in init, getty, and login on character terminals: prompting for login and password, authenticating the user, and running a users session. Specifically, vuelogin is responsible for:
Reading initial configuration files Starting the X server Displaying the login screen and validating the login and password supplied by the user Invoking the HP VUE session manager
A session in the VUE context is defined as the time between logging in and logging out, or the lifetime of the session manager. The session manager provides the ability to save and restore sessions. The following are characteristics of sessions stored and restored by the session manager:
Which applications are running What the application windows look like Other settings such as the X server, mouse behavior, audio volume, etc.
The system-wide HP VUE directories are: /usr/vue/bin /usr/vue/config /usr/vue/types /usr/vue/app-defaults /usr/vue/icons HP VUE executables Configuration files for the login, session, and workspace manager Built-in actions and file types Application defaults for HP VUE clients HP VUE system-wide icons
For each user the .vueprofile file contains environmental settings and takes the place of the standard .profile or .login files. The .vue subdirectory in $HOME contains other configuration files, applications, tools, and palettes.
154
X11
no equivalent to the .Xdefaults file. Instead, the RESOURCE_MANAGER property is used. Resources are loaded into the RESOURCE_MANAGER property by the session manager at the beginning of a session. The session manager stores resources at the end of a session. System-wide resources are stored in /usr/vue/config/sys.resources. Properties can be modified during a session using the style manager, the EditResources action, or the xrdb command.
X11 .profile (or .login) .Xdefaults .x11start .mwmrc VUE .vueprofile RESOURCE_MANAGER vuesession vuewmrc
The default display on which a client is displayed is obtained from the DISPLAY environment variable of the system on which the client starts. It sets the host, display number, and screen number to which the client directs its output. This is typically display 0, screen 0. Most clients have a -display option that lets you set the host, display number, and screen on which the client will display its output. The -display option has the syntax:
-display [host:display.screen]
where: host is the hostname of a valid system on the network. display is the number of the display on the system on which you want the output to appear. A display can include more than one screen. screen is the number of the screen where the output is to appear. The default is 0. For example, executing the command:
# hpterm -display rs_node:0.1 &
starts an hpterm process on the local system and displays the window on display 0, screen 1 of the rs_node system. The window has the default size, location, and color. Conversely, you can run the following command on an RS/6000:
155
If you need the capabilities of these terminal emulators on machines other than the ones they were designed for, this is the way to do it. However, the HP machine will not have the proprietary IBM fonts that will give the aixterm the same appearance it has when run locally on an RS/6000. The same is true for RS/6000s displaying hpterms. This fact does not hinder the functionality of these emulators, but if you prefer for each to look exactly the same whether running locally or remotely on another platform, you must do one of two things:
Make one machine from each platform a font server and put the font server in the font path of the client with the xset command. Details for font servers are described above. Install the appropriate fonts on the other machine. This is very easy to do with HP-UX 9.0x and AIX 3.2.5 because both have pcf-style fonts, which are very portable. A description of how to install fonts is described in Fonts in the AIX section above.
There are several ways to run programs on a remote host from a command line:
Use rlogin to log into the remote host. Use remsh (HP) or rsh (RS) to start a client remotely without formally logging in.
If the client produces output on a display, you must specify the display and screen on which you want the output to appear.
where: remote is the remote host name. client is the absolute path of the executable client file (remsh and rsh does not allow the PATH variable). local is the local host name.
156
X11
For example, the following command runs xload on remote host rs_node and directs output to the display of system hp_node.
# remsh rs_node -n /usr/bin/X11/xload -display hp_node:0.0 &
NOTE: To make these examples run flawlessly requires use of the xhost command and the appropriate .rhosts entries. For more information on executing remote commands without a password check the remsh man page on the HP and the rsh man page on the RS/6000.
5. At this point you will see an RS/6000 xdm session running on your HP. Login as you normally do. 6. To stop your session choose End Session from the Root Menu. 7. To stop your X server on the HP press the Ctrl+Left Shift+Pause key combination. You will return to your HP ASCII screen. Type exit to resume your HP VUE session. To convert an RS/6000 workstation into an X terminal running off an HP 9000 called hp_node: 1. Make sure VUE is running on your HP. 2. Login to your hft. If X starts up automatically, stop it by pressing Ctrl+Alt+Backspace. 3. Type the following command:
# X -query hp_node
4. At this point you will seen HP VUE appear on your RS/6000. Login as you normally do. 5. Logout as you normally do on an HP system. 6. To stop the X server, press Ctrl+Alt+Backspace.
157
Appendix A
Appendix A
Common Command Pathnames
AIX /etc/accton /etc/arp /etc/backup /etc/bootpd /etc/catman /etc/cron /etc/devnm /etc/dumpfs /etc/fingerd /etc/fsck /etc/fsdb /etc/ftpd /etc/fuser /etc/gated /etc/getty /etc/ifconfig /etc/inetd /etc/init /etc/link /etc/lsdev /etc/mkfs
HP-UX /usr/lib/acct/accton /etc/arp /etc/backup /etc/bootpd /etc/catman /etc/cron /etc/devnm /usr/bin/dumpfs /etc/fingerd /etc/fsck /etc/fsdb /etc/ftpd /etc/fuser /etc/gated /etc/getty /etc/ifconfig /etc/inetd /etc/init /etc/link /etc/lsdev /etc/mkfs
159
/etc/mklost+found /etc/mknod /etc/mount /etc/mvdir /etc/named /etc/named-xfer /etc/ncheck /etc/ping /etc/rc /etc/rdump /etc/reboot /etc/renice /etc/restore /etc/rexecd /etc/rlogind /etc/rmt /etc/route /etc/rrestore /etc/rwhod /etc/savecore /etc/shutdown /etc/swapon /etc/syslogd /etc/telinit /etc/telnetd /etc/tftpd
/etc/mklost+found /etc/mknod /etc/mount /etc/mvdir /etc/named /etc/named-xfer /etc/ncheck /etc/ping /etc/rc /etc/rdump /etc/reboot /bin/renice /etc/restore /etc/rexecd /etc/rlogind /etc/rmt /etc/route /etc/rrestore /etc/rwhod /etc/savecore /etc/shutdown /etc/swapon /etc/syslogd /etc/telinit /etc/telnetd /etc/tftpd
160
Appendix A
/etc/tsm /etc/umount /etc/unlink /etc/update /usr/bin/acctcom /usr/bin/at /usr/bin/awk /usr/bin/banner /usr/bin/basename /usr/bin/batch /usr/bin/bc /usr/bin/bdiff /usr/bin/bfs /usr/bin/c89 /usr/bin/cal /usr/bin/calendar /usr/bin/cancel /usr/bin/captoinfo /usr/bin/cat /usr/bin/cc /usr/bin/checknr /usr/bin/chfn /usr/bin/chgrp /usr/bin/chmod /usr/bin/chown /usr/bin/chroot
/usr/bin/tsm /etc/umount /etc/unlink /etc/update /usr/lib/acct/acctcom /usr/bin/at /usr/bin/awk /usr/bin/banner /bin/basename /usr/bin/batch /usr/bin/bc /usr/bin/bdiff /usr/bin/bfs /bin/c89 /usr/bin/cal /usr/bin/calendar /usr/bin/cancel /usr/bin/captoinfo /bin/cat /bin/cc /usr/bin/checknr /usr/bin/chfn /bin/chgrp /bin/chmod /bin/chown /etc/chroot
161
/usr/bin/chsh /usr/bin/cksum /usr/bin/clear /usr/bin/cmp /usr/bin/col /usr/bin/comm /usr/bin/compress /usr/bin/cp /usr/bin/cpio /usr/bin/crontab /usr/bin/csh /usr/bin/csplit /usr/bin/ct /usr/bin/cu /usr/bin/cut /usr/bin/date /usr/bin/dc /usr/bin/dd /usr/bin/deroff /usr/bin/df /usr/bin/diff /usr/bin/diff3 /usr/bin/diffmk /usr/bin/dircmp /usr/bin/dirname /usr/bin/disable
/usr/bin/chsh /bin/cksum /usr/bin/clear /bin/cmp /usr/bin/col /usr/bin/comm /usr/bin/compress /bin/cp /bin/cpio /usr/bin/crontab /bin/csh /usr/bin/csplit /usr/bin/ct /usr/bin/cu /usr/bin/cut /bin/date /usr/bin/dc /bin/dd /usr/bin/deroff /bin/df /bin/diff /usr/bin/diff3 /usr/bin/diffmk /usr/bin/dircmp /bin/dirname /usr/bin/disable
162
Appendix A
/usr/bin/diskusg /usr/bin/domainname /usr/bin/du /usr/bin/dump /usr/bin/e /usr/bin/echo /usr/bin/ed /usr/bin/edit /usr/bin/egrep /usr/bin/enable /usr/bin/env /usr/bin/ex /usr/bin/expand /usr/bin/expr /usr/bin/factor /usr/bin/fgrep /usr/bin/file /usr/bin/find /usr/bin/finger /usr/bin/fold /usr/bin/from /usr/bin/ftp /usr/bin/gencat /usr/bin/getconf /usr/bin/getopt /usr/bin/grep
/usr/lib/acct/diskusg /bin/domainname /bin/du /etc/dump /usr/bin/e /bin/echo /bin/ed /usr/bin/edit /bin/egrep /usr/bin/enable /bin/env /usr/bin/ex /usr/bin/expand /bin/expr /usr/bin/factor /bin/fgrep /usr/bin/file /bin/find /usr/bin/finger /usr/bin/fold /usr/bin/from /usr/bin/ftp /usr/bin/gencat /usr/bin/getconf /usr/bin/getopt /bin/grep
163
/usr/bin/groups /usr/bin/grpck /usr/bin/head /usr/bin/help /usr/bin/hostname /usr/bin/hp /usr/bin/hyphen /usr/bin/iconv /usr/bin/id /usr/bin/install /usr/bin/iostat /usr/bin/ipcrm /usr/bin/ipcs /usr/bin/join /usr/bin/kill /usr/bin/killall /usr/bin/ksh /usr/bin/last /usr/bin/lastcomm /usr/bin/leave /usr/bin/line /usr/bin/ln /usr/bin/locale /usr/bin/localedef /usr/bin/lock /usr/bin/logger
/usr/bin/groups /etc/grpck /usr/bin/head /usr/bin/help /bin/hostname /usr/bin/hp /usr/bin/hyphen /usr/bin/iconv /usr/bin/id /etc/install /usr/bin/iostat /bin/ipcrm /bin/ipcs /usr/bin/join /bin/kill /etc/killall /bin/ksh /etc/last /usr/bin/lastcomm /usr/bin/leave /bin/line /bin/ln /usr/bin/locale /usr/bin/localedef /usr/bin/lock /usr/bin/logger
164
Appendix A
/usr/bin/login /usr/bin/logname /usr/bin/look /usr/bin/lp /usr/bin/lpr /usr/bin/lpstat /usr/bin/ls /usr/bin/mailx /usr/bin/man /usr/bin/mesg /usr/bin/mkdir /usr/bin/mkfifo /usr/bin/mm /usr/bin/more /usr/bin/mt /usr/bin/mv /usr/bin/neqn /usr/bin/netstat /usr/bin/newform /usr/bin/newgrp /usr/bin/news /usr/bin/nice /usr/bin/nl /usr/bin/nroff /usr/bin/nslookup /usr/bin/od
/bin/login /usr/bin/logname /usr/local/bin/look /usr/bin/lp /usr/bin/lpr /usr/bin/lpstat /bin/ls /usr/bin/mailx /usr/bin/man /bin/mesg /bin/mkdir /bin/mkfifo /usr/bin/mm /usr/bin/more /bin/mt /bin/mv /usr/bin/neqn /usr/bin/netstat /usr/bin/newform /usr/bin/newgrp /usr/bin/news /bin/nice /usr/bin/nl /usr/bin/nroff /usr/bin/nslookup /bin/od
165
/usr/bin/on /usr/bin/pack /usr/bin/page /usr/bin/passwd /usr/bin/paste /usr/bin/pathchk /usr/bin/pax /usr/bin/pcat /usr/bin/pg /usr/bin/pr /usr/bin/printenv /usr/bin/printf /usr/bin/ps /usr/bin/ptx /usr/bin/pwd /usr/bin/rcp /usr/bin/red /usr/bin/reset /usr/bin/rev /usr/bin/rexec /usr/bin/rlogin /usr/bin/rm /usr/bin/rmail /usr/bin/rmdir /usr/bin/rpcgen /usr/bin/rpcinfo
/usr/bin/on /usr/bin/pack /usr/bin/page /bin/passwd /usr/bin/paste /usr/bin/pathchk /usr/bin/pax /usr/bin/pcat /usr/bin/pg /bin/pr /usr/bin/printenv /usr/bin/printf /bin/ps /usr/bin/ptx /bin/pwd /usr/bin/rcp /bin/red /usr/bin/reset /usr/bin/rev /usr/bin/rexec /usr/bin/rlogin /bin/rm /bin/rmail /bin/rmdir /usr/bin/rpcgen /usr/etc/rpcinfo
166
Appendix A
/usr/bin/rsh /usr/bin/rup /usr/bin/ruptime /usr/bin/rusers /usr/bin/rwho /usr/bin/script /usr/bin/sdiff /usr/bin/sed /usr/bin/sh /usr/bin/showmount /usr/bin/sleep /usr/bin/soelim /usr/bin/sort /usr/bin/spell /usr/bin/split /usr/bin/stty /usr/bin/su /usr/bin/sum /usr/bin/sync /usr/bin/tabs /usr/bin/tail /usr/bin/talk /usr/bin/tar /usr/bin/tbl /usr/bin/tee /usr/bin/telnet
/bin/rsh /usr/bin/rup /usr/bin/ruptime /usr/bin/rusers /usr/bin/rwho /usr/bin/script /usr/bin/sdiff /bin/sed /bin/sh /usr/etc/showmount /bin/sleep /usr/bin/soelim /bin/sort /usr/bin/spell /usr/bin/split /bin/stty /bin/su /bin/sum /bin/sync /usr/bin/tabs /bin/tail /usr/bin/talk /bin/tar /usr/bin/tbl /bin/tee /usr/bin/telnet
167
/usr/bin/test /usr/bin/tftp /usr/bin/tic /usr/bin/timex /usr/bin/touch /usr/bin/tput /usr/bin/tr /usr/bin/tset /usr/bin/tty /usr/bin/ul /usr/bin/uname /usr/bin/uncompress /usr/bin/unexpand /usr/bin/uniq /usr/bin/units /usr/bin/unpack /usr/bin/uptime /usr/bin/users /usr/bin/uucp /usr/bin/uudecode /usr/bin/uuencode /usr/bin/uulog /usr/bin/uuname /usr/bin/uusnap /usr/bin/uustat /usr/bin/uuto
/bin/test /usr/bin/tftp /usr/bin/tic /usr/bin/timex /bin/touch /usr/bin/tput /usr/bin/tr /usr/bin/tset /bin/tty /usr/bin/ul /bin/uname /usr/bin/uncompress /usr/bin/unexpand /usr/bin/uniq /usr/bin/units /usr/bin/unpack /usr/bin/uptime /usr/bin/users /usr/bin/uucp /usr/bin/uudecode /usr/bin/uuencode /usr/bin/uulog /usr/bin/uuname /usr/bin/uusnap /usr/bin/uustat /usr/bin/uuto
168
Appendix A
/usr/bin/uux /usr/bin/vacation /usr/bin/vedit /usr/bin/vi /usr/bin/view /usr/bin/vmstat /usr/bin/w /usr/bin/wall /usr/bin/wc /usr/bin/what /usr/bin/whereis /usr/bin/which /usr/bin/who /usr/bin/whoami /usr/bin/write /usr/bin/xargs /usr/bin/yes /usr/bin/ypcat /usr/bin/ypmatch /usr/bin/yppasswd /usr/bin/ypwhich /usr/bin/zcat /usr/sbin/automount /usr/sbin/biod /usr/sbin/edquota /usr/sbin/exportfs
/usr/bin/uux /usr/bin/vacation /usr/bin/vedit /usr/bin/vi /usr/bin/view /usr/bin/vmstat /usr/bin/w /etc/wall /bin/wc /usr/bin/what /usr/bin/whereis /usr/bin/which /bin/who /usr/bin/whoami /bin/write /usr/bin/xargs /usr/bin/yes /usr/bin/ypcat /usr/bin/ypmatch /usr/bin/yppasswd /usr/bin/ypwhich /usr/bin/zcat /usr/etc/automount /etc/biod /etc/edquota /usr/etc/exportfs
169
/usr/sbin/mailq /usr/sbin/mailstats /usr/sbin/mkboot /usr/sbin/newaliases /usr/sbin/nfsd /usr/sbin/nfsstat /usr/sbin/portmap /usr/sbin/quot /usr/sbin/quota /usr/sbin/quotacheck /usr/sbin/quotaoff /usr/sbin/quotaon /usr/sbin/repquota /usr/sbin/rpc.lockd /usr/sbin/rpc.mountd /usr/sbin/rpc.rexd /usr/sbin/rpc.rstatd /usr/sbin/rpc.statd /usr/sbin/rwall /usr/sbin/sendmail /usr/sbin/snmpd /usr/sbin/spray
/usr/bin/mailq /usr/bin/mailstats /etc/mkboot /usr/bin/newaliases /etc/nfsd /usr/etc/nfsstat /etc/portmap /etc/quot /usr/bin/quota /etc/quotacheck /etc/quotaoff /etc/quotaon /etc/repquota /usr/etc/rpc.lockd /usr/etc/rpc.mountd /usr/etc/rpc.rexd /usr/etc/rpc.rstatd /usr/etc/rpc.statd /usr/etc/rwall /usr/lib/sendmail /etc/snmpd /usr/etc/spray
170
Appendix B
Appendix B
Creating AIX Boot Diskettes
First you need four AIX-formatted 1.44 MB diskettes. Formatting diskettes in AIX is easy; just insert the floppy into the drive and type:
# format
This formats the floppy in about two minutes. 1. Label a diskette Boot, place in the drive, and type:
# bosboot -d /dev/fd0 -a
171
Appendix C
Appendix C
A Quick Comparison of SMIT and SAM
SMIT and SAM perform many of the same functions, but there are differences. The following provides a quick comparison of the two programs.
Task Install software Add/remove disks, tape drives, cdroms Manage ttys User and group management Change passwords Diskless workstation management11 Manage file systems Manage swap/paging space Disk space recovery Kernel configuration Sendmail start and stop NCS management bootp management UUCP management Remote administration13 Setting up a trusted system NIC configuration
11
SMIT Yes Yes Yes Yes Yes Yes Yes Yes No No12 No No Yes No No No Yes
SAM No, done through update command Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
AIX 3.2.5 and HP-UX 9.0x approaches to diskless workstations differ but configuration can be done through the respective system administration tools. SMIT does not offer this because the ODM precludes kernel configuration in AIX. IBM provides a remote administration tool called Distributed System Management Interface Tool (DSMIT) that can be used to administer both AIX and non-AIX machines. This product is a separate purchase.
12 13
173
Yes Yes
Yes Yes, but only for default gateway No Yes Yes Yes No No No No No No Yes No Yes Yes No Yes No No Yes Yes
Edit /etc/resolv.conf Edit /etc/services Edit /etc/hosts.equiv Edit /etc/ftpusers Manage syslogd Manage routed Manage gated Manage named Manage rwhod Manage timed Configure NFS Configure NIS Printer management Manage print requests Hardware diagnostics Process management Performance monitoring Schedule at jobs Schedule cron jobs Backup and restore operations
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes
174
Appendix D
Alternate HP Boot Console User Interface
This describes the Boot Console User Interface for models 712, 715/64, 715/80, 715/100, and 725/100.
This causes your workstation to search for bootable media. It searches all types of I/O devices in the following order: 1. Built-in SCSI 2. Built-in LAN
This causes the ISL to be loaded from the SCSI device at address 6 (usually your internal hard drive). Once you get to the ISL prompt you can boot to single-user mode with the following (assuming you want to boot from the device at address 6):
ISL>hpux -is boot disk(scsi.6;0)/hp-ux
.
.mwmrc, 145, 155 .profile, 9, 10, 11, 50, 154, 155
.rhosts, 57, 59, 97, 104, 105, 157 .vueprofile, 11, 154, 155 .Xdefaults, 145, 150, 151, 155
175
/
/etc/autoconfig, 131 /etc/bcheckrc, 5 /etc/checklist, 23, 24, 120, 133 /etc/diskinfo, 23 /etc/disktab, 21, 22, 23, 24 /etc/dumpdates, 49 /etc/exports, 118, 120, 124, 125, 127, 129, 133 /etc/filesystems, 18, 24, 119, 120, 133 /etc/freeze, 139 /etc/ftpusers, 91, 96 /etc/hosts, 89, 93, 94, 101, 104, 105, 116, 124, 128 /etc/hosts.equiv, 83, 90, 96, 97, 104 /etc/hosts.lpd, 66, 83 /etc/inetd, 98, 127, 159 /etc/inetd.conf, 44, 89, 90, 94, 98, 125, 127, 128 /etc/init, 3, 6 /etc/inittab, 3, 6, 8, 10, 42, 66, 117, 118, 147 /etc/master, 33, 34, 37 /etc/netbsdrc, 98 /etc/netbsdsrc, 104, 139 /etc/netgroup, 112, 116, 125, 129 /etc/netlinkrc, 93, 94, 97 /etc/netnfsrc, 98, 112, 114, 115, 116, 123, 125, 126, 129, 133 /etc/objrepos, 25 /etc/passwd, 9, 108, 112, 113, 116 /etc/pre_init_rc, 5 /etc/profile, 10, 11, 50 /etc/qconfig, 61, 62, 64, 65, 68, 83 /etc/rc.boot, 3 /etc/rc.bsdnet, 92, 98 /etc/rc.net, 92, 98 /etc/rc.nfs, 108, 109, 110, 111, 117, 122 /etc/rc.tcpip, 100, 135, 136, 147 /etc/resolv.conf, 88, 89, 100, 101, 103, 104, 106 /etc/security/passwd, 9 /etc/services, 90, 98, 116 /etc/shutdown.allow, 7, 8 /etc/shutdown.d, 7, 8 /etc/syslog.conf, 137, 140 /etc/syslogd, 98 /hp-ux, 5, 6, 37 /usr/adm/inetd.sec, 94, 95, 98, 104, 125, 127, 128 /usr/lpd/attlong, 83 /usr/lpd/attshort, 83 /usr/lpd/rembak, 66
File systems, 1519 Logical Volume Manager, 1415 Login process, 910 Logout process, 10 Mail, 13537 NFS, 11723 NIS, 10711 Object Data Manager, 2527 Printing, 6169 Processes, 4145 Shutdown, 45 System Resource Controller, 4244 TCP/IP, 8593 X11, 14347 aixterm, 9, 145, 146, 156
B
Backups AIX, 4953 HP-UX, 5356 bdf, 24 bdftopcf, 143, 146, 149 bdftosnf, 149 Boot Console User Interface, 6 Boot process AIX, 34 HP-UX, 57
C
cancel, 82 cfgmgr, 27, 28, 2728, 30, 31, 37, 85 chdev, 27, 52, 58, 59 chnfs, 117 chssys, 117 convert_rhosts, 105 cpio, 49, 55, 56, 57, 59, 162 crfs, 17 crontab, 45, 46
D
dd, 30, 49, 52, 55, 56, 57, 58, 59, 162 Devices AIX, 2531 HP-UX, 3137 df, 24, 162 Directory structure AIX, 13 HP-UX, 14 disable, 81 Domain Name Service AIX, 99101 HP-UX, 1025 domainname, 107, 111, 113, 114, 115, 116, 163 dump, 49, 53, 56, 58, 159, 160, 163
A
accept, 78, 79, 81 AIX, 2 Backups, 4953 Boot process, 34 Devices, 2531 Directory structure, 13 Domain Name Service, 99101
176
E
elm, 137 enable, 78, 79, 80, 81 enq, 61, 62, 65, 69 exportfs, 118 extendvg, 16
L
Logical Volume Manager, 3, 1415, 19, 24, 55 login, 9, 10, 11 Login process AIX, 910 HP-UX, 11 logout, 10 Logout process AIX, 10 HP-UX, 11 lp AIX, 61, 62, 65, 69 lpadmin, 78, 79, 80 lpd, 43, 65, 66 lpr, 61, 62, 65, 69, 165 lpsched, 72, 78, 79, 80, 82 lpshut, 78, 79, 82 lpstat, 62, 66, 68, 69, 70, 78, 80, 82, 165 lsattr, 27 lsdev, 26, 27, 28, 30, 31, 32, 34, 159 lspv, 16 lssrc, 43, 44 lsvg, 16 LVM. See Logical Volume Manager
F
File systems AIX, 1519 HP-UX, 1924 frecover, 53, 56 fs, 146, 152 fsck, 5, 24 fsinfo, 146 fslsfonts, 146
G
getty, 9, 10, 11, 154, 159
H
hft, 9, 10, 144, 145, 157 hosts_to_named, 102, 103 HP VUE, 7, 8, 10, 11, 153, 154, 157 hpterm, 147, 149, 151, 153, 155, 156 HP-UX Backups, 5356 Boot process, 57 Description, 1 Devices, 3137 Directory structure, 14 Domain Name Service, 1025 File systems, 1924 Login process, 11 Logout process, 11 Mail, 13740 NFS, 12333 NIS, 11116 Printing, 6983 Processes, 4546 Shutdown, 7 TCP/IP, 9398 X11, 14755
M
mail, 135, 137 AIX, 13537 HP-UX, 13740 mailx, 135, 137 make, 122 AIX, 107 mediainit, 20, 21 mkdev, 27, 30 mkfontdir, 143, 146, 149 mklv, 16 mknod, 21, 31, 34, 37, 160 mkvg, 16 mkvirprt, 63, 67 mount, 18, 23, 49, 120, 127, 160 mt, 52, 56, 59, 165 mwm, 143, 145, 151
I
ifconfig, 85, 92, 93, 97, 98, 159 inetimp, 90, 98 init, 3, 6, 7, 10, 11, 42, 154 ioscan, 35
N
named, 91, 94, 99, 100, 101, 102, 104, 106, 160 newaliases, 136, 139, 170 newfs, 20, 21, 22, 23 NFS AIX, 11723 HP-UX, 12333 nice, 41 HP-UX, 45 NIS AIX, 10711
K
kill, 41, 42, 45, 46, 47, 105, 113, 123, 133, 135, 139, 164
177
HP-UX, 11116
O
Object Data Manager, 2, 3, 2527, 85, 87, 89, 90, 92, 98, 117 ODM. See Object Data Manager odmget, 26, 27, 42 odmshow, 25
P
pax, 49, 56, 58, 59, 166 Printing AIX, 6169 HP-UX, 6983 Processes AIX, 4145 HP-UX, 4546 ps, 41, 45, 46, 166
Q
qchk, 62, 69 qprt, 61, 62, 65, 69
R
rcp, 94, 96 rdump, 56, 160 refresh, 42, 44, 46, 92, 135, 137, 141 reject, 81 remsh, 96, 156 remshd, 94 renice, 41 rlogin, 96 rlpdaemon, 73 rmdev, 27, 31 rootvg, 3, 16, 52 route, 93, 94, 97 rsh, 146, 157
fshrttbl, 87 ftpusers, 91 hostent, 89 hostname, 86 hostsequiv, 90 inet, 88 inetdconf, 89 inetserv, 90 mkautomnt, 122 mkclient, 110 mklv, 16 mkmaster, 108 mknfs, 117, 118 mknfsexp, 118 mknfsmnt, 119 mkroute, 86 mkslave, 109 mksysb, 51 mktcpip, 85 mkvg, 16 otherserv, 91 pdp, 62 resolv.conf, 88, 101 rmnfsexp, 120 rmnfsmnt, 120 rmroute, 87 rmypclient, 117 rq, 66 server, 65 setbootup_option, 92 stnamed, 100 stnamerslv2, 101 ypstartstop, 110 SRC. See System Resource Controller srcmstr, 42 Standalone boot HP-UX, 6 startsrc, 44, 46, 108, 110, 111, 117, 135 startx, 9, 11, 143, 144, 145 stopsrc, 44, 110, 111, 117, 135 swapon, 21, 23, 24, 160 System Resource Controller, 2, 4244, 92, 98, 110, 116, 117, 133, 135, 147
S
sendmail, 94, 135, 136, 137, 138, 139, 140, 141, 142, 155, 170 Shutdown AIX, 45 HP-UX, 7 sig_named, 105 SMIT fastpaths chinet, 87 chnfs, 117 chnfsexp, 120 chypdom, 108 crfs, 17 device, 28 disk, 15 extendvg, 16
T
tar, 37, 49, 56, 57, 58, 59, 167 tcio, 55, 56, 59 TCP/IP AIX, 8593 HP-UX, 9398 tctl, 52, 56, 59 telnet, 10, 42, 57, 145, 146, 160, 167 terminfo, 145, 153 tic, 145, 153 tn3270, 146 top, 46
178
U
umount, 49, 120, 161 untic, 153
V
varyonvg, 16 vuefile, 154 vuegreet, 11 vuehelp, 154 vuelogin, 10, 11, 147, 149, 151, 154 vuesession, 154 vuestyle, 154 vuewm, 154
HP-UX, 14755 x11start, 150, 151 xdm, 10, 11, 143, 147, 150, 151, 157 xdmconf, 147 xdt3, 147 xhost, 143, 155, 157 xinit, 9, 10, 11, 143, 144, 145, 149, 150, 151 xinitrc, 9, 144, 145, 147 xload, 156 xmodmap, 144 xset, 146, 152 xterm, 146
Y
ypbind, 108, 109, 110, 111, 114, 115, 116 ypinit, 107, 109, 111, 112, 113, 114, 115, 133 ypmake, 107, 111, 112, 113, 116, 131, 132 ypserv, 108, 110, 111, 112, 114, 115, 117 ypupdated, 108, 109, 110, 111
X
X11 AIX, 14347
179