185
The AIX/HP-UX Interoperability Guide iii 1. INTRODUCTION..............................................................................................1 1.1 Purpose and Scope ........................ .............. ............ ............. .............. ........................... ............ ....1 1.2 HP-UX vs. AIX .............................................................................. ............ ........................... ........1 2. SYSTEM STARTUP AND SHUTDOWN.................................... ......................3 2.1 Introducti on ......................... .............. ........................... ............ ........................... ............ .............3 2.2 AIX................................................................................................................................................3 Boot Process and Startup ...................................................................................................................3 System Shutdo wn ..............................................................................................................................4 2.3 HP-UX...........................................................................................................................................5 Boot Process and System Startup ......................................................................................................5 System Shutdo wn ..............................................................................................................................7 2.4 Startup and Shutdown Summa ry ............ ............. .............. ............ ............... ............ ............ .......7 3. USER LOGIN AND LOGOUT ..........................................................................9 3.1 Introducti on ......................... .............. ........................... ............ ........................... ............ .............9 3.2 AIX................................................................................................................................................9 Login Process ....................................................................................................................................9 Logout.............................................................................................................................................10 3.3 HP-UX.........................................................................................................................................10 Login Process .................................................................................................................................. 10 Logout.............................................................................................................................................11 3.4 Summary.....................................................................................................................................11 4. DISKS AND FILE SYSTE MS .........................................................................13 4.1 Directory Structure ........... ........................... ............ .................................................................. 13 4.2 AIX..............................................................................................................................................14 Logical Volume Manager ....................................................................................................... .........14 AIX Disk Installation and File System Creation...............................................................................15 AIX Disk and File System Summary ...............................................................................................18 4.3 HP-UX.........................................................................................................................................19 Disk Installation and File System Creation ......................................................................................19 HP-UX Disk and File System Summary...........................................................................................24 4.4 Disks and File Systems: AIX vs. HP-UX ........... ............ .............. ............. ............ .............. .......24

aix_hpux

Embed Size (px)

Citation preview

Page 1: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 1/185

The AIX/HP-UX Interoperability Guide

iii

1. INTRODUCTION..............................................................................................1

1.1 Purpose and Scope........... ............. .............. ............ ............. .............. ............ ............... ............ ....1

1.2 HP-UX vs. AIX ............ ............ .............. ............. ............ ............... ............ .............. ............. ........1

2. SYSTEM STARTUP AND SHUTDOWN..........................................................3

2.1 Introduction ............ ............. .............. ............ ............... ............ ............ ............... ............ .............3

2.2 AIX................................................................................................................................................3Boot Process and Startup ............. ............ .............. ............. .............. ............ ............. .............. ..........3System Shutdown ............. ............ .............. ............. .............. ............ ............. .............. ............ .........4

2.3 HP-UX...........................................................................................................................................5Boot Process and System Startup ............. ............ .............. ............ ............ .............. ............. ............5

System Shutdown ............. ............ .............. ............. .............. ............ ............. .............. ............ .........7

2.4 Startup and Shutdown Summary ............ ............. .............. ............ ............... ............ ............ .......7

3. USER LOGIN AND LOGOUT..........................................................................9

3.1 Introduction ............ ............. .............. ............ ............... ............ ............ ............... ............ .............9

3.2 AIX................................................................................................................................................9Login Process ............ ............. .............. ............ .............. ............. ............ ............... ............ ............. ..9

Logout.............................................................................................................................................10

3.3 HP-UX.........................................................................................................................................10Login Process ............ ............. .............. ............ .............. ............. ............ ............... ............ .............10Logout.............................................................................................................................................11

3.4 Summary.....................................................................................................................................11

4. DISKS AND FILE SYSTEMS.........................................................................13

4.1 Directory Structure ........... ............. .............. ............ ............. .............. ............. .............. ............13

4.2 AIX..............................................................................................................................................14Logical Volume Manager ............ ............ .............. ............ ............ .............. ............. .............. .........14AIX Disk Installation and File System Creation...............................................................................15

AIX Disk and File System Summary ............ ............. .............. ............ ............... ............ ............ .....18

4.3 HP-UX.........................................................................................................................................19Disk Installation and File System Creation ............ ............. .............. ............ .............. ............. ........19

HP-UX Disk and File System Summary...........................................................................................24

4.4 Disks and File Systems: AIX vs. HP-UX........... ............ .............. ............. ............ .............. .......24

Page 2: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 2/185

The AIX/HP-UX Interoperability Guide

iv

5. DEVICES........................................................................................................25

5.1 Introduction ............ ............. .............. ............ ............... ............ ............ ............... ............ ...........25

5.2 AIX..............................................................................................................................................25Object Data Manager.......................................................................................................................25

Adding Supported Devices...............................................................................................................27Adding Unsupported Devices...........................................................................................................30Removing Devices...........................................................................................................................31

5.3 HP-UX.........................................................................................................................................31Adding a Device without Modifying the Kernel...............................................................................31

Modifying the Kernel in Order to Add a Device...............................................................................36

5.4 Summary.....................................................................................................................................37

6. MANAGING PROCESSES ............................................................................41

6.1 AIX..............................................................................................................................................41The ps Command ............................................................................................................................41

Signals ............................................................................................................................................41System Resource Controller.............................................................................................................42

Cron................................................................................................................................................44

6.2 HP-UX.........................................................................................................................................45ps, nice, and renice..........................................................................................................................45Signals ............................................................................................................................................45

The top Command...........................................................................................................................46Cron................................................................................................................................................46

6.3 Summary.....................................................................................................................................46

Interoperability Notes ........... ............. .............. ............ ............. .............. ............ ............... ............ ..47

7. BACKUPS......................................................................................................49

7.1 AIX..............................................................................................................................................49The backup Command.....................................................................................................................49

The restore Command .....................................................................................................................50The mksysb Command ........... ............. .............. ............ ............. .............. ............ ............... ............51

Tape Drives.....................................................................................................................................52

7.2 HP-UX.........................................................................................................................................53fbackup............................................................................................................................................53

frecover ............ ............. .............. ............ ............... ............ ............ ............... ............ .............. ........54HP-UX and Cartridge Tapes: tcio ............. ............ .............. ............ ............ .............. ............. ..........55HP-UX’s Equivalent to mksysb........................................................................................................55

7.3 Interoperability Issues................................................................................................................56Standard UNIX Utilities ............ ............ .............. ............. ............ .............. ............. .............. ..........56Interplatform Backups ............ ............. .............. ............ ............... ............ ............ ............... ............57

7.4 Summary.....................................................................................................................................58

Page 3: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 3/185

The AIX/HP-UX Interoperability Guide

v

8. PRINTING ......................................................................................................61

8.1 AIX..............................................................................................................................................61The AIX Queuing System................................................................................................................61Adding a Local Printer ........... ............. .............. ............ ............. .............. ............. .............. ............62

Printing Locally...............................................................................................................................63

Printing to a Remote Printer ............ ............. .............. ............ .............. ............. ............ .............. ....65AIX Print Commands......................................................................................................................68Queue Management Commands ............. ............ .............. ............ ............ .............. ............ .............69

8.2 HP-UX.........................................................................................................................................69The Components of the LP Spooler..................................................................................................69

Setting Up the LP Spooler Using SAM ............ ............ .............. ............. ............ .............. ............. ..74Setting Up the LP Spooler Using HP-UX Commands.......................................................................78

8.3 Interplatform Printing................................................................................................................83

9. CONFIGURING TCP/IP .................................................................................85

9.1 AIX..............................................................................................................................................85Basic TCP/IP Configuration ............ ............ .............. ............ ............. .............. ............ .............. .....85Setting the Hostname.......................................................................................................................86

Adding a Route................................................................................................................................86Removing a Route ............ ............ .............. ............. ............ .............. ............. .............. ............. ......87

Flushing the Routing Table..............................................................................................................87Changing Network Card Configuration ............. ............ .............. ............. .............. ............ .............87Removing Network Card Configuration...........................................................................................88

Managing Name Servers..................................................................................................................88Adding Entries to /etc/hosts.............................................................................................................89

Editing /etc/inetd.conf ............ ............. .............. ............ ............... ............ ............ ............... ............89Editing the /etc/services File............................................................................................................90

Editing /etc/hosts.equiv....................................................................................................................90Editing /etc/ftpusers.........................................................................................................................91Managing Other Services ............ ............ .............. ............. ............ ............... ............ .............. ........91

Using BSD Style rc Configuration ............ ............ ............... ............ ............ ............... ............ .........92

9.2 HP-UX.........................................................................................................................................93Using SAM to Edit /etc/hosts...........................................................................................................93

Specifying a New Default Gateway........... ............ ............... ............ ............ ............... ............ .........94Deleting the Default Gateway ............ ............ .............. ............. ............ .............. ............ .............. ...94

Editing /etc/inetd.conf ............ ............. .............. ............ ............... ............ ............ ............... ............94Editing /usr/adm/inetd.sec ........... ............ .............. ............. ............ ............... ............ .............. ........94Creating /etc/ftpusers.......................................................................................................................96

Creating /etc/hosts.equiv..................................................................................................................96Creating a .rhosts File for the Local Superuser Account...................................................................97

Networking Startup Files.................................................................................................................97

9.3 Summary.....................................................................................................................................98

10. DOMAIN NAME SERVICE...........................................................................99

10.1 AIX............................................................................................................................................99

Page 4: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 4/185

The AIX/HP-UX Interoperability Guide

vi

named Data Files.............................................................................................................................99

Configuring a Primary Name Server................................................................................................99Configuring a Secondary Name Server ............ ............ .............. ............. ............ .............. ............. 100Configuring a Cache-Only Name Server........................................................................................100

Setting Up a Remote Name Server.................................................................................................101Name Resolution Order ............. ............ .............. ............. .............. ............ ............. .............. ........101

10.2 HP-UX.....................................................................................................................................102named Data Files...........................................................................................................................102Configuring a Primary Name Server..............................................................................................102Configuring a Secondary Name Server ............ ............ .............. ............. ............ .............. ............. 103

Configuring a Caching Only Name Server.....................................................................................103Setting Up a Remote Name Server.................................................................................................103

Setting the Local Domain ............ ............ .............. ............. ............ ............... ............ .............. ......104Starting the Primary Server ........... ............ ............... ............ ............ ............... ............ .............. ....104

Maintaining Network and Domain Data Files................................................................................104Updating Domain Data Files ........... ............. .............. ............ ............. .............. ............ .............. ..105Name Resolution Order ............. ............ .............. ............. .............. ............ ............. .............. ........105

10.3 Summary.................................................................................................................................106

11. NIS .............................................................................................................107

11.1 AIX..........................................................................................................................................107NIS Maps and Commands........... ............ .............. ............ ............ .............. ............. .............. .......107

Master Server Configuration..........................................................................................................108Creating an NIS Slave ............ ............. .............. ............ ............... ............ ............ ............... ..........109Creating an NIS Client ........... ............. .............. ............ ............. .............. ............. .............. ..........109

Managing yp Daemons..................................................................................................................110

11.2 HP-UX.....................................................................................................................................111

NIS Maps and Commands........... ............ .............. ............ ............ .............. ............. .............. .......111Master Server Configuration..........................................................................................................112Creating an NIS Slave Server ............ ............. .............. ............ ............... ............ ............ ............. .114Creating an NIS Client. ............. ............ .............. ............. .............. ............ ............. .............. ........115

11.3 Summary.................................................................................................................................116

12. NFS............................................................................................................117

12.1 AIX..........................................................................................................................................117Controlling NFS Daemons.............................................................................................................117

Configuring an NFS Server ........... ............ ............... ............ ............ ............... ............ .............. ....118

Configuring an NFS Client............................................................................................................119Additional SMIT Fastpath Commands...........................................................................................120

Configuring Automount.................................................................................................................120

12.2 HP-UX.....................................................................................................................................123Using SAM to Configure an NFS Client........................................................................................123

Using SAM to Configure an NFS Server........................................................................................124Creating an NFS Server Manually ............ ............ ............... ............ ............ ............... ............ .......125Automount ....................................................................................................................................129

Page 5: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 5/185

The AIX/HP-UX Interoperability Guide

vii

12.3 Summary.................................................................................................................................133

13. MAIL...........................................................................................................135

13.1 AIX..........................................................................................................................................135Customizing the /etc/sendmail.cf file ............ ............. .............. ............ ............... ............ ............ ...135Stopping and Starting the sendmail Daemon ........... ............ .............. ............. ............ .............. .....135

Mail Aliases ..................................................................................................................................135The Mail Queue.............................................................................................................................136

Mail Logging and Statistics ........... ............ ............... ............ ............ ............... ............ .............. ....137

13.2 HP-UX.....................................................................................................................................137Using SAM to Install sendmail......................................................................................................137Manually Installing sendmail ........................................................................................................137

Stopping and Starting the sendmail Daemon ........... ............ .............. ............. ............ .............. .....139The Mail Queue.............................................................................................................................140

The System Log.............................................................................................................................140

13.3 An Interoperability Exercise: Creating Mail Hubs........... ............ ............... ............ ............ .140Sending AIX Mail to an HP-UX Hub.............................................................................................140Sending HP-UX Mail to an AIX Hub.............................................................................................141

13.4 Summary.................................................................................................................................142

14. X11.............................................................................................................143

14.1 AIX..........................................................................................................................................143Files and Directory Structure ........... ............ .............. ............. ............ .............. ............ .............. ...143

Starting X......................................................................................................................................144Stopping X ............ ............ .............. ............. ............ ............... ............ .............. ............. ............. ..145

aixterms ........................................................................................................................................145Fonts .............................................................................................................................................146xdm...............................................................................................................................................147

The Desktop ............ ............ ............... ............ ............ ............... ............ .............. ............. ............ .147

14.2 HP-UX.....................................................................................................................................147Files and Directory Structure ........... ............ .............. ............. ............ .............. ............ .............. ...148Starting X......................................................................................................................................150

Stopping X ............ ............ .............. ............. ............ ............... ............ .............. ............. ............. ..152Fonts .............................................................................................................................................152

hpterms .........................................................................................................................................153HP-VUE........................................................................................................................................153

14.3 X11 Interoperability ............. ............ .............. ............ ............ .............. ............ ............... .......155Displaying to a Remote Host..........................................................................................................155

Turning Your Workstation into an X Terminal..............................................................................157

APPENDIX A.....................................................................................................159

Common Command Pathnames ............ ............. .............. ............ ............ .............. ............ .............159

Page 6: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 6/185

The AIX/HP-UX Interoperability Guide

viii

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.....................................................................................175Accessing the Boot Console User Interface ............ ............. .............. ............ .............. ............. ......175Searching for Bootable Media........................................................................................................175Booting from BOOT_ADMIN ........... ............ ............... ............ ............ .............. ............ .............. .175

Page 7: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 7/185

 Introduction

1

1. Introduction

1.1 Purpose and Scope 

The purpose of this document is to help users and system administrators of either HP-UX or AIXmachines 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 document’s 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..

1.2 HP-UX vs. AIX 

Put simply, HP-UX is Hewlett-Packard’s version of UNIX® while AIX is IBM’s UNIX. But of 

course there is much more to it than that. Since 1969 there have been many strains and variations

of UNIX, but by the end of the 1970s two major forms of UNIX existed: System V, owned by

AT&T and usually regarded as the descendant of the original UNIX, and BSD (Berkeley Software

Distribution), a product of the Computer Systems Research Group at the University of California,

Berkeley. Each had its special features as well as advocates, and for this reason workstation

vendors, including HP and IBM, began creating their own versions of UNIX in the 1980s which

more often than not contained elements of both AT&T and BSD types.

The HP-UX operating system is based on UNIX System V Release 2, with important features from

Berkeley Software Distribution 4.2. It also incorporates features of subsequent System V and

BSD releases, as well as HP extensions and enhancements. Other contributors to HP-UX include

Open Software Foundation, Inc. (OSF!), Carnegie-Mellon University, Cornell University,

Massachusetts Institute of Technology, and numerous other commercial and educational firms and

institutions. In short, HP-UX is essentially an AT&T-type of UNIX with numerous extensions.

Page 8: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 8/185

The AIX/HP-UX Interoperability Guide

2

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 IBM-

proprietary 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.

Page 9: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 9/185

System Startup and Shutdown

3

2. System Startup and Shutdown

2.1 Introduction 

The HP and RS/6000 machines, like all UNIX machines, can be booted in one of two ways:normal (or automatic) boot and standalone boot. Normal boot is a boot from a local hard disk, be

it internal or external. The process for a normal boot usually requires no user intervention and is

therefore frequently referred to as an automatic boot. Standalone boot brings the system up to a

minimal level for purposes of troubleshooting, diagnostics, and sometimes software installation.

This kind of booting usually requires user intervention and is thus also known as manual, attended,

or interactive booting. There is actually a third way to boot these machines—a network boot—

which is usually reserved for diskless workstations and is beyond the scope of this document.

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 self-

test (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 theLED 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 c33is for serial-line terminals (ttys). After that, boot output goes to the display until finally the

Page 10: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 10/185

The AIX/HP-UX Interoperability Guide

4

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 diskettesused 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 do a fast shutdown now with no warnings:

# shutdown -F

To shut down with a warning for users to log off:

# shutdown now 

To shut down with a one-minute warning and then reboot:

# shutdown -r

To reboot immediately:# shutdown -Fr

# reboot

To shut down AIX to single-user mode:

 1This assumes that your root file system is on hdisk0. If it is not, use hdisk x, where x is the number of the physical

volume where the root file system resides.

Page 11: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 11/185

System Startup and Shutdown

5

# telinit S

# init s

To shut down to maintenance mode:

# shutdown -m 

2.3 HP-UX 

Boot Process and System Startup

 Normal Boot 

HP-UX system startup occurs in two phases:

• The Boot ROM startup sequence.

• The HP-UX startup sequence.

Boot ROM Startup SequencePowering 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 kernel’s 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 thesecommands 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.

Page 12: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 12/185

The AIX/HP-UX Interoperability Guide

6

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 devices—devices for which boot I/O code (IODC) exists.

The system then displays a table, such as the following:

Device Selection Device Path Device Type---------------- ----------- -----------P0 scsi.6.0 QUANTUM PD210SP1 scsi.1.0 HP 2213AP2 lan.ffffff-ffff.ff hpfoobar

At this point, the Boot Console User Interface main menu offers the following options:b) Boot from specified devices) Search for bootable devicesa) Enter Boot Administration modex) 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/700Revision 1.1Booting disk(scsi.6;0)/hp-ux966616+397312+409688 start 0x6c50

Kernel Startup Messages OmittedINIT: Overriding default level with level 's'

 2This process is for models 715/33, 715/50, 715/75, 725/50, 725/75, 735, and 755. See appendix D for other models.

Page 13: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 13/185

System Startup and Shutdown

7

INIT: SINGLE USER MODEWARNING: YOU ARE SUPERUSER!!

#

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 

To shut down and reboot HP-UX:

# reboot

# shutdown -r -y now 

To shut down HP-UX to single-user mode:

# telinit S

# shutdown -y now 

# shutdown 0

Customizing shutdown in HP-UX 

Administrators can customize their system’s shutdown through the use of user-supplied scripts. If,

for example, you have Oracle running on the system and want to shut the database down before

shutting the system down, you simply put the script that shuts the database down into a directory

called /etc/shutdown.d. A shutdown command first runs the scripts in the /etc/shutdown.ddirectory before shutting down the system. The order of execution is based on the scripts’ names:

the ASCII order of the script names is the order of execution.

Administrators can also allow non-root users to shut down the system by creating a file called

 /etc/shutdown.allow. The hostname of the system and the user login name must be present in the

 /etc/shutdown.allow file. For example, if  /etc/shutdown.allow contains the following:

foobar bobby

foobar sissy

then users bobby and sissy can shut down system foobar.

2.4 Startup and Shutdown Summary 

The bootup of the IBM and HP platforms, in typical UNIX fashion, is completely platform-

specific. The point at which the two platforms follow a similar procedure is when the init process

Page 14: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 14/185

The AIX/HP-UX Interoperability Guide

8

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 frontof 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 init’s 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.

 3 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 youto 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.

Page 15: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 15/185

User Login and Logout 

9

3. User Login and Logout

3.1 Introduction 

If you were to look at a typical RS/6000 running AIX 3.2.5 and an HP 700 running HP-UX 9.0xboot at the same time, you would see a striking difference between the two login screens. The

RS/6000 would look essentially like an ASCII display, and the HP-UX would look like an X

terminal. On both machines a user simply types a user id and a password to access the system.

But although the process of logging in looks essentially the same for both machines, there are

significant differences between the two.

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 adisplay; 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 you’ll

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 loginprocess to validate the user. Unlike most UNIX systems, including HP-UX, AIX’s 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).4ksh then reads the user’s .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 icon-

based 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:

• 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.

 4 AIX also supports the Bourne and C shells.

Page 16: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 16/185

The AIX/HP-UX Interoperability Guide

10

• .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 themost 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 thename 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

HP’s 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 VUE’s 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.

Page 17: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 17/185

User Login and Logout 

11

• The new vuelogin invokes vuegreet, which displays the login screen and handles the

user’s 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 user’s environment under HP VUE, modifying the .profile file will

not by default have any effect. Instead, you must modify .vueprofile

 Alternative Login Methods in HP-UX 

The Options menu on the HP VUE login screen allows you to select several alternative types of 

sessions, such as HP VUE Lite, or a fail-safe session. You can also select the language for your

session.

If you choose not to use HP VUE, you can select Options from the login window menu and No

Windows from the VUE login screen, at this time. In that case, enter your login name and

password after the appropriate prompts.To log into and out of a fail-safe session, select Fail-safe from the Options menu and log in. A

fail-safe session is a simple session that starts the Workspace Manager and a single terminal

window. It is useful when you need access to a single Terminal Emulator window to execute

several commands before logging into an HP VUE session.

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

user’s .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 user’s environment does not entail changing /etc/profile or .profilebecause vuelogin does not normally read those files.

Page 18: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 18/185

Page 19: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 19/185

 Disks and File Systems

13

4. Disks and File Systems

4.1 Directory Structure 

Despite many attempts to come up with a standard UNIX file system tree, it is still elusive, and theAIX and HP-UX directory structures are good examples of this. Below is a listing of the main

directories in each of the operating systems.

 Major AIX Directories

Path Purpose

/ Root directory

/usr/bin Shared executables (/bin is a link to /usr/bin)

/usr/sbin Shared administrative commands

/usr/lib Shared libraries

/etc Local configuration files

/sbin Files needed to boot and mount /usr from anothermachine

/dev Device files directory

/tmp World-writeable storage for temporary files

/home Default location for user home directories

/export Files needed for diskless machines

/var Host-specific files, accounting and spool files

Page 20: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 20/185

The AIX/HP-UX Interoperability Guide

14

 Major HP-UX Directories

Path Purpose

/ Root directory

/bin Basic commands

/usr/bin More commands and executables

/usr/etc System administration commands

/usr/adm  Accounting files, system administration data files

/usr/spool Spooling directories

/etc Startup and configuration and some administration

commands

/lib C libraries

/dev Device files directory

/tmp World-writeable storage for temporary files

4.2 AIX 

Logical Volume ManagerBefore 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.

Page 21: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 21/185

 Disks and File Systems

15

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.

AIX Disk Installation and File System Creation

The following discussion will use as an example an RS/6000 system with one internal hard disk to

which we’ll add an external hard disk.

For the system to recognize the existence of the new disk, all you have to do is power down the

system, connect the disk, and reboot. The new disk will automatically be assigned a label of 

hdisk<x>, where x is the next available disk number. For example, the internal disk’s label would

be hdisk0; the newly added external drive would be labeled hdisk1. After that you use the Logical

Volume Manager to configure the new device. This can be done either through SMIT (System

Management Interface Tool) or the command line. In most cases it is easier and safer to useSMIT.

If you wanted to connect the external hard drive using SMIT, type smit disk at the command line

and select Add a Disk from the menu:

Add a Disk

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]Disk type osdiskDisk interface scsiDescription Other SCSI Disk DriveParent adapter scsi0

* CONNECTION address [] +ASSIGN physical volume identifier yes +Queue DEPTH [1] +Queuing TYPE [none] +Use QERR bit [yes] +Device CLEARS its Queue on error [no] +READ/WRITE time out value [30] +START unit time out value [60] +REASSIGN time out value [120] +

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 theCONNECTION 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

Page 22: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 22/185

The AIX/HP-UX Interoperability Guide

16

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 diskswould 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:

# lsvgrootvgdatavg

If you were to type the lspv (list physical volumes) command, you would get something like:

# lspvhdisk0 0004038485e2483a rootvghdisk1 000013403f203af5 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 datavgvolume 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 thedefaults.

You can create a logical volume with the mklv command, but it’s 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:

Page 23: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 23/185

 Disks and File Systems

17

Add a Logical Volume

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[TOP] [Entry Fields]Logical volume NAME [data]* VOLUME GROUP name datavg* Number of LOGICAL PARTITIONS [] #PHYSICAL VOLUME names [] +Logical volume TYPE []POSITION on physical volume midway +RANGE of physical volumes minimum +MAXIMUM NUMBER of PHYSICAL VOLUMES [] #

to use for allocationNumber of COPIES of each logical 1 +

partitionMirror Write Consistency? yes +Allocate each logical partition copy yes +

on a SEPARATE physical volume?RELOCATE the logical volume during yes +

reorganization?Logical volume LABEL []MAXIMUM NUMBER of LOGICAL PARTITIONS [128]Enable BAD BLOCK relocation? yes +SCHEDULING POLICY for writing logical parallel +

partition copiesEnable WRITE VERIFY? no +File containing ALLOCATION MAP []

Remember that in SMIT, any entry that starts with an asterisk (*), like in VOLUME GROUPname, 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 crfscommand 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 VolumeAdd 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,

Page 24: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 24/185

The AIX/HP-UX Interoperability Guide

18

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.

[Entry Fields]* LOGICAL VOLUME name +* MOUNT POINT []Mount AUTOMATICALLY at system restart? no +PERMISSIONS read/write +Mount OPTIONS [] +Start Disk Accounting? 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 filesystem 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 mounted—or made available—beginning 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/datadirectory. 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 = /dev/datavfs = jfslog = /dev/hd8mount = truecheck = trueoptions = rwaccount = 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.

AIX Disk and File System Summary

The AIX file system itself is very similar to the HP-UX file system to the extent that it contains

superblocks, inodes, and data blocks. However, AIX file system management is vastly different

Page 25: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 25/185

 Disks and File Systems

19

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.

Using SAM to Install a Disk and Create a File System

1. Log on as root.

2. Run SAM.

3. Highlight Disks and File Systems-> and activate Open.

4. Highlight CD-ROM, Floppy, and Hard Disks and activate Open.

Page 26: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 26/185

The AIX/HP-UX Interoperability Guide

20

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.

Using HP-UX Commands to Add a Disk and Create a File System

The basic steps are to:

1. Install your disk.

2. Create block and character device files for the disk.

3. Run mediainit to initialize the disk, if necessary.

4. Run newfs to create the file system.

Page 27: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 27/185

 Disks and File Systems

21

5. Mount the file system

Installing Your Disk

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 system’s I/O configuration. For SCSI disks, besure 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. Youwill 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

Page 28: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 28/185

The AIX/HP-UX Interoperability Guide

22

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 sectorsHP_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|hp660S_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, let’s assume you want to create a file system for our secondinternal 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

Page 29: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 29/185

 Disks and File Systems

23

If you don’t 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

 Multiple Partitions and File systems on a Single Disk 

It is possible to have more than one file system on a disk in HP-UX, though this is not standard.

Essentially, you have to create an /etc/disktab entry that sets up file system sizes using the “s”

parameter. For example, to set up three file systems on your disk, the disktab entry must contain afile system block size for each partition:

Big_Disk_noswap:\:ns#108:nt#19:nc#1916:\:s1#205824:b1#16384:f1#2048:\:s2#1281024:b2#8192:f2#1024:\:s3#820224:b3#8192:f3#1024:\:se#512:rm#4002:

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.

Page 30: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 30/185

The AIX/HP-UX Interoperability Guide

24

HP-UX Disk and File System Summary

Usually file systems in HP-UX encompass an entire disk. A common configuration for two

internal hard disks is to have the root file system ( / ) on one internal and the /usr file system on

another. You create file systems by using SAM or HP-UX commands. The procedure requires

you to add a disk, create device files for it, initialize it, create the file system, and then mount it.

You use entries in /etc/disktab to create your file system and if your disk doesn’t appear in the file,then you have to create your own entry. To make mounting automatic you make entries in the

 /etc/checklist file. If you have allocated swap space for your disk, then you have to activate it with

the swapon command. Like file systems, swap spaces need entries in /etc/checklist for automatic

activation.

4.4 Disks and File Systems: AIX vs. HP-UX 

AIX and HP-UX differ quite a bit in disk and file system management. The root tree of each

machine is quite different, but that’s always the cases in different forms of UNIX. AIX uses LVM

to manage its disks; HP-UX 9.0x does not. AIX partitions (logical volumes) do not represent

contiguous slices of disks. HP-UX partitions, if used at all, do represent contiguous disk space.

AIX uses a file called /etc/filesystems to automate the mounting of file systems at bootup; HP-UXuses /etc/checklist. Each of these files has a different format from the other. AIX file systems are

log-based and do not call fsck at bootup to check file systems. HP-UX does use fsck to check file

systems, and the /etc/checklist file specifies under what conditions it does.

The two operating systems are alike in many ways, though sometimes in concept rather than

execution. Both systems use both character and block device files for file systems, though in AIX

these are created automatically when you create your logical volume. Both systems use the mountcommand in similar ways; both have mount points, mounts must occur in order for file systems to

be accessible, and both have mechanisms for automatic mounting. Both systems’ file system data

structures are much the same; each has superblocks, inodes, and data blocks. However, to check

the amount of space for each file system, AIX uses the df command, which displays file system

sizes in KB, while HP-UX uses the bdf command, which displays sizes in 512-byte blocks.

Finally, both AIX and HP-UX file systems are available for exporting across the network via NFS

(Network File Systems) in much the same manner. Therefore, if you want to share file systems

between the two platforms, it doesn’t really matter what the underlying method of file system

creation is because exporting and mounting across the network simply requires a file system,

regardless of how it got to be a file system.

Page 31: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 31/185

 Devices

25

5. Devices

5.1 Introduction 

One area of significant difference between AIX and HP-UX is that of device configuration. AIXsupports 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 theway 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 beobtained by typing the odmshow command.

# odmshow CuDvclass 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 locationdescriptor.

Page 32: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 32/185

The AIX/HP-UX Interoperability Guide

26

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 databaseconsists 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" | sortadapter mca ppr POWER Gt3i Graphics Adapteradapter mca sio_1 Standard I/O Planaradapter sio fda Standard I/O Diskette Adapteradapter sio hscsi Standard SCSI I/O Controlleradapter sio ient_1 Standard Ethernet Adapteradapter sio keyboard Keyboard Adapteradapter sio mouse Mouse Adapter

adapter sio ppa Standard I/O Parallel Port Adaptadapter sio s1a_1 Standard I/O Serial Port 1adapter sio s2a_1 Standard I/O Serial Port 2adapter sio tablet Tablet Adapterbus sys mca Microchannel Busdisk scsi 1000mb 1.0 GB SCSI Disk Drivediskette siofd fd Diskette Drivefpa sys fpa1 Floating Point Processorhft node hft High Function Terminal Subsystem if EN en Standard Ethernet Network Inter

Page 33: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 33/185

 Devices

27

if EN ie3 IEEE 802.3 Ethernet Network Interif LO lo Loopback Network Interfaceioplanar sys ioplanar_1 I/O Planarkeyboard sio.kb kb101 United States keyboardlogical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volume

logical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volumelogical_volume lvsubclass lvtype Logical volumelogical_volume vgsubclass vgtype Volume grouplvm lvm lvdd N/Amemory sys memory 64 MB Memory Cardmouse sio.ms mse_3b 3 button mouseplanar sys sysplanar1 CPU Planarpty pty pty Asynchronous Pseudo-Terminal

sys node aio Asynchronous I/Osys node sys System Objectsysunit sys sysunit System Unittape scsi 8mm5gb 5.0 GB 8mm Tape Drivetcpip TCPIP inet 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.

Adding Supported Devices

Adding and removing devices requires manipulating the device configuration database via the

ODM, a daunting task. If you use AIX device management commands like mkdev, rmdev, lsdev,

lsattr, and chdev you need to be familiar with these class concepts and the ODM. However, two

tools can greatly simplify the task: the cfgmgr command and SMIT.

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

Page 34: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 34/185

The AIX/HP-UX Interoperability Guide

28

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 tapermt0 Available 00-00-0S-60 5.0 GB 8mm Tape Drive

The term “Available” refers to the tape drive’s 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 isdefined, 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. cfgmgrwill 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 cfgmgrduring bootup will set the device to a defined state. To make it available, power-on the device and

rerun the cfgmgr command.

 Adding a Device Using SMIT 

You can attach a device to the system, power it on, and then use SMIT to configure it. To do so,

 just type smit device at the command line. You will see the following:

Devices

Move cursor to desired item and press Enter.

Configure Devices Added After IPLPrinter/PlotterTTYAsynchronous AdaptersPTYConsoleFixed DiskCD ROM DriveDiskette DriveTape DriveCommunicationHigh Function Terminal (HFT)SCSI Initiator DeviceSCSI AdapterAsynchronous I/OMultimediaList Devices

Just select the item you wish to add and press Enter. If you were to add the example 8mm tapedrive to the system this way, you would select Tape Drive. The next screen would look like the

following:

Page 35: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 35/185

 Devices

29

Tape Drive

Move cursor to desired item and press Enter.

List All Defined Tape DrivesList All Supported Tape DrivesAdd a Tape DriveChange / Show Characteristics of a Tape DriveRemove a Tape DriveConfigure a Defined Tape DriveGenerate Error ReportTrace 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 scsi 1.2 GB 1/4-Inch Tape Drive150mb scsi 150 MB 1/4-Inch Tape Drive3490e scsi 3490E Autoloading Tape Drive4mm2gb scsi 2.0 GB 4mm Tape Drive4mm4gb scsi 4.0 GB 4mm Tape Drive525mb scsi 525 MB 1/4-Inch Tape Drive8mm scsi 2.3 GB 8mm Tape Drive8mm5gb scsi 5.0 GB 8mm Tape Drive9trk scsi 1/2-inch 9-Track Tape Driveost scsi 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.

Page 36: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 36/185

The AIX/HP-UX Interoperability Guide

30

Finally, you will get the following screen:

Add a Tape Drive

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]Tape Drive type 8mm5gbTape Drive interface scsiDescription 5.0 GB 8mm Tape DriveParent adapter scsi0*CONNECTION address []BLOCK size (0=variable length) [1024] #Use DEVICE BUFFERS during writes yes +Use EXTENDED file marks no +DENSITY setting #1 140 +DENSITY setting #2 20 +Use data COMPRESSION yes +

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 mkdevcommand and this will configure the drive to an available state.

Adding Unsupported Devices

The predefined object class supports all kinds of devices, most of which are IBM products.

However, it does contain generic device objects. To see a list of those objects, enter the following

command:

# lsdev -P | grep -i otherprinter opp parallel Other parallel printerdisk osdisk scsi Other SCSI Disk Drivetape ost scsi Other SCSI Tape Drivetmscsi tmscsi scsi Other SCSI Initiator Deviceprinter osp rs232 Other serial printerprinter osp rs422 Other serial printercdrom oscd scsi Other SCSI CD-ROM Drive

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 doesn’t 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.

 5Remember that connection addresses need a zero appended to the SCSI hardware address.

Page 37: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 37/185

 Devices

31

Removing Devices

When you physically remove a device from the system, cfgmgr resets the device state to definedthe 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 rmdevis:

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 command’s 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 wantto 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.

Adding a Device without Modifying the KernelThe basic steps of doing so are:

1. Add your device to the system. This usually requires shutting down the system, attaching

the device, and rebooting; for SCSI devices it is required.

2. Determine how the device is to be accessed: block or character (raw) mode. A device file

must exist for each type of access to the device.

3. Determine if the device file necessary to communicate with the device already exists on

your HP-UX system.

4. If the appropriate device file does not exist for the newly installed device, you must create

one. If you are using SAM to add your device, SAM will create the device file. If you arenot using SAM, use the mknod command to create the device file.

 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:

Page 38: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 38/185

The AIX/HP-UX Interoperability Guide

32

# ls -l /dev/console /dev/*dskcrw--w--w- 1 root sys 0 0x000000 Apr 16 12:56 /dev/console

/dev/dsk:total 0brw-r--r-- 1 root sys 7 0x410200 Apr 16 09:08 c42d0s0brw-r--r-- 1 root sys 7 0x201600 Jan 14 16:41 c201d6s0

/dev/rdsk:total 0crw-r--r-- 1 root sys 47 0x410200 Apr 16 09:08 c42d0s0crw-r--r-- 1 root sys 47 0x201600 Mar 18 15:30 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, thecharacter 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:

# lsdevCharacter Block Driver

0 -1 /dev/console

1 -1 HP98628, HP 98626, and HP986422 -1 /dev/tty3 -1 /dev/mem, /dev/kmem, and /dev/null16 -1 Master pty17 -1 Slave pty23 -1 raw 8042 HIL24 -1 HIL25 -1 HIL cooked keyboards47 7 SCSI disk52 -1 IEEE 802 device121 -1 SCSI tape55 10 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 0brw-r--r-- 1 root sys 7 0x201600 Jan 14 16:41 c201d6s0

Page 39: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 39/185

 Devices

33

/dev/rdsk:total 0crw-r--r-- 1 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 device’s 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.

 Device File Naming Conventions

HP-UX follows a naming convention for device files which it employs on preloaded systems and

when SAM is used to create device files. You can use whatever name you want when you create a

device file, but if you follow the naming convention you will find it easier to locate and identify a

particular device file. To make the names easier to remember you can create the device file usingthe naming convention and then link that name to one like /dev/tape1 or /dev/cd.

The device file name for the most common devices begins with the letter c, which stands for the

controller number. What follows the letter c is either the number 20, which indicates the core I/O

module of the system bus, or 4, indicating the EISA bus adapter. Next is a number indicating

function of the controller. The number 1 is for the SCSI function. Next is usually the letter d ,

which stands for the device number, or bus address. Often there follows additional numbers or

letters that indicate additional information. The following are examples of disk device files. The

letter s indicates the section number, which is always zero unless software disk striping is used.

/dev/[r]dsk/c201d6s0 SCSI disk on the core I/O module at bus address 6

/dev/[r]dsk/41d3s0 SCSI disk on the EISA slot at bus address 3

The following is an example of an optical autochanger device file:

/dev/[r]ac/c201d3_1a SCSI optical autochanger at bus address 3, disk1,side a

Tape drive device files have the following possible values in addition to the controller number and

address number:

Page 40: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 40/185

The AIX/HP-UX Interoperability Guide

34

h High density of 6250 bpi

m Medium density of 1600 bpi

l Low density of 800 bpi

c Indicates data compression (only for drives that supportcompression)

n Indicates no rewind upon close of device

b Indicates Berkeley-style tape behavior

525|150|120 Indicates the format of a quarter-inch tape drive

Example tape drive device files:

/dev/rmt/c201d3h SCSI tape drive at bus address 3, high density

/dev/rmt/c201d3mn SCSI tape drive at bus address 3, medium density, norewind on close

Creating Device Files

You can use SAM to create device files. SAM will create the files using the recommended naming

convention, create both block and character versions where needed, and assign the appropriate

major and minor numbers. In many cases using SAM to do these tasks is the best way to go,

especially in the case of tape drives, since there are often as many as 16 different device files for

each one you install. And since the minor numbers are hexadecimal values, using SAM can make

things a lot easier.

However, you can create device files manually by invoking the mknod command. The syntax of 

mknod is:

 mknod name c|b major number minor number

 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

Page 41: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 41/185

 Devices

35

• 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

Peripheraltype

Format ofDDD

Syntax

SCSI diskdrive

TUV T is the target number (bus address)

U is the unit number for integrated devices

V specifies the volume number (0 for singlefile systems)

Tape drive TDO T is the bus address

D is density flag

O is the operation bits

Autochanger TS T is the bus address

S is the surface

Parallelprinter

T00 T is the bus address

00 is always set to 00

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. ioscansearches 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 -fClass H/W Path Driver H/W Status S/W Status=======================================================scsi 2.0.1 c700 ok(0x7071) okdisk 2.0.1.1.0 scsi ok(0x5800202) okdisk 2.0.1.2.0 scsi ok(0x201) oktape_drive 2.0.1.3.0 scsitape ok(0x1800202) okdisk 2.0.1.4.0 scsi ok(0x201) okdisk 2.0.1.6.0 scsi ok(0x101) ok

Page 42: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 42/185

The AIX/HP-UX Interoperability Guide

36

lan 2.0.2 lan01 ok(0x7072) okhil 2.0.3 hil ok(0x7073) okserial 2.0.4 asio0 ok(0x7075) okserial 2.0.5 asio0 ok(0x7075) okparallel 2.0.6 parallel ok(0x7074) okscsi 4.1.0 c700 ok(0x7680) okdisk 4.1.0.4.0 scsi ok(0x201) ok

disk 4.1.0.5.0 scsi ok(0x201) okdisk 4.1.0.6.0 scsi ok(0x201) 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 Hexadecimal notation

20 The core I/O card on system bus module 2

1 SCSI function number

100 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

Modifying the Kernel in Order to Add a Device

For most systems, the default kernel configuration is sufficient and you will not have to modify the

kernel configuration in order to add a device. However, kernel drivers such as cs80 (Series

300/400/700) and hshpib are not included in the default configuration. These drivers are needed

for the optional EISA HP-IB card and its peripherals (for example, to communicate with an HP-IB

DDS-format drive). To configure them, you must rebuild the kernel.

Using SAM to Rebuild the Kernel 

Using SAM is the easiest way to rebuild the kernel. In the case of devices SAM will also make

sure your device files are created. SAM will make changes to the /etc/conf/dfile file, the kernel

configuration file, and will use it to build the new kernel. SAM will always show you a list of 

whatever you are configuring with values in one of two categories: current and pending. The

pending values are those you have changed in /etc/conf/dfile and which will be the new kernel

values when you have created a new kernel and rebooted the system. The current values are those

in the current running kernel.

When you have completed all the kernel changes you wish to make using SAM, you should choose

the Create a New Kernel action. When the new kernel has been created, you will be given thechoice of 1) moving the kernel into place and rebooting the system immediately, 2) moving the

kernel into place but not rebooting the system, or 3) exit without moving the kernel into place.

 Rebuilding the Kernel Manually

 /etc/conf/dfile contains an entry for all peripheral devices, I/O cards, and major software

subsystems such as LAN, RJE, and X25. To add a device, card, or subsystem to the kernel, you

must add an entry for it in the dfile. To determine what entry to add to the dfile you should

Page 43: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 43/185

 Devices

37

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.

Let’s assume you want to add a SCSI floppy drive to your system. First you would check

 /etc/master to make sure it’s 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 kerneldrivers. 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 ODM’s 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, althoughmany 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 tarcan 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

Page 44: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 44/185

The AIX/HP-UX Interoperability Guide

38

Block Character

/dev/hd1 /dev/rhd1

/dev/hd2 /dev/rhd2

/dev/hd3 /dev/rhd3

/dev/hd* /dev/hd*

 HP-UX File System Device Files

Block Character

/dev/dsk/c201d0s0 /dev/rdsk/c201d0s0

/dev/dsk/c201d1s0 /dev/rdsk/c201d1s0

/dev/dsk/c201d2s0 /dev/rdsk/c201d2s0

/dev/dsk/c201d*s0 /dev/rdsk/c201d*s0

 AIX Tape Drive Device Files

File Meaning

/dev/rmt* Rewind on close, no retension on open, high density

/dev/rmt*.1 No rewind on close, no retension on open, high density

/dev/rmt*.2 Rewind on close, retension on open, high density

/dev/rmt*.3 No rewind on close, retension on open, high density

/dev/rmt*.4 Rewind on close, no retension on open, low density

/dev/rmt*.5 No rewind on close, no retension on open, low density

/dev/rmt*.6 Rewind on close, retension on open, low density

/dev/rmt*.7 No rewind on close, retension on open, low density

Page 45: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 45/185

 Devices

39

 HP-UX Tape Drive Device Files

File Meaning

/dev/rmt/c201d*c Rewind on close, compress data

/dev/rmt/c201d*cb Rewind on close, compress data, Berkeley style

/dev/rmt/c201d*cn No rewind on close, compress data

/dev/rmt/c201d*cnb No rewind on close, compress data, Berkeleystyle

/dev/rmt/c201d*h Rewind on close, high density

/dev/rmt/c201d*hb Rewind on close, high density, Berkeley style

/dev/rmt/c201d*hn No rewind on close, high density

/dev/rmt/c201d*hnb No rewind on close, high density, Berkeleystyle

/dev/rmt/c201d*l Rewind on close, low density

/dev/rmt/c201d*lb Rewind on close, low density, Berkeley style

/dev/rmt/c201d*ln No rewind on close, low density

/dev/rmt/c201d*lnb No rewind on close, low density, Berkeleystyle

/dev/rmt/c201d*m Rewind on close, medium density

/dev/rmt/c201d*mb Rewind on close, medium density, Berkeleystyle

/dev/rmt/c201d*mn No rewind on close, medium density

/dev/rmt/c201d*mnb No rewind on close, low density, Berkeleystyle

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 Character

/dev/fd0 /dev/rfd0

Page 46: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 46/185

The AIX/HP-UX Interoperability Guide

40

 HP-UX Floppy Drive Device Files

Block Character

/dev/floppy/c201d0s0 /dev/rfloppy/c201d0s0

Page 47: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 47/185

 Managing Processes

41

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 AT&T version of the above command is:

# ps -elf

 Priorities and Nice Values

Both of the above commands provide, among other things, the priority and nice values for each

process. The nice value is part of the calculation for the priority value, whose range is 0 to 127.The lower the priority value, the more frequently the process is scheduled. Higher numbers mean

lower priority.

The nice command follows the BSD value range of -20 to 20, again with the larger number

representing the lower priority. Though the AIX man page does not say so, the nice command

syntax takes two forms: nice -value and nice -n value. The latter is easier when you have to use

negative values. Otherwise, to set the nice value to -10, you have to type:

# nice --10 CommandName

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 -lNULL HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRMTERM URG STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ MSG WINCH PWR USR1USR2 PROF DANGER VTALRM MIGRATE PRE GRANT RETRACT SOUND SAK

# kill -l1) HUP 14) ALRM 27) MSG 40) bad trap 53) bad trap2) INT 15) TERM 28) WINCH 41) bad trap 54) bad trap

3) QUIT 16) URG 29) PWR 42) bad trap 55) bad trap4) ILL 17) STOP 30) USR1 43) bad trap 56) bad trap5) TRAP 18) TSTP 31) USR2 44) bad trap 57) bad trap6) LOST 19) CONT 32) PROF 45) bad trap 58) bad trap7) EMT 20) CHLD 33) DANGER 46) bad trap 59) bad trap8) FPE 21) TTIN 34) VTALRM 47) bad trap 60) GRANT9) KILL 22) TTOU 35) MIGRATE 48) bad trap 61) RETRACT10) BUS 23) IO 36) PRE 49) bad trap 62) SOUND11) SEGV 24) XCPU 37) bad trap 50) bad trap 63) SAK12) SYS 25) XFSZ 38) bad trap 51) bad trap

Page 48: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 48/185

The AIX/HP-UX Interoperability Guide

42

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

System Resource Controller

AIX has a unique way of managing processes: the System Resource Controller (SRC). The SRC

takes the form of a daemon, srcmstr, which is started by init via /etc/inittab. srcmstr manages

requests to start, stop, or refresh a daemon or a group of daemons. Instead of typing the name of a

daemon to start it, or instead of using the kill command to stop a daemon, you use an SRC

command that does it for you. In this way you don’t have to remember, for example, whether to

use an ampersand when starting a daemon, or what signal to use when killing one. SRC also

allows you to stop and start groups of related daemons with one command.

AIX has a hierarchical organization of system processes, and this organization is configured into

the ODM in the form of the SRCsubsys and SRCsubsvr object classes. Daemons at the lowestlevels are subservers. On a newly loaded system the only subservers are those of the inetdsubsystem: ftp, telnet, login, finger, etc. To view these subservers, use the odmget command:

# odmget SRCsubvrSRCsubsvr:

sub_type = "ftp"subsysname = "inetd"sub_code = 21

SRCsubsvr:sub_type = "telnet"subsysname = "inetd"sub_code = 23

SRCsubsvr:sub_type = "finger"subsysname = "inetd"sub_code = 79

SRCsubsvr:sub_type = "tftp"subsysname = "inetd"sub_code = 69

...

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 SRCsubsyscommand:

# odmget SRCsubsysSRCsubsys:

subsysname = "lpd"synonym = ""cmdargs = " "path = "/usr/lpd/lpd"uid = 0auditid = 0

Page 49: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 49/185

 Managing Processes

43

standin = "/dev/console"standout = "/dev/console"standerr = "/dev/console"action = 1multi = 0contact = 3svrkey = 0

svrmtype = 0priority = 20signorm = 0sigforce = 0display = 1waittime = 20grpname = "spooler"

SRCsubsys:subsysname = "inetd"synonym = ""cmdargs = ""path = "/etc/inetd"uid = 0auditid = 0

standin = "/dev/console"standout = "/dev/console"standerr = "/dev/console"action = 2multi = 0contact = 3svrkey = 0svrmtype = 0priority = 20signorm = 0sigforce = 0display = 1waittime = 20grpname = "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 -aSubsystem Group PID Statussyslogd ras 3363 activesendmail mail 4646 activeportmap portmap 4908 active

inetd tcpip 5167 activesnmpd tcpip 5428 activekeyserv keyserv 6206 activebiod nfs 6465 activenfsd nfs 8010 activerpc.mountd nfs 10067 activerpc.statd nfs 10325 activerpc.lockd nfs 10583 activeqdaemon spooler 5981 activewritesrv spooler 1631 active

Page 50: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 50/185

The AIX/HP-UX Interoperability Guide

44

infod infod 13684 activelpd spooler 12151 activeiptrace tcpip inoperativegated tcpip inoperativenamed tcpip inoperativerouted tcpip inoperativerwhod tcpip inoperative

timed tcpip inoperativellbd ncs inoperativenrglbd ncs inoperativeypserv yp inoperativeypbind yp inoperativeypupdated yp inoperativeyppasswdd yp inoperative

The most commonly used SRC commands are startsrc, stopsrc, and refresh, each of which takes

the following options:

-s Apply this command to a subsystem, using the subsystem name provided in the lssrc -acommand

-g Apply this command to a subsystem group, using the subsystem group name provided in thelssrc -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

To start the nfs subsystem group:

# startsrc -g nfs

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)

Page 51: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 51/185

 Managing Processes

45

• The shell command

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 hasappropriate privileges.

Signals

HP-UX signals look like the following. For the HP-UX kill command:

# /bin/kill -lNULL HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRMTERM USR1 USR2 CHLD PWR VTALRM PROF POLL WINCH STOP TSTP CONT TTINTTOU URG LOST DIL

For the ksh built-in command:

# kill -l1) HUP 16) USR12) INT 17) USR23) QUIT 18) CHLD4) ILL 19) PWR5) TRAP 20) VTALRM6) IOT 21) PROF7) EMT 22) POLL8) FPE 23) WINCH9) KILL 24) STOP10) BUS 25) TSTP

Page 52: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 52/185

The AIX/HP-UX Interoperability Guide

46

11) SEGV 26) CONT12) SYS 27) TTIN13) PIPE 28) TTOU14) ALRM 29) URG15) TERM 30) 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.

The top Command

The top command displays and updates information about the top processes on the system. It

summarizes the general state of the system (load average), quantifies the amount of memory in use

and free, and reports on individual processes active on the system. Whereas ps gives a single

“snapshot” of the system, top samples the system and updates its display at intervals, the default

being five seconds. On multiprocessing systems, top reports on the state of each processor.

This command is not available in AIX.

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-UX’s 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

AIX’s 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.

Page 53: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 53/185

 Managing Processes

47

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.

Page 54: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 54/185

Page 55: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 55/185

 Backups

49

7. BackupsNote: 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 restoreand 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 system’s 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 willrecord 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 system’s device files are

 /dev/hd1 and /dev/rhd1). Don’t 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

 6See Chapter 3 for a description of journaled file systems.

Page 56: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 56/185

The AIX/HP-UX Interoperability Guide

50

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 -voption. 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

The restore Command

The restore command is used to restore files backed up by i-node or by name. This command

works only on archives created by the backup command and is capable of determining which

format, i-node or by-name, was used for the backup. The basic syntax of restoring entire file

systems is:

# restore -f Device -r

The basic syntax of restoring files backed up by name is:

# restore -f Device -x

 Examples

Restore an entire file system backed up by i-node from tape.:

# restore -f /dev/rmt0 -r

Page 57: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 57/185

 Backups

51

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 backed up by name from tape:

# restore -f /dev/rmt0 -x

Extract all files from tape and display file names while doing so (-v, for verbose):

# restore -f /dev/rmt0 -xv

Extract verbosely the file /home/partlist:

# restore -f /dev/rmt0 -xv /home/partlist

Extracts the entire /home directory from tape verbosely:

# restore -f /dev/rmt0 -xv -d /homeTo 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

List files from tape :

# restore -f /dev/rmt0 -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

The mksysb Command

AIX provides a means to create an bootable tape containing an image of the root volume group.

This can be a life saver for single-disk systems in that you have a very quick means of recovery in

case of disk failure, provided, of course, your mksysb image is fairly current. You can also use

mksysb to install other machines, although this will require redoing some of the configuration,

such as IP addresses, because virtually everything on the original machine is copied to tape.

To do a system image backup:

1. Start SMIT:

  # smit mksysb

2. You will see the following:

Page 58: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 58/185

The AIX/HP-UX Interoperability Guide

52

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 materialpreviously stored on the selectedoutput medium. This command backsup only rootvg volume group.

FORCE increase of work space if needed no +* 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 AIX’s

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 tapeunless 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 can’t 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-UX’s mt command. The syntax of 

tctl is:

# tctl -f Device Subcommand Count

The most common tctl subcommands are:

Page 59: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 59/185

 Backups

53

fsf  Moves the tape forward the number of file marks specified by Count.

bsf  Moves the tape backwards the number of file marks specified by Count.

rewind Rewinds the tape.

erase Erases all contents on the tape and rewinds it.

retension 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 fbackupcommand 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.  Devicecan 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

AIX’s 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, AIX’s 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/tmpdirectory 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 /usre /usr/tmpe /usr/libi /userse /users/guest

Then the /usr file system will be backed up with the exception of the  /usr/tmp and /usr/libdirectory trees, and the /users file system will be backed up with the exception of the  /users/guestdirectory 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 AIX’s /etc/dumpdates file.) This file is not updated

unless you use the -u option, which is only available with the -g option.

Page 60: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 60/185

The AIX/HP-UX Interoperability Guide

54

 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:# fbackup -f /dev/rmt/c201d0m -i . -e ./subdir

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

Extract certain files from a backup volume:

# frecover -x

Read the index from the backup volume and write it to path:

# frecover -I path

Restart an interrupted recovery:

# frecover -R path

As you can see, fbackup resembles AIX’s restore command’s 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 file’s 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:

Page 61: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 61/185

 Backups

55

# frecover -rf /dev/rmt/c201d0m 

Recover all files indicated in /usr/local/graph:

# frecover -x -g /usr/local/graph -f /dev/rmt/c201d0m 

Retrieve an index of files from tape and put it in /tmp/index:

# frecover -I /tmp/index -f /dev/rmt/c201d0m 

HP-UX and Cartridge Tapes: tcio

The wear and tear on a cartridge tape drive is extensive when redirection is used because the data

transfer rates between the host computer and the cartridge tape drive are not synchronized. Thus

HP developed the tcio command to “buffer up” data transfer between the backup command and the

cartridge tape drive. Instead of redirecting the output of the backup command straight to the

device, it is piped through tcio to enable streaming to occur. tcio can be used with cpio as well as

with fbackup.

 Examples

Make relative backup on cartridge tape /dev/rct/0s0:

# find . -print | cpio -o | tcio -o /dev/rct/0s0

Back up /users to cartridge tape:

# fbackup -f - -i /users | tcio -o /dev/rct/0s0

HP-UX’s Equivalent to mksysb

HP-UX doesn’t have the mksysb command nor a command that all by itself does the same thing.

For one thing LVM doesn’t exist in 9.x for the 700 series. But you can create a bootable image of 

a disk by taking the following steps:

1. Shut down to single user mode to minimize system activity:

  # shutdown 0

2. Clear any remaining data in the buffers:

  # sync;sync

3. Use dd to copy the LIF boot area:

  # dd if=/usr/lib/uxbootlf.700 of=/dev/rmt/0mn bs=2k

4. Again, sync the disk:

 # sync;sync

5. Use dd to append the Root file system:

  # dd if=/dev/rdsk/c201d6s0 of=/dev/rmt/0m bs=64k

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.

Page 62: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 62/185

The AIX/HP-UX Interoperability Guide

56

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

3. Enter the following in response to the ISL prompt:

  ISL> hpux restore disc(scsi.6.0;0)

7.3 Interoperability Issues 

Standard UNIX Utilities

Both AIX and HP-UX support the following standard UNIX utilities, each of whose behavior is

nearly identical: dump, rdump, tar, cpio, dd, and pax. For doing interplatform backups it is

advisable to use one of these commands. HP-UX has the standard utility mt; AIX does not but has

the rough equivalent in tctl. AIX does not have the tcio command; instead you have to use dd tobuffer data when using redirection. The following table summarizes the backup commands for both

operating systems.

 Backup Utilities Comparison

Command AIX HP-UX

backup yes no

restore yes no7

fbackup no yes

frecover no yes

dump yes yes

rdump yes yes

rrestore yes yes

tar yes yes

cpio yes yes

dd yes yes

tcio no yes

 7This is not quite true. There is a restore command in HP-UX, but it is the counterpart to the dump command.

Page 63: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 63/185

 Backups

57

Interplatform Backups

The following backup commands have been tested on an HP Model 712 and an IBM RS/6000 355.

Using tar to Copy Files from One System to the Other 

You can tar a directory tree or a set of files on the HP, ftp the tar file to the RS/6000, and then

unpack the file. For example,

Back up the .vue directory to the /tmp/vue.tar archive file:

# tar -cvf /tmp/vue.tar .vue

Copy the file to the RS/6000:

# ftp RS_node

ftp> put /tmp/vue.tar

Login to the RS/6000:

# remsh RS_node

Restore the files from the /tmp/vue.tar archive:

# tar -xvf /tmp/vue.tar

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 directionwould 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

This copies the HP's /.vue directory to the RS/6000's / directory.

Using Another System’s Tape Drive

For the following examples, the HP Model 712 had a 4mm DAT drive, the RS an 5GB 8mm tape

drive. Since these involve using the network and the dd command, make sure the RS/6000 tape

drive is set to variable-length blocks.

Examples using tar

Archive the HP’s .vue directory onto the 8mm tape drive of the RS/6000:

# tar cvf - /.vue | remsh RS_node dd of=/dev/rmt0 obs=20b

Page 64: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 64/185

The AIX/HP-UX Interoperability Guide

58

Archive the RS/6000’s /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

Restore the contents of the tape from an HP drive to the RS/6000:

# rsh HP_node dd if=/dev/rmt/c201d3m bs=20b | tar -xvBf -

Examples using backup and restore

These examples are for using the RS/6000’s 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/6000’s tape drive:

# pax -wv /doc | remsh RS_node dd of=/dev/rmt0 obs=64k

To read the above archive tape from the RS/6000:

# dd if=/dev/rmt0 ibs=64k | pax

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 avoidwasting 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. AIX’s proprietary commands are backup and restore, based on dump and restore.

Page 65: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 65/185

 Backups

59

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 variable-

length blocks. You can configure the system for one or the other by using SMIT or the chdevcommand. 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-UX’s 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 system’s 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 machine’s tape drive, you can only

restore your files to an AIX system. For best portability, use pax, the portable archive exchange

command.

Page 66: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 66/185

Page 67: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 67/185

Printing

61

8. PrintingIn 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:

•• Local printer

A printer that is physically connected to your computer.

• 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, let’s 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/lp0header = 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

 8InfoExplorer, 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.

Page 68: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 68/185

The AIX/HP-UX Interoperability Guide

62

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.

Adding a Local Printer

1. Start SMIT:

  # smit pdp

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

For serial you should see two choices:

  sa0 Available 00-00-S1 Standard I/O Serial Port 1

  sa1 Available 00-00-S2 Standard I/O Serial Port 2

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.

Page 69: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 69/185

Printing

63

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 Forexample, 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. Description1 Printer or Plotter Attached to Host2 Printer or Plotter Attached to Xstation3 Printer or Plotter Attached to ASCII Terminal4 Network Printer (Hewlett-Packard JetDirect)

Enter number from list above (press Enter to terminate): -> 1

Choosing number 1 brings up the following:

Name Description

lp0 Hewlett-Packard LaserJet IIISilp1 IBM 2380 Personal Printer II

Enter device name (or, ! to exit): (lp0) ->

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.

 9InfoExplorer, Printer Overview for System Mangement 

Page 70: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 70/185

The AIX/HP-UX Interoperability Guide

64

No. Description36 IBM 5589 Model H0137 IBM 6180 Color Plotter38 IBM 6182 Auto Feed Color Plotter39 IBM 6184 Color Plotter40 IBM 6185-1 Color Plotter41 IBM 6185-2 Color Plotter42 IBM 6186 Color Plotter43 IBM 6252 Impactwriter44 IBM 6262 Printer45 IBM 7372 Color Plotter46 Canon Laser Shot LBP-B406S/D/E, A404E, A304E47 Dataproducts BP2000 Line Printer48 Dataproducts LZR 2665 Laser Printer49 Hewlett-Packard LaserJet II50 Hewlett-Packard LaserJet III51 Hewlett-Packard LaserJet IIISi52 Hewlett-Packard LaserJet 453 OKI MICROLINE 801PS54 Printronix P9012 Line Printer55 Plotter

Enter number from list above (press Enter to terminate): -> 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)ps1Should 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)pcl1hplj-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/lp0header = nevertrailer = neveraccess = both

Page 71: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 71/185

Printing

65

backend = /usr/lib/lpd/piobepcl1:

device = lp0lp0:

file = /dev/lp0header = nevertrailer = never

access = bothbackend = /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: For queue pcl1:

# enq -Pps1 file # enq -Ppcl1 file

# qprt -Pps1 file # qprt -Pps1 file

# lp -dps1 file # lp -dpcl1 file

# lpr -Pps1 file # lpr -Ppcl1 file

Printing to a Remote Printer

The basic process of printing to a remote printer is to

1. Attach a printer to the remote machine and add it as a local printer to the remote

workstation.

2. Start the lpd daemon on the remote machine and enable access to it from your local

workstation.

3. Create a remote queue on the local workstation.

 Remote Workstation Setup

Attach a printer to the remote workstation in the same manner as described in Adding a Local

Printer. Though you are setting up remote printing, the printer is a local printer to the remote

workstation. The remote workstation with a printer attached is frequently called a print server; a

local workstation printing to a print server is often called a print client. We will use that

terminology here to help avoid some confusion in terminology. After you add the printer, do the

following:

1. Start SMIT:

  # smit server

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.

Page 72: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 72/185

The AIX/HP-UX Interoperability Guide

66

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 server’s 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.

 Local Workstation Setup

1. Start SMIT:

  # smit rq

2. Select Add a Remote Queue. Fill in the following required values:

* NAME of queue to add []* DESTINATION HOST for remote jobs []* Pathname of the SHORT FORM FILTER for queue [/usr/lpd/aixshort] +/

status output* Pathname of the LONG FORM FILTER for queue [/usr/lpd/aixlong] +/

status output* Name of QUEUE on remote printer []* NAME of device to add []* BACKEND PROGRAM pathname [/usr/lpd/rembak]

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 server’s 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:

# lpstatQueue Dev Status Job Files User PP % Blks Cp Rnk------- ----- ------- --- ------------- ---------- ---- -- ----- --- ---rps1 drps1 READYlp0 dlp0 READY

Page 73: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 73/185

Printing

67

In this case queue rps1 prints to the remote queue lp0. Both queues service the same print job.

 Printing to a Network-based Printer 

AIX supports network-based printing if the networked printer supports a JetDirect card. For other

types of cards or network printers, you need to install the appropriate software that comes with the

card or printer. You use the mkvirprt command to create a virtual printer and associated queue tothe network-based printer. For example, if you were to run mkvirprt for an HP LaserJet IIIsi that

was hooked directly on the network, you would do the following:

# smit mkvirprt

You would then see the following screen:

No. Description1 Printer or Plotter Attached to Host2 Printer or Plotter Attached to Xstation3 Printer or Plotter Attached to ASCII Terminal4 Network Printer (Hewlett-Packard JetDirect)

Enter number from list above (press Enter to terminate): -> 4Enter 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. BOOTP/TFTP Server1 Make this system a BOOTP/TFTP server2 Do NOT make this system a BOOTP/TFTP server

Enter number from list above (press Enter to terminate): -> 2

The next screen displays possible printers. The example that follows shows a list that has beenscrolled through a few times:

45 IBM 7372 Color Plotter [ 44 more ]46 Canon Laser Shot LBP-B406S/D/E, A404E, A304E47 Dataproducts BP2000 Line Printer48 Dataproducts LZR 2665 Laser Printer49 Hewlett-Packard LaserJet II50 Hewlett-Packard LaserJet III51 Hewlett-Packard LaserJet IIISi52 Hewlett-Packard LaserJet 453 OKI MICROLINE 801PS54 Printronix P9012 Line Printer

55 Plotter56 PostScript Printer57 Bull PR-8858 ASCII printer59 Bull Compuprint Pagemaster 201 in HP-II Mode60 Bull Compuprint Pagemaster 411 in HP-II Mode

Enter number from list above (press Enter to terminate): -> 51

Page 74: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 74/185

The AIX/HP-UX Interoperability Guide

68

After choosing number 51 we get the following:

Hewlett-Packard LaserJet IIISiHeader 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)Should this queue be the default queue? -> (y) nhplj-3si (PostScript) configured for print queue ps-------------------- PCL --------------------Enter print queue name (or, ! to bypass configuration): -> (pcl)Should this queue be the default queue? -> (y) yhplj-3si (PCL) configured for print queue pcl

Press Enter to continue.

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@p2410l3siheader = nevertrailer = neverbackend = /usr/lib/lpd/pio/etc/piojetd p2410l3si

ps:device = hp@p2410l3si

hp@p2410l3si:file = /var/spool/lpd/pio/dev/hp@p2410l3siheader = nevertrailer = neverbackend = /usr/lib/lpd/pio/etc/piojetd p2410l3si

The lpstat command displays:

# lpstatQueue Dev Status Job Files User PP % Blks Cp Rnk------- ----- --------- --- --------- ---------- ---- -- ----- --- ---pcl hp@p2 READYps hp@p2 READY

Both queues are for the same network-based printer. At this point you would submit jobs to the

appropriate queue, either PCL or PostScript.

Page 75: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 75/185

Printing

69

AIX Print Commands

Submit print jobs Status print jobs Cancel print jobs

enq enq -A enq -x

qprt qchk qcan

lp lpstat lpq

lpr lpq lprm  

Queue Management Commands

To bring down the printer but not its queue:

# qadm -D Queue

To bring down the printer and kill all current jobs:

# qadm -K Queue

To kill all current jobs:

# qadm -X Queue

To bring down the entire queuing system, allowing queued jobs to finish before doing so:

# qadm -G Queue

To bring the queuing system back up:

# qadm -U 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

Page 76: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 76/185

The AIX/HP-UX Interoperability Guide

70

• Local printer

• Remote printer

• Print request identification number

 Printer NamesWhen 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:

laser1laser2

phredletterheadinvoicescheck_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: laserlaser1laser2phred

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 re-

add without specifying a printer class

Page 77: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 77/185

Printing

71

 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: laserlaser1laser2phredinvoicescheck_printerletterhead

System Default Printer (Destination)

You can appoint one of the print destinations in your lp spooler to be the system default printer. It

is not necessary to have a system default printer, but it is recommended. A system default printer

receives any print requests that are not sent to a specific print destination. You can have only one

system default printer.

In addition to, or instead of, a system default printer, you can assign each user a default printer to

use. To do this, simply set the user’s LPDEST shell environment variable to the name of the

system default printer. If LPDEST is set and a user does not specify a different printer to use, the

printer referenced by LPDEST will be used. If LPDEST is not set for a user, and the user does not

specify a printer, the system default printer (if one is set) will be used. If neither LPDEST or the

system default printer is set, a user must specify a printer (or printer class).

 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 inthe /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.

Page 78: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 78/185

The AIX/HP-UX Interoperability Guide

72

If you list the /usr/spool/lp/model directory, it should look similar to this:

HPGL1 draftpro hp2560 hp2932a hp7596aHPGL2 dumb hp2563a hp2934a laserjetPCL1 dumbplot hp2564b hp33440a laserjetIIISPCL2 fonts hp2565a hp33447a paintjetPCL3 hp2225a hp2566b hp3630a quietjet

PCL4 hp2225d hp2567b hp7440a rmodelPRINT3K.model hp2227a hp2631g hp7475a rmttroffbf_remote hp2228a hp2684a hp7550a ruggedwritercolorpro hp2235a hp2686a hp7570a thinkjetdeskjet hp2276a hp2686a.pif hp7595a

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 printersupplier 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 devicefile naming convention.

When you configure a printer into your lp spooler, you must supply the name of your printer’s

device file.

 Line Printer Scheduler 

The line printer scheduler is the heart of the lp spooler. It is the part of the lp spooler that prevents

intermixed listings (output from more than one print request mixed together on a printed page) and

controls flow of print requests to the printers. Its duties also include monitoring printer and print

request priorities, monitoring/adjusting printer status, and logging lp spooler activities. The

lpsched command starts the lp spooler. Because of the central role it plays, starting lpsched is

referred to as “starting the lp spooler”, and stopping lpsched is often referred to as “stopping thelp spooler.” You can use the lpsched command directly or through SAM.

 Local Printer 

A local printer is a printer that is physically connected to your system.

Page 79: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 79/185

Printing

73

 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.

 Print Request Identification Number 

When you submit a print request by means of the lp command, lp responds with a print request

identification number consisting of the name of the printer (or printer class) followed by a number.

Here are some examples of typical print request identification numbers:

laser-3456phred-2152letterhead-1547

 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 system’s 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 requestsarrive, 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 intoyour 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/sinterfacedirectory and is given the same name as the printer.

Page 80: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 80/185

The AIX/HP-UX Interoperability Guide

74

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.

Setting Up the LP Spooler Using SAM

 Adding a Local Printer 1. Physically connect the printer(s) to your system. Refer to the instructions shipped with

your printer. You should always shut down your system and turn off the power when you

are changing the hardware configuration of your system.

2. Gather the following information:

• 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, a-

z, 0-9). The underscore (_) character is allowed in printer class names.

• In addition, decide whether to make this device your system’s 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.

Page 81: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 81/185

Printing

75

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.

 Adding a Remote Printer 

1. Ensure that the remote system has the printer installed and configured into the remote

system’s line printer spooler system. Gather the following information:

2. The name you are giving to this printer or plotter.

• Whether you wish to make this device your system’s 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 

Page 82: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 82/185

The AIX/HP-UX Interoperability Guide

76

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.

 Adding a Network-Based Printer 

To add a network-based printer or plotter using SAM:

1. Ensure that the printer is connected to the network according to the installation instructions

shipped with the network-based printer or the network interface card for the printer.

2. Gather the following information:

• 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 system’s 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.

Starting and Stopping the LP Spooler 

To start 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 Start up printer spooler from the Actions menu.

Page 83: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 83/185

Printing

77

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.

 Determining the Status of the LP Spooler 

To determine the status of 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. The status area of the object list will display the status of the scheduler as Scheduler:

RUNNING or Scheduler: STOPPED.

 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.

Page 84: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 84/185

The AIX/HP-UX Interoperability Guide

78

5. Highlight the printer you want to enable in the object list.

6. Choose Enable printer from the Actions menu.

Setting Up the LP Spooler Using HP-UX Commands

 Adding a Local Printer To add a local printer using HP-UX commands:

1. Ensure that you have superuser capabilities.

2. Ensure the printer driver is in the kernel.

3. Ensure a device file exists for the printer.

4. Stop the lp spooler with the lpshut command:

  # /usr/lib/lpshut

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 -p pname -vdevfile -m  model [-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 printer’s 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

Start the line printer scheduler with the lpsched command:

/usr/lib/lpsched

Examples

To determine the status of the lp spooler:

# /usr/bin/lpstat -rscheduler is running

To stop the lp spooler:

Page 85: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 85/185

Page 86: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 86/185

The AIX/HP-UX Interoperability Guide

80

# /usr/bin/enable pname

Start the line printer scheduler with the lpsched command:

# /usr/lib/lpsched

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 usethree-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 determine the lp spooler status:

# /usr/bin/lpstat -rscheduler is stopped

To add a remote printer, referred to locally as letterhead, physically connected to the system hypo2that 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

To enable the newly added remote printers:

# /usr/bin/enable letterhead

# /usr/bin/enable remote_drafts

To start the line printer scheduler, type:

# /usr/lib/lpsched

 Adding a Network-Based Printer 

To add a network-based printer or plotter using HP-UX commands, follow the instructions shipped

with the network-based printer or the network interface card for the printer.

The software needed to configure your network-based printer is shipped separately. Follow the

instructions shipped with your printer to load the software and configure the printer.

 Accepting and Rejecting Print Requests for a Printer 

To accept print requests for a printer or printer class, use the accept command:

Page 87: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 87/185

Printing

81

# /usr/lib/accept name

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

 Enabling or Disabling a Printer 

To enable a printer to process print requests, use the enable command:

# /usr/bin/enable pname

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

To enable the check_printer, laser1, laser2, and phred printers:

# /usr/bin/enable check_printer

# /usr/bin/enable laser1 laser2 phred

To disable the check_printer, invoices, phred, letterhead, and laser printers:

# /usr/bin/disable check_printer

# /usr/bin/disable invoices phred letterhead

# /usr/bin/disable -r "printer disabled to change paper" laser1

Page 88: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 88/185

The AIX/HP-UX Interoperability Guide

82

Starting and Stopping the LP Spooler 

To start the lp spooler, use the lpsched command:

# /usr/lib/lpsched

To stop the lp spooler, use the lpshut command:

# /usr/lib/lpshut

Canceling Print Requests

To cancel print requests, use the cancel command:

# /usr/bin/cancel req-ID [ printer ]

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 Remove all requests a user owns on the specific printer. The owner is determined by the

user’s login name and host name on the machine where the lp command was invoked

-e Empty the spool queue of all requests for the specified printer. Only users with

superuser capabilities can use the -e option

-i Cancel only local requests.

-u user 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

Viewing the Status of Printers and Print Requests

To view the status of printers and print requests, use the lpstat command:

# /usr/bin/lpstat [-t]

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

Page 89: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 89/185

Printing

83

• 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

8.3 Interplatform Printing 

AIX can print to an HP-UX print server and vice versa. For this to work you must verify the

following:

1. Basic network connectivity between the workstations

2. Each print server has the appropriate entries in either /etc/hosts.equiv or /etc/hosts.lpd.

3. For the queue of the AIX client printing to an HP-UX print server, use the following for

filters in /etc/qconfig:

  /usr/lpd/attshort

  /usr/lpd/attlong

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.

Page 90: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 90/185

Page 91: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 91/185

Configuring TCP/IP

85

9. Configuring TCP/IP

9.1 AIX 

AIX supports a number of different networking technologies, including Ethernet, Token-ring, andFiber 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.

Basic TCP/IP Configuration

1. Start SMIT:

  # smit mktcpip

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 system’s IP address. For the

CABLE Type field, bnc specifies thin cable and dix specifies thick; for other types,choose N/A.

Page 92: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 92/185

The AIX/HP-UX Interoperability Guide

86

 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.

[Entry Fields]* HOSTNAME [a2410bjv]* Internet ADDRESS (dotted decimal) [15.24.48.58]Network MASK (dotted decimal) [255.255.248.0]

* Network INTERFACE en0NAMESERVER

Internet ADDRESS (dotted decimal) [15.41.144.101]DOMAIN Name [nsr.hp.com]

Default GATEWAY Address [15.24.55.253](dotted decimal or symbolic name)Your CABLE Type N/A +START Now no +

Setting the Hostname

To set or reset your host’s name,

1. Start SMIT:

  # smit hostname

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.

Page 93: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 93/185

Configuring TCP/IP

87

Add Static Route

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]Destination TYPE net +

* DESTINATION Address [](dotted decimal or symbolic name)

* Default GATEWAY Address [](dotted decimal or symbolic name)

* METRIC (number of hops to destination gateway) [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

Flushing the Routing Table

To flush the routing table,

1. Start SMIT:

  # smit fshrttbl

2. This produces the following:

Flush Routing Table

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]Flush Routing Table in the Current Running System yes +Flush Routing Table in the Configuration Data Base no +(effective in the next system restart)

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.

Changing Network Card ConfigurationTo alter the configuration of a network card, do the following:

1. Start SMIT:

  # smit chinet

2. Select the appropriate interface in the Available Network Interfaces menu.

Page 94: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 94/185

The AIX/HP-UX Interoperability Guide

88

3. Make the appropriate changes as needed. If you leave the BROADCAST ADDRESSfield 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.

[Entry Fields]Network Interface Name en0INTERNET ADDRESS (dotted decimal) [15.24.48.58]Network MASK (hexadecimal or dotted decimal) [255.255.248.0]Current STATE up +Use Address Resolution Protocol (ARP)? yes +BROADCAST ADDRESS (dotted decimal) []

Removing Network Card Configuration

There is no SMIT fastpath option to removing an interface. Instead,

1. Start SMIT:

  # smit inet

2. Select the Remove a Network Interface option.

3. Select the appropriate interface.

CAUTION: SMIT removes the interface without prompting!

Managing Name ServersTo edit /etc/resolv.conf :

1. Start SMIT:

  # smit resolv.conf

2. This produces the following:

Page 95: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 95/185

Configuring TCP/IP

89

Domain Nameserver (/etc/resolv.conf)

Move cursor to desired item and press Enter.

Start Using the NameserverList All NameserversAdd a NameserverRemove a NameserverStop Using a Nameserver-------------------------------Set / Show the DomainRemove the Domain

Use this as a means to edit the /etc/resolv.conf file or use a text editor to do so.

Adding Entries to /etc/hosts

1. Start SMIT:

  # smit hostent

2. This produces the following:

Hosts Table (/etc/hosts)

Move cursor to desired item and press Enter.

List All HostsAdd a HostChange / Show Characteristics of a HostRemove a Host

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

2. This produces the following:

Page 96: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 96/185

The AIX/HP-UX Interoperability Guide

90

inetd Subservers

Move cursor to desired item and press Enter.

List All inetd SubserversAdd an inetd SubserverChange / Show Characteristics of an inetd SubserverRemove 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.

Editing the /etc/services File

You can use SMIT to edit /etc/services and at the same time ensure that the ODM database is

updated.

1. Start SMIT:  # smit inetserv

2. This produces the following:

Services (/etc/services)

Move cursor to desired item and press Enter.

List All ServicesAdd a ServiceChange / Show Characteristics of a Service

Remove a Service

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

2. This produces the following:

Page 97: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 97/185

Configuring TCP/IP

91

Host Access (/etc/host.equiv)

Move cursor to desired item and press Enter.

List All Remote HostsAdd a Remote HostRemove a Remote Host

Follow the menus to make the changes you desire.

Editing /etc/ftpusers

To edit /etc/ftpusers:

1. Start SMIT:

  # smit ftpusers

2. This produces the following:

Restrict File Transfer Program Users (/etc/ftpusers)

Move cursor to desired item and press Enter.

Show All Restricted UsersAdd a Restricted UserRemove a Restricted User

Managing Other Services

1. Start SMIT:  # smit otherserv

2. This produces the following:

Other Available Services

Move cursor to desired item and press Enter.

Super Daemon (inetd)syslogd Subsystem routed Subsystem 

gated Subsystem named Subsystem rwhod Subsystem timed Subsystem portmap Subsystem (information only)

Page 98: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 98/185

The AIX/HP-UX Interoperability Guide

92

Using BSD Style rc Configuration

The AIX style of TCP configuration is to use the ODM configuration information. Upon bootup

the /etc/rc.net file runs methods to configure the network card and set the hostname, default

gateway, and routes based upon the ODM database. If you would prefer not to use the ODM to do

this, you can elect to have a BSD style of TCP configuration. BSD style uses the ifconfig

command and reads /etc/rc.bsdnet to configure the network card. To elect BSD style,

1. Start SMIT:

  # smit setbootup_option

2. Choose yes and press enter at the following screen:

Select BSD style rc Configuration

Please answer yes if you want BSD style rc configuration.The default is no.

Default style configuration uses the data in the ODM database anduses the file /etc/rc.net to define, load, and configure a correspondinginterface.

BSD style configuration uses the traditional ifconfig command and ituses the file /etc/rc.bsdnet to configure the corresponding interface.

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]Use BSD Style rc Configuration no +

A caveat about the above procedure: after selecting yes you will not have System Resource

Controller (SRC) support. In other words, you can’t 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

Page 99: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 99/185

Configuring TCP/IP

93

# 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 addingconnectivity information about, SAM will prompt you for the gateway’s 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.

Page 100: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 100/185

The AIX/HP-UX Interoperability Guide

94

• 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.

Specifying a New Default Gateway

To replace the current default gateway (if there is one), select the Modify Default Gateway Action

from the Internet Connectivity menu (under the Remote System Connectivity area).

Deleting the Default Gateway

If you want to delete the default gateway that you added with SAM’s Specify the Default

Gateway form, you must do it manually with the following:

Enter the following command at the HP-UX prompt:

/etc/route delete default gateway_hostname

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.secfile 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

service’s 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.

Page 101: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 101/185

Configuring TCP/IP

95

 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.

Setting the Maximum Number of Remote Connections

If you choose to put a limit on the number of services that can be used remotely at any one time,use the following entry in the first line of  /usr/adm/inetd.sec:

MAXNUM number

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.

 Allowing and Denying Nodes Access to Services.

You can allow and deny remote systems access to local ARPA Services by using SAM or by

manually editing the /usr/adm/inetd.sec file.

Using SAM to Edit /usr/adm/inetd.sec

SAM does not allow you to set the maximum number of connections by which remote users access

local services. If you want to set this number, edit /usr/adm/inetd.sec manually.

The following steps tell how to use SAM to allow or deny remote systems access to local ARPA

Services:

1. Start SAM.

2. Select the Networking/Communications menu item.

3. Select the Security menu item.

4. Select the Internet Service menu item.

5. To modify a single service, highlight it, and then select the Modify action item.

Alternatively, you can choose the Modify All Services action to change security for all

services.

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 access to other local ARPA

Services.

9. Exit the Internet Service screen by selecting exit from the List menu. From the Securityscreen, select Exit SAM to exit from SAM.

Page 102: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 102/185

The AIX/HP-UX Interoperability Guide

96

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.

Using SAM to Create /etc/ftpusersYou can use SAM to create /etc/ftpusers or you can manually create and edit this file.

1. Start SAM.

2. Select the Networking/Communications menu item.

3. Select the Security menu item.

4. Select the Internet Service menu item.

5. Select the ftp service and choose the Modify action. Highlight the “Select Denied Users”

item and fill in the list of users you wish to deny access to the ftp service. Select Add to

add each user to the list.

6. Select OK when you are done with the screen.

7. Exit the Internet Security screen by selecting exit from the List menu. From the Securityscreen, select Exit SAM to exit from SAM.

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 ashortcut 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 Securityscreen, select Exit SAM to exit from SAM.

Page 103: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 103/185

Configuring TCP/IP

97

• 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.

Creating a .rhosts File for the Local Superuser Account.You can use SAM to create a $HOME/.rhosts file for the local superuser account only. (You

cannot create $HOME/.rhosts files for local non-superuser accounts with SAM.)

If you have already manually configured a $HOME/.rhosts file and did not use entries of the

following forms hostname or hostname username do not use SAM to configure $HOME/.rhosts.

SAM does not recognize, display or add entries of other forms (such as +, -, %, or

+@example_nfsnetgroup).

The following steps tell how to use SAM to let a remote system’s user(s) become superuser on

your local host without having to enter a password:

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.

• 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.

Networking Startup Files

The /etc/rc script is executed when your system boots. It calls the /etc/src.sh file to set the

hostname of your system. The /etc/rc script calls the /etc/netlinkrc script which initializes your

networking. If you configure networking manually, this is the script to modify. The following areincluded in /etc/netlinkrc:

 /etc/nettl, the logging daemon

 /etc/ifconfig

 /etc/lanconfig

 /etc/route

Page 104: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 104/185

The AIX/HP-UX Interoperability Guide

98

 /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 requirethe 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.

Page 105: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 105/185

 Domain Name Service

99

10. Domain Name Service

10.1 AIX 

named Data Files

AIX suggests the following naming convention for named data files, though you can use whatever

scheme suits you:

1. Names and internet addresses of the root name servers: named.ca

2. Address resolution information for local loopback: named.domain_namelocal

3. Address resolution data for all machines in the zone: named.domain_namedata

4. Reverse address resolution information: named.domain_namerev

These files are usually found in the /etc directory.

 Note: AIX provides sample configuration files in the /usr/lpp/tcpip/samples directory.

Configuring a Primary Name Server

1. Edit the /etc/named.boot file, being sure to include the following:

• Name of the default domain

• Primary name server designation and names of named hosts data file and namedreverse 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.

4. Edit the /etc/named.domain_namedata file. Include the following:

• 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 server’s zone of authority

• Name server records for all primary name servers in the zone

5. Edit the /etc/named.domain_namerev file. Include the following:

• Start of authority of the zone and the default time to live information

Page 106: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 106/185

The AIX/HP-UX Interoperability Guide

100

• Address to name resolution information on all hosts to be in the name server’s zone of 

authority

6. Create an empty /etc/resolv.conf file by issuing the following command:

# touch /etc/resolv.conf

7. Enable the named daemon using the following SMIT fastpath:

# smit stnamed

You get the following:

Start Using the named Subsystem 

Move cursor to desired item and press Enter.

NOWNext System RESTARTBOTH

If you choose BOTH, SMIT starts named and then edits /etc/rc.tcpip to get it to start up on each

boot.

Configuring a Secondary Name Server

1. Edit the /etc/named.boot file. This is the same as for a primary server except that you

must include secondary lines for each of the domains for which the secondary server is

responsible and a secondary line to define the reverse name resolution information. Also,

you should include a primary line for the /etc/named.domain_namelocal file.

2. Edit the /etc/named.ca file.

3. Edit the /etc/named.local file.

4. Create an /etc/resolv.conf file by issuing the following command:

# touch /etc/resolv.conf

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

Configuring a Cache-Only Name Server

1. Edit the /etc/named.boot file. Specify a name server type of primary with a source of  /etc/named.local as well as the domain for which the name server will be responsible.

2. Edit the /etc/named.ca file.

3. Edit the /etc/named.local file.

4. Create a /etc/resolv.conf file by issuing the following command:

# touch /etc/resolv.conf

Page 107: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 107/185

Page 108: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 108/185

Page 109: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 109/185

 Domain Name Service

103

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.

Configuring a Secondary Name Server

A secondary server can use the same db.cache and db.127.0.0 files as the primary server, but

requires a different named.boot file. The named.boot file lists the IP addresses of servers from

which the secondary server gets its information. You can create the named.boot file by running

hosts_to_named, or by creating the file manually.

Creating the Boot File with hosts_to_named 

When used with the -Z and/or -z options, hosts_to_named uses the primary server’s named.bootfile to create two secondary boot files: boot.sec.save and boot.sec. With boot.sec.save, the server

saves a backup copy of the information loaded over the network. With boot.sec, the server does

not save a backup copy. The -Z and -z options are used to list the IP addresses of servers from

which the secondary server gets its information.

To configure the secondary server, copy db.cache, db.127.0.0, and either boot.sec.save or

boot.sec to the host that will run the secondary server. Then rename boot.sec.save or boot.sec to

 /etc/named.boot.

Configuring a Caching Only Name Server

No special line in the boot file is required to designate a server as caching only. Rather, caching

only is indicated by the absence of primary or secondary lines in the boot file. The only primary

line indicates the in-addr.arpa domain (the loopback interface), for which all name servers must be

authoritative.

To create a caching only server, do not run hosts_to_named again. Instead, copy boot.cacheonly,db.127.0.0, and db.cache from the primary server. Rename boot.cacheonly to /etc/named.boot.

Setting Up a Remote Name Server

If you want the resolver routines to use a remote server instead of a local server, you need to create

 /etc/resolv.conf . This file designates which name servers on the network should be sent queries. If 

you are running a local server, creating this file is not advisable, as it is read every time

gethostbyname or gethostbyaddr is called--though several applications (like HP VUE) do not

work without /etc/resolv.conf when running a name server.

 /etc/resolv.conf has three configuration options:

domain followed by the default domain name. The domain entry is needed only when thehostname (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.

Page 110: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 110/185

The AIX/HP-UX Interoperability Guide

104

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.

Setting the Local Domain

When you use domain names that are not fully qualified, the resolver completes the names with the

local domain. To do this, the resolver must know what the local domain is.

There are two ways in which you can set the local domain:

1. Set the hostname of the local system (hostname) to be a domain name without a trailing

dot. For example, you would set the hostname in /etc/rc for the machine indigo in the

domain div.inc.rom as follows:hostname indigo.div.inc.com 

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 

Starting the Primary Server

After you have created the primary name server’s boot file and domain data files, you are ready to

start the primary server and begin using the BIND name service. Before you start the name server,

make sure syslogd is running.

To start the name server, type the following:

# /etc/named

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.

Maintaining Network and Domain Data Files

Once the name server is running, you may need to update network-related files to contain domainnames. Flat or string-type hostnames which are not hosts in the local domain must be converted to

domain names in the following files: all $HOME/.rhosts files, all $HOME/.netrc files,

 /etc/hosts, /etc/hosts.equiv, and /usr/adm/inetd.sec.

When you convert the flat names to domain names, you must be sure that the domain name

contains every label from the host to the top-level domain. However, do not end the domain name

with a dot. For example, in an .rhosts file, do not use:

Page 111: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 111/185

 Domain Name Service

105

indigo.div.inc.com. fred

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, acceptsinput 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.

Updating Domain Data Files

As the composition of your network changes, you may need to add or remove hosts.

NOTE: After modifying the domain data files, the name server must be restarted so that the files

are reread. You can use either kill -1 process-id or sig_named restart for this purpose. Both

signal the name server to reload its database. Refer to the sig_named entry in the HP-UX

Reference.

 Adding or Deleting a Host 

There are two ways to add or delete a host.

1. Add or delete the host to /etc/hosts and run hosts_to_named again.

2. Add or delete the host manually.

Name Resolution Order

If you are using DNS, the resolver attempts to find addresses in the following order:

1. The name server

2. The local /etc/hosts file

If you are using network information service (NIS) for name resolution, the name resolution order

is:

1. The name server

2. NIS

3. The local /etc/hosts file

Page 112: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 112/185

The AIX/HP-UX Interoperability Guide

106

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 HP-UX name and location

/etc/resolv.conf /etc/resolv.conf

/usr/sbin/named /etc/named

/usr/sbin/named-xfer /etc/named-xfer

/etc/named.boot /etc/named.boot

/etc/named.ca /etc/named.data/db.cache

/etc/named.local /etc/named.data/db.127.0.0

/etc/named.data /etc/named.data/db.[domain]

/etc/named.rev /etc/named.db.[net]

Page 113: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 113/185

 NIS 

107

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_ix26157aliases.timebindinggroup.timehosts.timenetid.timepasswd.time

protocols.timepublickey.timerpc.timeservices.timeupdaters

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/mkmasterchslave -> /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/mrgpwdrevnetgroup -> /usr/sbin/revnetgrouprmkeyserv -> /usr/sbin/rmkeyservrmyp -> /usr/sbin/rmypstdethers -> /usr/sbin/stdethers

stdhosts -> /usr/sbin/stdhostsudpublickey -> /usr/sbin/udpublickeyypinit -> /usr/sbin/ypinityppoll -> /usr/sbin/yppollyppush -> /usr/sbin/yppushypset -> /usr/sbin/ypsetypxfr -> /usr/sbin/ypxfrypxfr_1perday -> /usr/sbin/ypxfr_1perdayypxfr_1perhour -> /usr/sbin/ypxfr_1perhourypxfr_2perday -> /usr/sbin/ypxfr_2perday

Page 114: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 114/185

The AIX/HP-UX Interoperability Guide

108

Also, the yp commands in /usr/etc are actually links:

rpc.yppasswdd -> /usr/lib/netsvc/yp/rpc.yppasswddrpc.ypupdated -> /usr/lib/netsvc/yp/rpc.ypupdatedypbind -> /usr/lib/netsvc/yp/ypbindypserv -> /usr/lib/netsvc/yp/ypserv

Master Server Configuration

You can use SMIT to configure NIS or you can do so manually. If you do a manual configuration,

the process is the same as in HP-UX, with the exception of starting the yp daemons.

 Restricting Access to the Master Server 

You can use a password file other than /etc/passwd. To do so,

1. Edit the /etc/rc.nfs file and change the following stanza:

  DIR=/etc

  if [ -x /usr/etc/rpc.yppasswdd -a -f $DIR/passwd ]; then  startsrc -s yppasswdd

  fi

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'

Creating an NIS Master Server 

1. If you haven’t done so already, set the domain name:

  # smit chypdom 

2. Start SMIT:

  # smit mkmaster

3. You will see the following:

Page 115: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 115/185

 NIS 

109

Configure this Host as a NIS Master Server

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]HOSTS that will be slave servers []

* Can existing MAPS for the domain be overwritten? yes +* EXIT on errors, when creating master server? yes +* START the yppasswdd daemon? no +* START the ypupdated daemon? no +* START the ypbind daemon? yes +* START the master server now, both +

at system restart, or 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 that’s 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 daemonsfor 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.

Creating an NIS Slave

1. If you haven’t done so already, set the domain name:

  # smit chypdom 

2. Start SMIT:

 # smit mkslave

3. You will see the following:

Configure this Host as a NIS Slave Server

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]* HOSTNAME of the master server []* Can existing MAPS for the domain be overwritten? yes +* START the slave server now, both +

at system restart, or both?* Quit if errors are encountered? yes +

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.

Creating an NIS Client

1. If you haven’t done so already, set the domain name:

Page 116: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 116/185

The AIX/HP-UX Interoperability Guide

110

  # smit chypdom 

2. Start SMIT:

  # smit mkclient

3. You will see the following:

Configure this Host as a NIS Client

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]* START the NIS client now, both +

at system restart, or both?

Pressing Enter at this point starts ypbind and edits /etc/rc.nfs.

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

2. You will see the following:

Start / Stop Configured NIS Daemons

Move cursor to desired item and press Enter.

Start the Server Daemon, ypservStart the Client Daemon, ypbindStart the yppasswdd DaemonStart the ypupdated DaemonStop the Server Daemon, ypservStop the Client Daemon, ypbindStop the yppasswdd DaemonStop the ypupdated Daemon

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

To start all yp daemons:

# startsrc -g yp

Page 117: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 117/185

 NIS 

111

To stop a yp daemon, for example ypbind, individually:

# stopsrc -s ypbind

To start a yp daemon, for example ypserv, individually:

# startsrc -s ypserv

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 elmofi

...

if [ -x /usr/etc/ypserv -a -d /etc/yp/`domainname` ]; thenstartsrc -s ypserv

fi

if [ -x /usr/etc/ypbind ]; thenstartsrc -s ypbind

fi

if [ -x /usr/etc/keyserv ]; thenstartsrc -s keyserv

fi

if [ -x /usr/etc/rpc.ypupdated -a -d /etc/yp/`domainname` ]; thenstartsrc -s ypupdated

...

#Uncomment the following lines to start up the NIS#yppasswd daemon.DIR=/etcif [ -x /usr/etc/rpc.yppasswdd -a -f $DIR/passwd ]; then

startsrc -s yppasswddfi

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: Makefilelongfiles

 makedbm  mkaliasrevnetgroupstdhostsypinitypmake

Page 118: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 118/185

The AIX/HP-UX Interoperability Guide

112

yppollyppushypserv.logypsetypxfrypxfr.log

ypxfr_1perdayypxfr_1perhourypxfr_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.

Master Server ConfigurationYou must be superuser to create an NIS master server (i.e., to build the NIS master databases).

You should also be in a single user state of operation.

 Preparations for Creating an NIS Master Server.

1. Perform the following steps before creating your master server:

2. Ensure /etc files are complete and current: passwd, hosts, group, networks, protocols,

rpc, and services.

3. If you know the correct configuration, create the /etc/netgroup file. (See netgroup(4) in

the HP-UX Reference.)

 Restricting Access to the Master Server 

If you want to restrict access to the master server to a smaller set of users than defined by the

complete /etc/passwd file, perform the following steps:

1. Copy the entire /etc/passwd file to a different file (e.g., /etc/passwd.nis).

2. Delete undesired users from the original /etc/passwd file. To prevent all entries in the NIS

passwd map from being able to log in, this smaller file should not include the following

line:

  +::0:0:::

  Edit /usr/etc/yp/ypinit. Change the line containing:

  PWFILE=/etc/passwd

  TO:

  PWFILE=/etc/passwd.nis

3. Edit /etc/netnfsrc as follows:

Page 119: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 119/185

 NIS 

113

  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

4. If you have rpc.yppasswdd running, kill and restart it.

# /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

Creating an NIS Master Server 

1. Set the NIS domain name using the domainname command.  # domainname nis_domain_name

2. Execute ypinit with the -m parameter in one of two ways:

• 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.

 Manually Starting the NIS Master Server 

1. If you have not already done so, set the NIS domain name using the domainnamecommand. This NIS domain name must be the same one used for all clients and servers

within this NIS domain.

Page 120: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 120/185

The AIX/HP-UX Interoperability Guide

114

  # domainname nis_domain_name

2. Execute ypserv.

  # /usr/etc/ypserv

3. Execute ypbind.

  # /etc/ypbind

Starting the NIS Master Server on System Restart 

1. Edit /etc/netnfsrc:

• 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 NIS domain name:

 

NISDOMAIN=nis_domain_name  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

4. Set the NIS_SLAVE_SERVER to zero to disable the node as a slave server:

  NIS_SLAVE_SERVER=0

5. Set NIS_CLIENT to a value other than zero:  NIS_CLIENT=1

Creating an NIS Slave Server

1. Set the NIS domain name using the domainname command. This NIS domain name must

be the same one used for all clients and servers within this NIS domain:

  # domainname nis_domain_name

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.

Page 121: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 121/185

 NIS 

115

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.

 Manually Starting the NIS Slave Server 

1. If you have not already done so, set the NIS domain name using the domainnamecommand. This NIS domain name must be the same one used for all clients and servers

within this NIS domain.

 

# domainname nis_domain_name

2. Execute ypserv.

  # /usr/etc/ypserv

3. Execute ypbind.

  # /etc/ypbind -ypsetme

Starting NIS Slave Server on System Restart 

1. Go into /etc/netnfsrc.

A zero in the NIS_CLIENT, NIS_MASTER_SERVER, orNIS_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

3. Set the NIS_MASTER_SERVER to zero to disable the node as a master server.

  NIS_MASTER_SERVER=0

4. Set NIS_SLAVE_SERVER to a value other than zero.

  NIS_SLAVE_SERVER=1

5. Set NIS_CLIENT to a value other than zero.

  NIS_CLIENT=1

Creating an NIS Client.

Customize the following files that traditionally store the information:

Page 122: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 122/185

The AIX/HP-UX Interoperability Guide

116

/etc/passwd/etc/group/etc/hosts/etc/protocols/etc/netgroup/etc/rpc

/etc/networks/etc/services

 Manually Starting the NIS Client 

1. If you have not already done so, set the NIS domain name using the domainnamecommand. This NIS domain name must be the same one used for all clients and servers

within this NIS domain.

  # domainname nis_domain_name

2. Execute ypbind.

  # /etc/ypbind -ypsetme

Starting the NIS Client on System Restart 

1. Edit /etc/netnfsrc.

2. Set NISDOMAIN to the same NIS domain name used on all clients and servers within

this NIS domain.

  NISDOMAIN=nis_domain_name

3. Set NIS_CLIENT to a value other than zero.

 

NIS_CLIENT=1Note: 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.

Page 123: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 123/185

 NFS 

117

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 nfsdand 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

3. Run the chssys command, for example:

  # chssys -s biod -a6

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, inthis 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 -scommand. 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 bothfield. 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.

Page 124: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 124/185

The AIX/HP-UX Interoperability Guide

118

Configuring an NFS Server

To configure an NFS server in AIX, all you do is create an  /etc/exports file and then run smit

mknfs. You can use a text editor to create /etc/exports or you can do the following:

1. Run SMIT:

  # smit mknfsexp

2. You will see the following:

Add a Directory to Exports List

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]* PATHNAME of directory to export [] /* MODE to export directory read-write +HOSTNAME list. If exported read-mostly []

Anonymous UID [-2]HOSTS allowed root access []HOSTS & NETGROUPS allowed client access []Use SECURE option? no +

* EXPORT directory now, system restart or both both +PATHNAME of Exports file if using HA-NFS []

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

2. You will see the following:

Start NFS

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]* START NFS now, on system restart or both both +

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.

Page 125: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 125/185

 NFS 

119

Configuring an NFS Client

You can use the same procedure as above, run smit mknfs to start the NFS daemons—and in the

case of an NFS client the biods are the only ones you might want—or you can simply start making

NFS mounts from a server by doing the following:

1. Start SMIT:

  # smit mknfsmnt

2. You will see the following:

Add a File System for Mounting

Type or select values in entry fields.Press Enter AFTER making all desired changes.

[Entry Fields]* PATHNAME of mount point [] /* PATHNAME of remote directory []* HOST where remote directory resides []

Mount type NAME []* Use SECURE mount option? no +* MOUNT now, add entry to /etc/filesystems or both? now +* /etc/filesystems entry will mount the directory no +

on system RESTART.* MODE for this NFS file system read-write +* ATTEMPT mount in foreground or background background +NUMBER of times to attempt mount [] #

Buffer SIZE for read [] #Buffer SIZE for writes [] #NFS TIMEOUT. In tenths of a second [] #Internet port NUMBER for server [] #* Mount file system soft or hard hard +Allow keyboard INTERRUPTS on hard mounts? yes +

Minimum TIME, in seconds, for holding [3] #attribute cache after file modificationMaximum TIME, in seconds, for holding [60] #attribute cache after file modificationMinimum TIME, in seconds, for holding [30] #attribute cache after directory modificationMaximum TIME, in seconds, for holding [60] #attribute cache after directory modificationMinimum & Maximum TIME, in seconds, for [] #holding attribute cache after any modificationThe Maximum NUMBER of biod daemons allowed [6] #to work on this file system 

* Allow execution of SUID and sgid programs yes +in this file system?

* Allow DEVICE access via this mount? yes +* Server supports long DEVICE NUMBERS? yes +

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

Page 126: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 126/185

The AIX/HP-UX Interoperability Guide

120

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 AIX’s equivalent to HP-

UX’s /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 mountin /etc/filesystems, that entry would look something like:

/doc:dev = "/doc"vfs = nfsnodename = elmomount = falseoptions = bg,hard,intraccount = 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.

Additional SMIT Fastpath Commands

Remove an entry from the /etc/exports file:

# smit rmnfsexp

Change an exported file system:

# smit chnfsexp

Remove an NFS mount:

# smit rmnfsmnt

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.

Page 127: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 127/185

 NFS 

121

4. If you will be using NIS to administer the maps, integrate the maps with NIS.

5. Start automounter.

Configure for NFS

Configure the systems for NFS if you have not already done so.

Create the Master Map

The master map is usually created as /etc/auto.master and then made into the NIS map

auto.master. By default, automount tries to get master map information from the NIS map

auto.master. If a local master map file is specified on the command line, automount reads it

before reading the NIS auto.master map.

The format of the auto.master file is:

DirectoryPath AutomountMapName

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

Page 128: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 128/185

The AIX/HP-UX Interoperability Guide

122

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.

 Integrate with NIS

Automount maps can be local files or administered as NIS maps. By default, automount tries to

read master map information from the NIS map auto.master. Automount also reads master map

information from a local file if you specify one on the command line.

The master map can contain NIS map names for the indirect and direct maps instead of file names.

To specify an NIS map, preface the map name with a plus (+).

To create an NIS map, edit the /var/yp/Makefile:10

1. Add auto.master to the all: listing.

2. Add an entry for $(DIR)/auto.master.

3. Add the following stanza to Makefile:

  auto.master.time: $(DIR)/auto.master

  -@if [ -f $(DIR)/auto.master ]; then \

  $(MAKEDBM) $(DIR)/auto.master $(YPDBDIR)/$(DOM)/auto.master; \

  touch auto.master.time; \

  if [ ! $(NOPUSH) ]; then \

  $(YPPUSH) auto.master; \

  echo "pushed auto.master"; \

  else \

  : ; \

  fi \

  else \

  echo "couldn't find $(DIR)/auto.master"; \

  fi

4. Build the map:

  # cd /var/yp

  # make auto.master

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 doesn’t do it for

you.

 10Taken from NIS Automounter, Infoexplorer

Page 129: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 129/185

 NFS 

123

Shutting Down Automount 

Automount is normally started and stopped only when the machine is rebooted. To shut down

automount gracefully during system operation, take the following steps:

1. Make sure no processes have their current working directory set to any automount

directories or subdirectories.

2. Then, send automount the SIGTERM (-15) signal (SIGTERM is the default signal sent by

the kill command).

CAUTION: No other automount daemon should be started until the first has successfully cleaned

up and exited. If a second automount daemon is started when the first is in its shutdown process,

the second daemon will start its shutdown process. This means that there will now be four

automount daemons: the first, the second, and their children. These daemons will not exit until all

the mount directories they are serving have been unmounted.

Do not send the SIGKILL signal (kill -9, kill -KILL) to the automount daemon. This will cause

any processes accessing mount directories served by automount to hang. The file hierarchies

mounted by automount under /tmp_mnt will still be accessible.

12.2 HP-UX 

Using SAM to Configure an NFS Client

At the SAM Main window, highlight Networking/Communications and activate the OPENbutton.

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,

Page 130: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 130/185

The AIX/HP-UX Interoperability Guide

124

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 Optionswindow. 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. Softmounted 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 thetask 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.

Using SAM to Configure an NFS Server

1. At the Networking/Communications window, highlight Networked File Systems (NFS)

and activate the OPEN button.

2. Highlight Local File Systems Exported and activate the OPEN button. This edits your

 /etc/exports file.

3. To add local directories that can be exported to remote systems, choose Add from the

Actions menu and then enter the information about the directory you want to export to the

remote systems. This will take you into the Add File System to Export window.

• Enter the Local Directory Name. This the directory that will be exported to remote

systems.

• Enter an Unknown Userid. You can map anonymous, or unknown, user requests to

uid. By setting the anonymous user ID in /etc/exports, the unknown user in ananonymous request is mapped to a well-known local user. If the anonymous user is

mapped to nobody (the default), anonymous requests are accepted but have very few

permissions to access files on the server. The information you need to complete this

task is the remote system names to which you are allowing or denying access. If you

specify uid for unknown user, you will be prompted for a login name.

Page 131: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 131/185

 NFS 

125

• Select asynchronous writes. Yes means that asynchronous write will be done. Nomeans 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 youto 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.

Using SAM to Allow or Deny Access to Specific RPC services

This task lets you allow or deny access to specific RPC services (servers). When you perform this

task, you are editing the /usr/adm/inetd.sec file. The information you need to complete this task is

the remote system names to which you are allowing or denying access.To perform this task:

1. At the Networking/Communications window, highlight Security and activate the OPENbutton.

2. Highlight Internet Service and activate the OPEN button.

3. To modify RPC services, highlight the RPC services you want to modify, or you can

choose to modify all Internet Services from the Actions menu. This will take you into the

Modify Internet Security window. Select the system permissions you would like your

RPC services to have.

4. When you have completed your task, activate the OK button.

Creating an NFS Server Manually

You must be superuser to create an NFS server. To create an NFS server, complete the following

steps. These steps are described in detail in the sections that follow.

1. Edit /etc/netnfsrc.

2. Edit /etc/inetd.conf (optional).

3. Edit /usr/adm/inetd.sec (optional).

4. Edit /etc/netgroup (optional).

5. Create and edit /etc/exports.

6. Reboot the system (if necessary) or run /etc/netnfsrc.

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

Page 132: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 132/185

The AIX/HP-UX Interoperability Guide

126

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 PC-

NFS 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 norServer

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

Page 133: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 133/185

 NFS 

127

# 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=1NFS_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 -- 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).##PCNFS_SERVER=0

 Edit /etc/inetd.conf (optional)

To activate the RPC services, remove all # comment marks from /etc/inetd.conf lines beginning

with #rpc. After editing /etc/inetd.conf , you must reconfigure inetd by entering:

/etc/inetd -c

RPC Services Security

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

Suppose /etc/inetd.conf contains the following:

rpc dgram udp wait root /usr/etc/rpc.mountd 100005 1 rpc.mountd -e

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

Page 134: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 134/185

The AIX/HP-UX Interoperability Guide

128

mounted directories or files. The -e option forces inetd to perform a security check for

rpc.mountd on every request.

 Edit /usr/adm/inetd.sec (optional)

NFS operates under the assumption you have a friendly network; meaning, you can trust all users

attached to your network. Since this assumption may not apply to everyone, refer to the followingsections to improve your file security.

The /usr/adm/inetd.sec configuration file is provided in the ARPA Services product. It is not

solely for NFS access. This file allows you to determine:

• How many remote services can run simultaneously on the local host.

• Which hosts are allowed to remotely use the local host.

Set Maximum Number of Remote Connections

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

If you do not specify a MAXNUM value, the default is 1000.

Specify Accesses to Services

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 foraccess 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.

Page 135: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 135/185

 NFS 

129

You can use the asterisk (*) or dash (-) in any field of a network or host

address.

You cannot use aliases.

 Edit /etc/netgroup (optional)

The /etc/netgroup file enables you to define a specific network-wide group of nodes as a netgroup.

You can then limit directory access by exporting directories or files (via /etc/exports and exportfs)

to the netgroups defined. The system uses /etc/netgroup to verify host names whenever clients

perform remote mounts.

Create and Edit /etc/exports

You make the directories or files and their access restrictions, if any, available by your entries in

the server’s /etc/exports file. When you boot up the NFS server, the /etc/netnfsrc file will

automatically run the exportfs daemon, which looks up /etc/exports and makes the directories or

files available for NFS clients to access. You can export and unexport directories or files after theserver is up or change access permissions of the exported directory by using the exportfscommand. The exportfs command can be run at any time by the superuser to alter the list or

characteristics of exported directories and filenames. For details on constructing the /etc/exportsfile, see the man page on exports(4). Also refer to exportfs(1M).

 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 server’s directories

or files that were remotely mounted by other network nodes. However, these nodes will not be able

to access any of the server’s 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.

Configure for NFS

Configure the systems for NFS if you have not already done so. This task includes adding NFS to

the kernel and editing /etc/netnfsrc. On the servers, edit /etc/exports.

Page 136: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 136/185

The AIX/HP-UX Interoperability Guide

130

Create the Master Map

The master map contains the names of the indirect and direct maps. It also contains the names of 

common mount directories for indirect maps. You do not need a master map if you pass all the

map information to automount in the command line.

The master map is usually created as /etc/auto.master and then made into the NIS map

auto.master. By default, automount tries to get master map information from the NIS map

auto.master. If a local master map file is specified on the command line, automount reads it

before reading the NIS auto.master map.

The format for indirect map entries in the master maps is:

mount directory indirect map [-mount options]

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 Indicates the hosts map. The name of the remote host is used as the

subdirectory name under the mount directory.

-password Indicates the password map

-null 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.

Create Map Files

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 (.dirand .pag) to the map name.

Page 137: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 137/185

 NFS 

131

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. Themount 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/&

 + mapname The contents of another map can be included within the current map. If mapnameis 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.

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.

Page 138: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 138/185

The AIX/HP-UX Interoperability Guide

132

The special characters listed above are also valid for direct maps.

 Integrate with NIS

Automount maps can be local files or administered as NIS maps. By default, automount tries to

read master map information from the NIS map auto.master. Automount also reads master map

information from a local file if you specify one on the command line.

The master map can contain NIS map names for the indirect and direct maps instead of file names.

To specify an NIS map, preface the map name with a plus (+).

To create NIS maps, edit the /usr/etc/yp/ypmake shell script as shown below. In the following

text, assume that you want to create NIS maps for auto.master and a direct map called auto.xxxx.

Within the scripts, auto_master and auto_direct are used for local variable names to avoid

regular expression evaluation, but the map and file names are auto.master and auto.direct.

Under the function section, add the following blocks for auto.master and auto.xxxx:

auto_master() {grep -v "^[ ]*#" $1 | grep -v "^[ ]*$" | \awk 'BEGIN { OFS="\t"; } { print $1, $2, $3 }' | \$MAKEDBM - $MAPDIR/auto.master

}

auto_xxxx() {grep -v "^[ ]*#" $1 | grep -v "^[ ]*$" | \awk 'BEGIN { OFS="\t"; } { print $1, $2, $3 }' | \}$MAKEDBM - $MAPDIR/auto.xxxx

}

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;;

In the definition for

MAPS=${MAPS:-'passwd groups hosts ...

add an entry for auto_master and auto_xxxx.

In the block

for MAP in $MAPS; docase $MAP in

Page 139: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 139/185

 NFS 

133

add an entry for auto.master and auto.xxxx as follows:

auto_master) build $DIR/auto.master auto.master ;;auto_xxxx) build $DIR/auto.xxxx auto.xxxx;;

You should also modify /usr/etc/yp/ypinit on the master server. Add auto.master and auto.xxxxto 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.

Shutting Down Automount 

Automount is normally started and stopped only when the machine is rebooted. To shut down

automount gracefully during system operation, take the following steps:

1. Make sure no processes have their current working directory set to any automount

directories or subdirectories.

2. Then, send automount the SIGTERM (-15) signal (SIGTERM is the default signal sent by

the kill command).

WARNING: No other automount daemon should be started until the first has successfully cleaned

up and exited. If a second automount daemon is started when the first is in its shutdown process,

the second daemon will start its shutdown process. This means that there will now be four

automount daemons: the first, the second, and their children. These daemons will not exit until all

the mount directories they are serving have been unmounted

Do not send the SIGKILL signal (kill -9, kill -KILL) to the automount daemon. This will cause

any processes accessing mount directories served by automount to hang. The file hierarchies

mounted by automount under /tmp_mnt will still be accessible.

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 thesame.

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.

Page 140: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 140/185

Page 141: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 141/185

 Mail

135

13. Mail

13.1 AIX 

AIX user agents are mail, mailx, and Mail, all of which are the same program since these are allhard 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).

Customizing the /etc/sendmail.cf file

The default /etc/sendmail.cf file defines configuration for local, TCP/IP, and BNU delivery. This

should be enough for most sites, but if you need further customization, do the following:

1. Edit the /etc/sendmail.cf file. You can use the vi editor or an editor that does not convert

tabs to characters, or you can use the /usr/lib/edconfig command.

2. Create the database file, /etc/sendmail.cfDB with the following command:

  # sendmail -bz

3. Refresh the sendmail daemon:

  # refresh -s sendmail

Stopping and Starting the sendmail Daemon

sendmail by default should start up at bootup. If it doesn’t, then uncomment the following line

from /etc/rc.tcpip:

start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"

To start the sendmail daemon using the SRC:

# startsrc -s sendmail -a "-bd -q30m"

To stop the sendmail daemon using the SRC type the following:

# stopsrc -s sendmail

To start the sendmail daemon using the command line:

# sendmail -bd -q30m 

To stop the sendmail daemon using the KornShell kill command:

# kill $(cat /etc/sendmail.pid)

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:

• MAILER-DAEMON (usually set to root)

Page 142: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 142/185

The AIX/HP-UX Interoperability Guide

136

• postmaster (usually set to root)

• nobody (usually set to /dev/null)

To compile the aliases database file type one of the following:

# sendmail -bi

# newaliases

This command creates the following dbm files:

••  /etc/aliasesDB/DB.dir

••  /etc/aliasesDB/DB.pag

The Mail Queue

In AIX the mail queue directory is /var/spool/mqueue. The naming convention for the files in this

directory is virtually the same as that for HP-UX:

 A file beginning with is a

df data file

qf queue control file

tf temporary file

xf transcript file

nf backup file

lf lock file

The sendmail queue processing interval, as in HP-UX, is set with the -q option to the sendmailcommand.

To process the mail queue once:

# sendmail -q

To process the mail queue every 15 minutes:

# sendmail -q15m 

To process the mail queue every 30 seconds:

# sendmail -q30s

To change the processing interval permanently, edit the following line in /etc/rc.tcpip to the value

you desire:

qpi=30m 

The qpi variable is used as an argument in the next line:

start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"

Page 143: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 143/185

Page 144: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 144/185

The AIX/HP-UX Interoperability Guide

138

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.

 Installing a Configuration File

The supplied configuration file, /etc/newconfig/sendmail.cf is appropriate for many installations

without modification. In particular, when initially installing sendmail, simply copying the supplied

configuration file into place provides basic connectivity and permits you to integrate your system

into your mail environment without immediately having to edit the configuration file. In addition, a

number of localizations and routing options are provided. Descriptions of these options and

detailed editing instructions are provided in the supplied configuration file itself.

To install the supplied configuration file unmodified, copy the file /etc/newconfig/sendmail.cf to

 /usr/lib/sendmail.cf . To make any of the supported modifications, copy

 /etc/newconfig/sendmail.cf to /usr/lib/sendmail.cf and edit /usr/lib/sendmail.cf according to the

instructions in the file itself.

 Making sendmail Executable

To make sendmail executable, as superuser, issue the command:

# chmod 5555 /usr/lib/sendmail

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 firstcreate 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 people’s mail in the mail queue.

Page 145: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 145/185

 Mail

139

Creating System-wide Mail Aliases

The /etc/newconfig aliases file is an example alias file that contains default aliases needed by

sendmail. To create system-wide mail aliases, copy /etc/newconfig/aliases to /usr/lib/aliases.

You can add any aliases that are appropriate for your system by editing the /usr/lib/aliases file.

Once sendmail is executable issue the following command:

# newaliases

This creates the alias database files, /usr/lib/aliases.dir and /usr/lib/aliases.pag.

 Invoking the sendmail Daemon

To start the sendmail daemon, as superuser, issue the following command:

  # /usr/lib/sendmail -bd -q30m 

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.

Stopping and Starting the sendmail Daemon

If the sendmail configuration file or frozen configuration changes, you should kill and restart the

sendmail daemon so that it re-reads the configuration file.

The command

# /usr/lib/sendmail -bk

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

Then restart the sendmail daemon:

# /usr/lib/sendmail -bd -q30m 

To use SAM to refreeze the configuration and kill and restart the sendmail daemon, do the

following:

Page 146: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 146/185

The AIX/HP-UX Interoperability Guide

140

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.

The Mail Queue

The HP-UX mail queue directory is /usr/spool/mqueue. The naming conventions for the files in

this directory are nearly identical to those found in AIX. See AIX “The Mail Queue” for more

information on the file name formats.

The System Log

sendmail logs its mail messages through the syslogd logging facility. The syslogd configuration

on diskless clients should forward all logging that results from sending mail to the cluster root

server. The syslogd configuration on cluster servers and standalone systems by default write mail

logging to the file /usr/spool/mqueue/syslog. To change this file, edit the /etc/syslog.conf file

13.3 An Interoperability Exercise: Creating Mail Hubs 

There several ways to create a central mail hub or server. You can use MX records in DNS, you

can use the aliases database, or you can configure sendmail.cf . Below are two examples of using

sendmail.cf . This example assumes the machines are on the same network, are part of the same

DNS domain, and have the same users available.

Sending AIX Mail to an HP-UX Hub

Configuring AIX’s sendmail.cf file to route to an HP-UX hub is quite simple. Consider the

following lines from /etc/sendmail.cf :

##################################################################### Host name for central mail server (YOU MAY OPTIONALLY DEFINE THIS)## Optionally defined macro specifying name of host to which you want# to relay all local mail. This is used if there is a central mail# server that should receive all mail for a given area.## When this macro is defined, mail that would otherwise be delivered# to "user" on the local machine is delivered to "user@server" on the

Page 147: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 147/185

 Mail

141

# 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 hub’s 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 sadie’s /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 rootaccess 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.

Sending HP-UX Mail to an AIX Hub

This direction is a bit harder to implement. There are several steps involved:

1. Set the “S” macro. By default it is blank. The line that reads

  DS

should have the hub’s name appended. For example:

  DSsadie

2. Comment out the following line:

  R$+<@$+> $#tcp$@$2$:$1<@$2> user@domain

3. Uncomment the following line:

  R$+<@$+> $#tcp$@$S$:$1<@$2> user@domain to SMTP relay

4. Comment out the following line:

 

R$+ $#local$:$1 name5. Add the following rule:

  R$+ $#tcp$A$S$:$1

6. Uncomment and change the following line:

From:

  #R$+ $:$1<@$w> add local domain

Page 148: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 148/185

The AIX/HP-UX Interoperability Guide

142

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 rootaccess 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. AIX’s mailx is actually a hard link to mail. HP-UX’s 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 system’s sendmail files look and feel much the same, though their locations are

different. Below lists the major files and their locations.

 AIX HP-UX

/etc/sendmail /usr/lib/sendmail

/etc/sendmail.cf /usr/lib/sendmail.cf

/etc/aliases /usr/lib/aliases

/etc/aliasesDB/DB.dir /usr/lib/aliases.dir

/etc/aliasesDB/DB.pag /usr/lib/aliases.pag

/etc/sendmail.cfDB /usr/lib/sendmail.fc

/var/spool/mail /usr/mail

/var/spool/mqueue /usr/spool/mqueue

/usr/share/lib/Mail.rc /usr/lib/mailx/mailx.rc

/usr/sbin/mailq /usr/bin/mailq

/usr/sbin/mailstats /usr/bin/mailstats

/etc/sendmail.st /usr/lib/sendmail.st

Page 149: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 149/185

 X11

143

14. X11

14.1 AIX 

AIX’s version of the X Window system is called AIXwindows, a separately purchased product thatincludes 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.

Files and Directory Structure

AIX puts all of its X Window files in a single directory,  /usr/lpp/X11, but has links to maintain

compatibility with traditional X files and directories. The major links are:

/usr/bin/X11 -> /usr/lpp/X11/bin/usr/lib/X11 -> /usr/lpp/X11/lib/X11

/usr/include/X11 -> /usr/lpp/X11/include/X11/usr/include/Xm -> /usr/lpp/X11/include/Xm 

The following standard X commands are found in /usr/lpp/X11/bin:

Xbdftopcffs

 mkfontdirresizestartxxauthxclock

xdm xhostxinitxmodmapxprxrdbxrdbxsetrootxterm xwd

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 appresatobm bitmapbmtoademodrdemomon

Page 150: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 150/185

Page 151: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 151/185

 X11

145

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 user’s .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 definitions—and HP-UX machines are among those—you 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 HP’s /usr/lib/terminfo/a directory.

Page 152: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 152/185

The AIX/HP-UX Interoperability Guide

146

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 HP’s /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

3. Entering the following command:

  # xset fp rehash

 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.

 Making the RS a Font Server 

AIX’s generic font server configuration file is /usr/lpp/X11/lib/X11/fs/config. If you cd to the

linked directory /usr/lib/X11/fs you will find it as well. This file is simple and similar to those

found on other platforms except that it stipulates port 7500 instead of 7000. Any free port will do,but just remember the correct number when you run the xset command on the font client.

To start the font server type:

# fs -config /usr/lpp/X11/lib/X11/fs/config &

To verify the font server type (assuming you’re using the KornShell):

# export FONTSERVER=server_name:7500; fsinfo

or

# fsinfo -server server_name:7500

To list the font server fonts (assuming you’re 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

Page 153: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 153/185

Page 154: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 154/185

The AIX/HP-UX Interoperability Guide

148

  bitmap is replaced by vueicon.

• Font Display

  Handled by the terminal emulation option -fn override. xfd is supplied but not supported.

• Demos

Obtained from the INTERWORKS users group.

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 HP’s 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.

Files and Directory StructureThe following standard directories for X binaries and configuration files are provided:

/usr/bin/X11/usr/lib/X11

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

developer’s 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 containthis 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

Page 155: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 155/185

Page 156: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 156/185

The AIX/HP-UX Interoperability Guide

150

xinitcolormapxlsfontsxmodmapxprxrdbxseethru

Xserverxsetxsetrootxterm xwcreatexwdxwd2sbxwdestroyxwininfoxwud

Unsupported Clients

bitmap

columnsdr_vuevuefincalcxclipboardxcutselxdpyinfoxfdxpropxrefresh

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

x11start encompasses the following components:

• 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

Page 157: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 157/185

 X11

151

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 x11startcomponents 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 adisplay 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:

• A terminal emulation client, such as hpterm

• mwm

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 specifiedserver 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.x11startor $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 bothof 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 Consortium’s 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.

Page 158: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 158/185

The AIX/HP-UX Interoperability Guide

152

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.

FontsA font server is shipped with Hewlett-Packard’s 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.stdirectories.

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:

Page 159: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 159/185

 X11

153

# xset +fp tcp/host_name:7000

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

3. Put the hpterm.ti file on the RS/6000:

  ftp RS_node

  ftp> cd /tmp

  ftp> put hpterm.ti

  ftp> quit

4. On the RS/6000, compile the hpterm.ti file:

 

# tic /tmp/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”:

Page 160: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 160/185

The AIX/HP-UX Interoperability Guide

154

vuelogin Validates user login

vuesession Starts and later saves the user’s session

vuewm The user’s workspace and window manager

vuefile Application launcher, file, and directory browser

vuestyle Interactive application resource customizer

vuehelp On-line help and man page browser

vuelogin is the first interface the user sees. It provides services similar to in init, getty, and loginon character terminals: prompting for login and password, authenticating the user, and running a

user’s 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 HP VUE executables

 /usr/vue/config Configuration files for the login, session, and workspace manager

 /usr/vue/types Built-in actions and file types

 /usr/vue/app-defaults Application defaults for HP VUE clients

 /usr/vue/icons 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.

Configuration files comparison

Remember that VUE and X can be used at different times. A user could need Motif and regular X

one day and HP VUE the next. So it is very important to keep these files separate. Notice there is

Page 161: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 161/185

 X11

155

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 VUE

.profile (or .login) .vueprofile

.Xdefaults RESOURCE_MANAGER

.x11start vuesession

.mwmrc vuewmrc

14.3 X11 Interoperability 

X, like TCP/IP, NFS, NIS, DNS, and sendmail, is essentially the same on both AIX and HP-UX.

Only the details differ. X has made interoperability among UNIX systems much easier in that

clients can run on one platform and display on another. This is even true of clients such as SAM

and SMIT, which you may find necessary to access from a box of another ilk.

Displaying to a Remote Host

Using xhost, you can add or delete a remote host’s permission to access the local display server.

For example, the following command allows the remote host stargate to access your local display.

# xhost +stargate

The default display on which a client is displayed is obtained from the DISPLAY environmentvariable 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:

Page 162: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 162/185

The AIX/HP-UX Interoperability Guide

156

# aixterm -display hp_node:0 &

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 remotelyon 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.

 Running Programs Using rlogin

You can use an existing terminal emulator window to log into a remote host. Once the window is

acting as a terminal off the remote host, you can run clients there and direct the output to any

display. For example, the following commands log into and start xload on remote host rs_nodeand display the output on local system hp_node.

# rlogin rs_node

# xload -display hp_node:0.0 &

Using Remote Shells to Start Programs

The benefit of using remsh or rsh instead of rlogin is that the local system starts only one process

(the client) with a remote shell; with the remote login, the local system starts both the remote login

and the client.

The following syntax starts a remote shell on a remote host, redirects remsh input, starts a client,

and directs output to the local display.

# remsh remote -n client -display local:display.screen &

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.

Page 163: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 163/185

 X11

157

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 &

Going the other way:

# rsh hp_node -n /usr/bin/X11/xload -display rs_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.

Turning Your Workstation into an X Terminal

Occasionally you might want to connect to a machine of a different platform and perform

administrative tasks completely within the environment of the remote machine. If you do, all you

need to do is convert your local workstation into an X terminal connected to the remote machine.

To convert an HP workstation into an X terminal running off an RS/6000 called rs_node:

1. Make sure xdm is running on the RS/6000. See the section on xdm in the RS/6000

section above for more details.

2. Stop the X Window system on the HP by choosing a No Windows login from the login

screen.

3. Log in to the ASCII display.

4. Type the following command:

  # X -query rs_node

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.

Page 164: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 164/185

Page 165: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 165/185

 Appendix A

159

Appendix A

Common Command Pathnames 

 AIX HP-UX

/etc/accton /usr/lib/acct/accton

/etc/arp /etc/arp

/etc/backup /etc/backup

/etc/bootpd /etc/bootpd

/etc/catman /etc/catman

/etc/cron /etc/cron

/etc/devnm /etc/devnm  

/etc/dumpfs /usr/bin/dumpfs

/etc/fingerd /etc/fingerd

/etc/fsck /etc/fsck

/etc/fsdb /etc/fsdb

/etc/ftpd /etc/ftpd

/etc/fuser /etc/fuser

/etc/gated /etc/gated

/etc/getty /etc/getty

/etc/ifconfig /etc/ifconfig

/etc/inetd /etc/inetd

/etc/init /etc/init

/etc/link /etc/link

/etc/lsdev /etc/lsdev

/etc/mkfs /etc/mkfs

Page 166: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 166/185

The AIX/HP-UX Interoperability Guide

160

/etc/mklost+found /etc/mklost+found

/etc/mknod /etc/mknod

/etc/mount /etc/mount

/etc/mvdir /etc/mvdir

/etc/named /etc/named

/etc/named-xfer /etc/named-xfer

/etc/ncheck /etc/ncheck

/etc/ping /etc/ping

/etc/rc /etc/rc

/etc/rdump /etc/rdump

/etc/reboot /etc/reboot

/etc/renice /bin/renice

/etc/restore /etc/restore

/etc/rexecd /etc/rexecd

/etc/rlogind /etc/rlogind

/etc/rmt /etc/rmt

/etc/route /etc/route

/etc/rrestore /etc/rrestore

/etc/rwhod /etc/rwhod

/etc/savecore /etc/savecore

/etc/shutdown /etc/shutdown

/etc/swapon /etc/swapon

/etc/syslogd /etc/syslogd

/etc/telinit /etc/telinit

/etc/telnetd /etc/telnetd

/etc/tftpd /etc/tftpd

Page 167: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 167/185

 Appendix A

161

/etc/tsm /usr/bin/tsm  

/etc/umount /etc/umount

/etc/unlink /etc/unlink

/etc/update /etc/update

/usr/bin/acctcom /usr/lib/acct/acctcom  

/usr/bin/at /usr/bin/at

/usr/bin/awk /usr/bin/awk

/usr/bin/banner /usr/bin/banner

/usr/bin/basename /bin/basename

/usr/bin/batch /usr/bin/batch

/usr/bin/bc /usr/bin/bc

/usr/bin/bdiff /usr/bin/bdiff

/usr/bin/bfs /usr/bin/bfs

/usr/bin/c89 /bin/c89

/usr/bin/cal /usr/bin/cal

/usr/bin/calendar /usr/bin/calendar

/usr/bin/cancel /usr/bin/cancel

/usr/bin/captoinfo /usr/bin/captoinfo

/usr/bin/cat /bin/cat

/usr/bin/cc /bin/cc

/usr/bin/checknr /usr/bin/checknr

/usr/bin/chfn /usr/bin/chfn

/usr/bin/chgrp /bin/chgrp

/usr/bin/chmod /bin/chmod

/usr/bin/chown /bin/chown

/usr/bin/chroot /etc/chroot

Page 168: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 168/185

The AIX/HP-UX Interoperability Guide

162

/usr/bin/chsh /usr/bin/chsh

/usr/bin/cksum /bin/cksum  

/usr/bin/clear /usr/bin/clear

/usr/bin/cmp /bin/cmp

/usr/bin/col /usr/bin/col

/usr/bin/comm /usr/bin/comm  

/usr/bin/compress /usr/bin/compress

/usr/bin/cp /bin/cp

/usr/bin/cpio /bin/cpio

/usr/bin/crontab /usr/bin/crontab

/usr/bin/csh /bin/csh

/usr/bin/csplit /usr/bin/csplit

/usr/bin/ct /usr/bin/ct

/usr/bin/cu /usr/bin/cu

/usr/bin/cut /usr/bin/cut

/usr/bin/date /bin/date

/usr/bin/dc /usr/bin/dc

/usr/bin/dd /bin/dd

/usr/bin/deroff /usr/bin/deroff

/usr/bin/df /bin/df

/usr/bin/diff /bin/diff

/usr/bin/diff3 /usr/bin/diff3

/usr/bin/diffmk /usr/bin/diffmk

/usr/bin/dircmp /usr/bin/dircmp

/usr/bin/dirname /bin/dirname

/usr/bin/disable /usr/bin/disable

Page 169: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 169/185

 Appendix A

163

/usr/bin/diskusg /usr/lib/acct/diskusg

/usr/bin/domainname /bin/domainname

/usr/bin/du /bin/du

/usr/bin/dump /etc/dump

/usr/bin/e /usr/bin/e

/usr/bin/echo /bin/echo

/usr/bin/ed /bin/ed

/usr/bin/edit /usr/bin/edit

/usr/bin/egrep /bin/egrep

/usr/bin/enable /usr/bin/enable

/usr/bin/env /bin/env

/usr/bin/ex /usr/bin/ex

/usr/bin/expand /usr/bin/expand

/usr/bin/expr /bin/expr

/usr/bin/factor /usr/bin/factor

/usr/bin/fgrep /bin/fgrep

/usr/bin/file /usr/bin/file

/usr/bin/find /bin/find

/usr/bin/finger /usr/bin/finger

/usr/bin/fold /usr/bin/fold

/usr/bin/from /usr/bin/from  

/usr/bin/ftp /usr/bin/ftp

/usr/bin/gencat /usr/bin/gencat

/usr/bin/getconf /usr/bin/getconf

/usr/bin/getopt /usr/bin/getopt

/usr/bin/grep /bin/grep

Page 170: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 170/185

The AIX/HP-UX Interoperability Guide

164

/usr/bin/groups /usr/bin/groups

/usr/bin/grpck /etc/grpck

/usr/bin/head /usr/bin/head

/usr/bin/help /usr/bin/help

/usr/bin/hostname /bin/hostname

/usr/bin/hp /usr/bin/hp

/usr/bin/hyphen /usr/bin/hyphen

/usr/bin/iconv /usr/bin/iconv

/usr/bin/id /usr/bin/id

/usr/bin/install /etc/install

/usr/bin/iostat /usr/bin/iostat

/usr/bin/ipcrm /bin/ipcrm  

/usr/bin/ipcs /bin/ipcs

/usr/bin/join /usr/bin/join

/usr/bin/kill /bin/kill

/usr/bin/killall /etc/killall

/usr/bin/ksh /bin/ksh

/usr/bin/last /etc/last

/usr/bin/lastcomm /usr/bin/lastcomm  

/usr/bin/leave /usr/bin/leave

/usr/bin/line /bin/line

/usr/bin/ln /bin/ln

/usr/bin/locale /usr/bin/locale

/usr/bin/localedef /usr/bin/localedef

/usr/bin/lock /usr/bin/lock

/usr/bin/logger /usr/bin/logger

Page 171: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 171/185

 Appendix A

165

/usr/bin/login /bin/login

/usr/bin/logname /usr/bin/logname

/usr/bin/look /usr/local/bin/look

/usr/bin/lp /usr/bin/lp

/usr/bin/lpr /usr/bin/lpr

/usr/bin/lpstat /usr/bin/lpstat

/usr/bin/ls /bin/ls

/usr/bin/mailx /usr/bin/mailx

/usr/bin/man /usr/bin/man

/usr/bin/mesg /bin/mesg

/usr/bin/mkdir /bin/mkdir

/usr/bin/mkfifo /bin/mkfifo

/usr/bin/mm /usr/bin/mm  

/usr/bin/more /usr/bin/more

/usr/bin/mt /bin/mt

/usr/bin/mv /bin/mv

/usr/bin/neqn /usr/bin/neqn

/usr/bin/netstat /usr/bin/netstat

/usr/bin/newform /usr/bin/newform  

/usr/bin/newgrp /usr/bin/newgrp

/usr/bin/news /usr/bin/news

/usr/bin/nice /bin/nice

/usr/bin/nl /usr/bin/nl

/usr/bin/nroff /usr/bin/nroff

/usr/bin/nslookup /usr/bin/nslookup

/usr/bin/od /bin/od

Page 172: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 172/185

Page 173: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 173/185

 Appendix A

167

/usr/bin/rsh /bin/rsh

/usr/bin/rup /usr/bin/rup

/usr/bin/ruptime /usr/bin/ruptime

/usr/bin/rusers /usr/bin/rusers

/usr/bin/rwho /usr/bin/rwho

/usr/bin/script /usr/bin/script

/usr/bin/sdiff /usr/bin/sdiff

/usr/bin/sed /bin/sed

/usr/bin/sh /bin/sh

/usr/bin/showmount /usr/etc/showmount

/usr/bin/sleep /bin/sleep

/usr/bin/soelim /usr/bin/soelim  

/usr/bin/sort /bin/sort

/usr/bin/spell /usr/bin/spell

/usr/bin/split /usr/bin/split

/usr/bin/stty /bin/stty

/usr/bin/su /bin/su

/usr/bin/sum /bin/sum  

/usr/bin/sync /bin/sync

/usr/bin/tabs /usr/bin/tabs

/usr/bin/tail /bin/tail

/usr/bin/talk /usr/bin/talk

/usr/bin/tar /bin/tar

/usr/bin/tbl /usr/bin/tbl

/usr/bin/tee /bin/tee

/usr/bin/telnet /usr/bin/telnet

Page 174: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 174/185

The AIX/HP-UX Interoperability Guide

168

/usr/bin/test /bin/test

/usr/bin/tftp /usr/bin/tftp

/usr/bin/tic /usr/bin/tic

/usr/bin/timex /usr/bin/timex

/usr/bin/touch /bin/touch

/usr/bin/tput /usr/bin/tput

/usr/bin/tr /usr/bin/tr

/usr/bin/tset /usr/bin/tset

/usr/bin/tty /bin/tty

/usr/bin/ul /usr/bin/ul

/usr/bin/uname /bin/uname

/usr/bin/uncompress /usr/bin/uncompress

/usr/bin/unexpand /usr/bin/unexpand

/usr/bin/uniq /usr/bin/uniq

/usr/bin/units /usr/bin/units

/usr/bin/unpack /usr/bin/unpack

/usr/bin/uptime /usr/bin/uptime

/usr/bin/users /usr/bin/users

/usr/bin/uucp /usr/bin/uucp

/usr/bin/uudecode /usr/bin/uudecode

/usr/bin/uuencode /usr/bin/uuencode

/usr/bin/uulog /usr/bin/uulog

/usr/bin/uuname /usr/bin/uuname

/usr/bin/uusnap /usr/bin/uusnap

/usr/bin/uustat /usr/bin/uustat

/usr/bin/uuto /usr/bin/uuto

Page 175: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 175/185

 Appendix A

169

/usr/bin/uux /usr/bin/uux

/usr/bin/vacation /usr/bin/vacation

/usr/bin/vedit /usr/bin/vedit

/usr/bin/vi /usr/bin/vi

/usr/bin/view /usr/bin/view  

/usr/bin/vmstat /usr/bin/vmstat

/usr/bin/w /usr/bin/w  

/usr/bin/wall /etc/wall

/usr/bin/wc /bin/wc

/usr/bin/what /usr/bin/what

/usr/bin/whereis /usr/bin/whereis

/usr/bin/which /usr/bin/which

/usr/bin/who /bin/who

/usr/bin/whoami /usr/bin/whoami

/usr/bin/write /bin/write

/usr/bin/xargs /usr/bin/xargs

/usr/bin/yes /usr/bin/yes

/usr/bin/ypcat /usr/bin/ypcat

/usr/bin/ypmatch /usr/bin/ypmatch

/usr/bin/yppasswd /usr/bin/yppasswd

/usr/bin/ypwhich /usr/bin/ypwhich

/usr/bin/zcat /usr/bin/zcat

/usr/sbin/automount /usr/etc/automount

/usr/sbin/biod /etc/biod

/usr/sbin/edquota /etc/edquota

/usr/sbin/exportfs /usr/etc/exportfs

Page 176: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 176/185

The AIX/HP-UX Interoperability Guide

170

/usr/sbin/mailq /usr/bin/mailq

/usr/sbin/mailstats /usr/bin/mailstats

/usr/sbin/mkboot /etc/mkboot

/usr/sbin/newaliases /usr/bin/newaliases

/usr/sbin/nfsd /etc/nfsd

/usr/sbin/nfsstat /usr/etc/nfsstat

/usr/sbin/portmap /etc/portmap

/usr/sbin/quot /etc/quot

/usr/sbin/quota /usr/bin/quota

/usr/sbin/quotacheck /etc/quotacheck

/usr/sbin/quotaoff /etc/quotaoff

/usr/sbin/quotaon /etc/quotaon

/usr/sbin/repquota /etc/repquota

/usr/sbin/rpc.lockd /usr/etc/rpc.lockd

/usr/sbin/rpc.mountd /usr/etc/rpc.mountd

/usr/sbin/rpc.rexd /usr/etc/rpc.rexd

/usr/sbin/rpc.rstatd /usr/etc/rpc.rstatd

/usr/sbin/rpc.statd /usr/etc/rpc.statd

/usr/sbin/rwall /usr/etc/rwall

/usr/sbin/sendmail /usr/lib/sendmail

/usr/sbin/snmpd /etc/snmpd

/usr/sbin/spray /usr/etc/spray

Page 177: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 177/185

 Appendix B

171

Appendix B

Creating AIX Boot Diskettes 

First you need four AIX-formatted 1.44 MB diskettes. Formatting diskettes in AIX is easy; justinsert 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

2. Label a diskette Display, place in the drive, and type:

  # /usr/sbin/mkdispdskt

3. Label a diskette Display Extension, place in the drive, and type:

  # /usr/sbin/mkextdskt

4. Label a diskette Install/Maintenance, place in the drive, and type:

  # /usr/sbin/mkinstdskt

Page 178: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 178/185

Page 179: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 179/185

 Appendix C 

173

Appendix C

A Quick Comparison of SMIT and SAM 

SMIT and SAM perform many of the same functions, but there are differences. The followingprovides a quick comparison of the two programs.

Task SMIT SAM  

Install software Yes No, done throughupdate command

Add/remove disks, tape drives,cdroms

Yes Yes

Manage ttys Yes No

User and group management Yes Yes

Change passwords Yes Yes

Diskless workstationmanagement11

Yes Yes

Manage file systems Yes Yes

Manage swap/paging space Yes Yes

Disk space recovery No Yes

Kernel configuration No12

Yes

Sendmail start and stop No Yes

NCS management No Yes

bootp management Yes Yes

UUCP management No Yes

Remote administration13 No Yes

Setting up a trusted system No Yes

NIC configuration Yes Yes

 11AIX 3.2.5 and HP-UX 9.0x approaches to diskless workstations differ but configuration can be done through the

respective system administration tools.

12SMIT does not offer this because the ODM precludes kernel configuration in AIX.

13IBM 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.

Page 180: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 180/185

The AIX/HP-UX Interoperability Guide

174

Set hostname Yes Yes

Manage routing tables Yes Yes, but onlyfor defaultgateway

Edit /etc/resolv.conf Yes No

Edit /etc/services Yes Yes

Edit /etc/hosts.equiv Yes Yes

Edit /etc/ftpusers Yes Yes

Manage syslogd Yes No

Manage routed Yes No

Manage gated Yes No

Manage named Yes No

Manage rwhod Yes No

Manage timed Yes No

Configure NFS Yes Yes

Configure NIS Yes No

Printer management Yes Yes

Manage print requests Yes Yes

Hardware diagnostics Yes No

Process management Yes Yes

Performance monitoring Yes No

Schedule at jobs Yes No

Schedule cron jobs No Yes

Backup and restore operations Yes Yes

Page 181: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 181/185

175

Appendix D

Alternate HP Boot Console User Interface 

This describes the Boot Console User Interface for models 712, 715/64, 715/80, 715/100, and725/100.

Accessing the Boot Console User Interface

1. Power-on the system.

2. Press and hold the Escape key at the boot banner.

3. Release the Escape key when the screen displays the boot administration command menu

followed by the BOOT_ADMIN> prompt.

Searching for Bootable Media

To list devices that contain bootable media, type the following at the BOOT_ADMIN> prompt:

BOOT_ADMIN> search

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

Booting from BOOT_ADMIN

The bootable devices are displayed by the search command in Mnemonic Style Notation. Use this

notation when specifying a particular device from which to boot.

Examples:

BOOT_ADMIN> boot scsi.5.0

This will boot off the SCSI device at address 5.

BOOT_ADMIN> boot scsi.6.0 isl

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

Page 182: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 182/185

The AIX/HP-UX Interoperability Guide

176

—/—

 /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

—A—

accept, 78, 79, 81AIX, 2

Backups, 49–53

Boot process, 3–4Devices, 25–31

Directory structure, 13Domain Name Service, 99–101

File systems, 15–19

Logical Volume Manager, 14–15Login process, 9–10

Logout process, 10Mail, 135–37

NFS, 117–23

NIS, 107–11

Object Data Manager, 25–27Printing, 61–69Processes, 41–45

Shutdown, 4–5

System Resource Controller, 42–44TCP/IP, 85–93

X11, 143–47

aixterm, 9, 145, 146, 156

—B—

BackupsAIX, 49–53

HP-UX, 53–56

bdf , 24bdftopcf , 143, 146, 149

bdftosnf , 149Boot Console User Interface, 6

Boot process

AIX, 3–4HP-UX, 5–7

—C—

cancel, 82

cfgmgr, 27, 28, 27–28, 30, 31, 37, 85

chdev, 27, 52, 58, 59

chnfs, 117

chssys, 117convert_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, 25–31HP-UX, 31–37

df , 24, 162Directory structure

AIX, 13HP-UX, 14

disable, 81Domain Name Service

AIX, 99–101HP-UX, 102–5

domainname, 107, 111, 113, 114, 115, 116, 163

dump, 49, 53, 56, 58, 159, 160, 163

Page 183: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 183/185

177

—E—

elm, 137

enable, 78, 79, 80, 81

enq, 61, 62, 65, 69

exportfs, 118

extendvg, 16

—F—

File systems

AIX, 15–19HP-UX, 19–24

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, 103HP VUE, 7, 8, 10, 11, 153, 154, 157

hpterm, 147, 149, 151, 153, 155, 156HP-UX

Backups, 53–56

Boot process, 5–7Description, 1

Devices, 31–37Directory structure, 14

Domain Name Service, 102–5File systems, 19–24Login process, 11

Logout process, 11Mail, 137–40

NFS, 123–33NIS, 111–16

Printing, 69–83

Processes, 45–46Shutdown, 7

TCP/IP, 93–98X11, 147–55

—I—ifconfig, 85, 92, 93, 97, 98, 159

inetimp, 90, 98

init, 3, 6, 7, 10, 11, 42, 154

ioscan, 35

—K—

kill, 41, 42, 45, 46, 47, 105, 113, 123, 133, 135, 139,164

killall, 42, 46, 164

—L—

Logical Volume Manager, 3, 14–15, 19, 24, 55

login, 9, 10, 11Login process

AIX, 9–10HP-UX, 11

logout, 10Logout process

AIX, 10

HP-UX, 11

lpAIX, 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, 27lsdev, 26, 27, 28, 30, 31, 32, 34, 159

lspv, 16

lssrc, 43, 44

lsvg, 16

LVM. See Logical Volume Manager

—M—

mail, 135, 137

AIX, 135–37HP-UX, 137–40

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

—N—

named, 91, 94, 99, 100, 101, 102, 104, 106, 160

newaliases, 136, 139, 170

newfs, 20, 21, 22, 23

NFSAIX, 117–23

HP-UX, 123–33

nice, 41

HP-UX, 45NIS

AIX, 107–11

Page 184: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 184/185

The AIX/HP-UX Interoperability Guide

178

HP-UX, 111–16

—O—

Object Data Manager, 2, 3, 25–27, 85, 87, 89, 90, 92,98, 117

ODM. See Object Data Manager

odmget, 26, 27, 42odmshow, 25

—P—

pax, 49, 56, 58, 59, 166

Printing

AIX, 61–69HP-UX, 69–83

ProcessesAIX, 41–45

HP-UX, 45–46

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

—S—

sendmail, 94, 135, 136, 137, 138, 139, 140, 141,142, 155, 170

ShutdownAIX, 4–5

HP-UX, 7

sig_named, 105

SMIT fastpathschinet, 87

chnfs, 117

chnfsexp, 120chypdom, 108

crfs, 17device, 28

disk, 15

extendvg, 16

fshrttbl, 87

ftpusers, 91hostent, 89

hostname, 86hostsequiv, 90

inet, 88

inetdconf, 89

inetserv, 90mkautomnt, 122mkclient, 110

mklv, 16

mkmaster, 108mknfs, 117, 118

mknfsexp, 118mknfsmnt, 119

mkroute, 86

mkslave, 109mksysb, 51

mktcpip, 85mkvg, 16

otherserv, 91

pdp, 62resolv.conf, 88, 101

rmnfsexp, 120rmnfsmnt, 120

rmroute, 87rmypclient, 117

rq, 66

server, 65setbootup_option, 92

stnamed, 100stnamerslv2, 101

ypstartstop, 110

SRC. See System Resource Controller

srcmstr, 42

Standalone bootHP-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, 42–44, 92, 98, 110,116, 117, 133, 135, 147

—T—

tar, 37, 49, 56, 57, 58, 59, 167

tcio, 55, 56, 59

TCP/IP

AIX, 85–93HP-UX, 93–98

tctl, 52, 56, 59

telnet, 10, 42, 57, 145, 146, 160, 167

terminfo, 145, 153

tic, 145, 153

tn3270, 146

top, 46

Page 185: aix_hpux

7/31/2019 aix_hpux

http://slidepdf.com/reader/full/aixhpux 185/185

—U—

umount, 49, 120, 161

untic, 153

—V—

varyonvg, 16vuefile, 154

vuegreet, 11

vuehelp, 154

vuelogin, 10, 11, 147, 149, 151, 154

vuesession, 154

vuestyle, 154

vuewm, 154

—X—

X11AIX, 143–47

HP-UX, 147–55

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, 147xload, 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