TOC BACK FORWARD HOME

UNIX Unleashed, Internet Edition

- 29 -

HP-UX FAQs

By Chris Byers

Given the complexity of the HP-UX operating system, no one could really say that they know everything there is to know about it. Particularly with the release of HP-UX 10.x, there are a great number of new features and changes.

Hewlett-Packard basically overhauled its operating system with the release of HP-UX 10.0

In the releases from 8.0 to 9.04, the operating system was based on the Berkeley (BSD) style of UNIX. From release 10.0 forward, HP-UX is based on the System V (SVR4) style. This meant, not only a change in the location of system related files and softlinks to old locations for backward compatibility, but a shift in philosophy in the direction of Hewlett-Packard's variant of UNIX.

Hewlett-Packard's goal was to attain compatibility with the OSF (Open Systems Foundation) standard for UNIX operating systems. In doing this, Hewlett-Packard has done its part to ensure industry wide compliance with this standard. Additionally, since HP is the market leader in UNIX operating systems, the rest of the industry is somewhat obliged to follow its lead.

In this section we will cover such subjects as finding HP-UX stuff, third party vendors, utilities, HP-VUE, the HP-UX operating system, programming libraries, compilers and linkers, various hardware and peripherals, file locations, version 10.x specifics and version 9.10 specifics.

The biggest theme that you will find throughout this section is the differences between version 9.x and 10.x, and how to get them to work together.

Finding HP-UX Stuff

This section covers some of the more common questions on how to find resources for the HP-UX operating system.

Where can I find ftp sites for HP-UX software?

Here are a few sites with a description of their contents:

Site: ftp://interworks.org/pub/comp.hp

Contents: The InterWorks HP-UX Library in the directory pub/comp.hp as described above. The iworks node also keeps the last four to six months of comp.sys.hp.hpux online (via an InterWorks member logon. An archive going back to June 1990 is available. Contact the InterWorks librarian for details.

Additionally, a large (about 1300 line) "HP-UX Troubleshooting Guide" is available under the InterWorks member logon.

Name: ftp://hpux.csc.liv.ac.uk
Contents: Over 1,000 packages ported to HP-UX 8.X and 9.X
Name: http://hpux.csc.liv.ac.uk/ or

http://hpux.cae.wisc.edu/ or

http://hpux.ask.uni-karlsruhe.de/ or

http://hpux.cict.fr/ or

http://hpux.ced.tudelft.nl/ARCHIVE/archive_intro.html or

http://hpux.ee.ualberta.ca/ or

http://hpux.dsi.unimi.it/
Contents: WWW interface to the above HP-UX archive
Name: gopher://hpux.csc.liv.ac.uk
Contents: Gopher interface to the above HP-UX archive
Name: wais://hpux.cict.fr/hpux
Contents: WAIS interface to the above HP-UX archive

There is also a mail server at mail-server@csc.liv.ac.uk for users without FTP.

Name: ftp://hpux.ask.uni-karlsruhe.de
Contents: Official German HP-UX archive site (same as hpux.csc.liv.ac.uk)
Name: ftp://hpux.cae.wisc.edu
Contents: Official US HP-UX archive site (same as hpux.csc.liv.ac.uk)
Name: ftp://hpux.cict.fr
Contents: Official French HP-UX archive site (same as hpux.csc.liv.ac.uk)
Name: ftp://hpux.ced.tudelft.nl
Contents: Official Netherlands HP-UX archive site (same as hpux.csc.liv.ac.uk)
Name: ftp://hpux.ee.ualberta.ca
Contents: Official Canadian HP-UX archive site (same as hpux.csc.liv.ac.uk)
Name: ftp://hpux.dsi.unimi.it
Contents: Official Italian HP-UX archive site (same as hpux.csc.liv.ac.uk)
Site: ftp://export.lcs.mit.edu
Contents: The X Window System and contributed clients.
Site: ftp://hpcvaaz.cv.hp.com
Contents: X Window System libraries and utilities.

ftp://hpcvaaz.cv.hp.com/readonly/hp-vue/ENWARE/released/b0502

contains the latest version of the Envisex and other HP X station software. There are subdirectories for HP-UX hosts, Solaris and SunOS.
Site: ftp://ftp-boi.external.hp.com
Contents: Drivers for HP printers.
Site: ftp://lut.fi/pub/hpux

ftp://lut.fi/pub/unix/hp-ux
Contents: Various
Site: ftp://nic.funet.fi/pub/unix/arch/hpux
Contents: Various
Site: ftp://prep.ai.mit.edu
Contents: The Free Software Foundation's GNU utilities, etc.
Site: ftp://hybrid.irfu.se/pub
Contents: X11 archive and shared libraries, full imake support, and all missing .h files for both X11R4 and R5, dvi2pcl.
Site: ftp://geod.emr.ca
Contents: GNU stuff ported to HP-UX 9.x by Pierre Mathieu.
Site: http://www.cup.hp.com/netperf/NetperfPage.html
Contents: netperf, a network performance measurement tool.
Site: ftp://jazz.gsfc.nasa.gov
Contents: bathymetry, FFT, graph, pgplot, triangulation, sortroutine
Site: ftp://us.external.hp.com
Contents: HP-UX patches available from FTP for SupportLine customers.
Site: ftp://patch.external.hp.com
Contents: European mirror of us.external.hp.com
Site: ftp://jaguar.cs.utah.edu/dist

Currently available in the dist directory:

gdb-4.13.u4

binutils-2.5.2.u4

gcc-2.6.3.u6

libg++-2.6.2.u2

There is no more hpgdb, and gas is now bundled in the binutils.

The prebuilt binaries can be retrieved all at once from

hpuxbin.tar.Z, or in pieces from the hpuxbin directory.
Site: ftp://ftp.cs.colorado.edu/pub/sysadmin/utilities/
Contents: sudo in cu-sudo.v1.3.1-beta9.tar.Z
Site: ftp://ftp.amtp.cam.ac.uk/pub/HP
Contents: ntalk in ntalk.tgz
Site: http://www.am.qub.ac.uk/world/lists/hpmini-l/
Contents: Contains an archive of messages from the HPMINI mailing list, which is dedicated to topics directly relating to Hewlett-Packard workstations and primarily those running HP-UX. There are also other pointers to HP-UX information.

How can I find out what patches are installed on my machine?

On the 9.x systems, there is an installation directory where all the patches are stored. This is the /system directory, and all patches will be included in subdirectories named for the patch. For example, if the patch was the PHSS_9999 patch, there would be a directory named /system/PHSS_9999. The contents would probably look like this:

CDFinfo
copyright
customize
index
new/
orig/

The two subdirectories /system/new and /system/orig contain any modules that were not installed with the patch and the modules that were replaced by the patch, respectively.

Really, the only file that you don't need to archive and get off the disk are the customize file, since it has a list of the modules replaced.

The patches that have been installed are listed in the /etc/filesets directory. A listing of this directory will show what patches have been put on the system.

If the preceding files and directories are missing, there may not be any easy way to tell what is installed, aside from checking the results of what commands against the PHSS_xxxx.txt file.

In 10.x, it is a little easier to list the current patches on the system. The swlist command gives a list of the installed patches, as well as some detail into what modules were and weren't installed. In addition, the swinstall command can be somewhat useful in finding installed patches.

Is there a web site where I can get patches?

The web address is http://us.external.hp.com/. You can download patches from this site, and pointers are available for other related sites.

What types of periodicals are available for HP-UX?

Here's a short list of publications that cover only HP-UX:

Cardinal Business Media, Inc.

101 Witmer Road

Horsham, PA 19044

Publications and Communications, Inc.

12416 Hymeadow Dr.

Austin, TX

What's the best book on HP-UX that I can get?

Well, there aren't that many out there, but the best one I know of is The HP-UX System Administrator's "How To" Book by Marty Poniatowski, published by Printice Hall Hewlett-Packard Professional books, ISBN 0-13-099821-4.

I use this book a lot, and it is probably more used than any other manual I have. In one particular instance, I couldn't find any material to decipher the text-based version of glance plus I was using. The only source of information I could find was that book, and it was quite thorough. There are also a lot of good tips for both workstation and server administration that you probably won't get anywhere else.

What mailing lists should I subscribe to?

There is an HP-UX system administration mailing list run by Bart Muyzer to which you can subscribe. All you have to do is send e-mail to majordomo@cv.ruu.nl with the subject SUBSCRIBE. The body of the message should read:

subscribe hpux-admin
end

This will automatically subscribe you to the e-mail service. If you have any questions about the service, just go to the address owner-hpux-admin@cv.ruu.nl.

What WWW sites are available for HP-related issues?

HP's main site is at http://www.hp.com. From there, you can search for product information and more.

The support line page is located at http://us.external.hp.com. Here you can resolve software problems by searching up-to-date support and problem-solving databases.

Here are some other HP-related WWW sites:

Site: http://hpwww.epfl.ch/HPUX/tools/disktab.html
http://hpwww.epfl.ch/bench/bench.html
http://hpwww.epfl.ch/
Or send mail to mailer@hpwww.epfl.ch to access disktab information.
Contents: Contains many disktabs for non-HP disks
Site: http://hpux.csc.liv.ac.uk/intro.html
Contents: Interface to the Liverpool archive, including package descriptions, man pages, and screen shots as well as the packages themselves. Also includes a WAIS server (wais://www.csc.liv.ac.uk/hpux) for searching HTML documents relating to the archive.
Site: http://hpux.ced.tudelft.nl/HPUX_ADMIN_ARCHIVE/
Contents: Archive for the hpux-admin mailing list.
Site: http://www.eel.ufl.edu/~scot/tutor/
Contents: HP-UX 9.x Tutorial.
Site: http://hpux.ced.tudelft.nl/HPUX_ADMIN_ARCHIVE/index.html
Contents: System Administrators Mailing List for HP-UX.
Site: http://hpwww.epfl.ch/
Contents: French speaking HP WWW support (some information, such as benchmarks and disktab entries, also in English).
Site: http://www.eel.ufl.edu/~sessiont/tutorial/tofc.html
Contents: HP-VUE tutorial.
Site: http://www.interex.org/
Contents: Information from Interex.
Site: http://www.InterWorks.org/
Contents: Information from InterWorks.

How can I get my hands on the SunOS to HP-UX Porting Guide?

You can get the electronic versions of the guide at the Interworks Library. You can access the library by:

FTP: www.interworks.org
WWW URL:
ftp://www.interworks.org

      /pub/comp.hp/porting_info/
        sun_hpux_port_ascii_0295        ASCII version of the Porting Guide
        sun_hpux_port_html_0295.tar     WWW HTML version of the Porting Guide
        sun_hpux_port_ps_0295.tar       Postscript (level 3) version

Third-Party Vendors for HP-UX

The following is a list of vendors for HP-specific products:

Third-party vendors for RAM:

The following vendors are listed in alphabetical order. No guarantees are made regarding compatibility or relative merit of the vendors. Table 29.1 contains other vendors and their products associated with HP-UX.

Camintonn
22 Morgan
Irvine, CA 92718
(800) 843-8336
(714) 454-6500
Clearpoint Research Corporation
1000 E. Woodfield Road, Suite 102
Schaumburg, IL 60173
Schaumburg, IL 60173
Concorde Technologies
7966 Arjons Dr. B-201
San Diego, CA 92126
(800) 359-0282
(619) 578-3188
Dataram
PO Box 7528
Princeton, NJ 08543-7528
(800) DATARAM
(800) 799-0071
Digitial Micronics
2075 Corte Del Nogal
Unit N
Carlsbad, CA 92009
Eventide
1 Alsan Way
Little Ferry, NJ 07643
(201) 641-1200
Helios Systems
1996 Lundy Ave
San Jose, CA 95131
(408) 432-0292
(800) 366-0283
Herstal Automation
3171 West Twelve Mile Rd.
Berkley, MI 48072
(313) 548-2001
IEM
P.O. Box 1889
Fort Collins, CO 80522
(800) 321-4671
(303) 221-3005
Infotek Systems
625 South Lincoln
Suite 204
Steamboat Springs, CO 80487
(800) 767-1084
Intelligent Interfaces
P.O. Box 1486
Stone Mountain, GA 30086-1486
(800) 842-0888
ISA Ltd
1-1-5 Sekiguchi
Bunkyo-Ku
Tokyo 112 Japan
81-3 (5261) 1160
US Office (Texas)
(713) 493-9925
Kelly Computer Systems
1101 San Antonio Rd.
Mountain View, CA 94043
(415) 960-1010
Kingston Technology Corporation
17600 Newhope Street
Fountain Valley, CA 92708
(714) 435-2600
Martech
1151 W. Valley Blvd.
Alhambra, CA 91803-2493
(800) 582-3555
(818) 281-3555
Merida Systems
(617) 933-6790
MDL Corporation
15301 NE 90th St.
Redmond, WA 98052
FAX (206)861-6767
(800)800-3766
(206)861-6700
Newport Digital
14731 Franklin Avenue
Suite A
Tustin, CA 92680
(714) 730-3644
R Squared
11211 E. Arapahoe Rd., Suite 200
Englewood, CO 80112
(303) 799-9292
(800) 777-3478
GFKT HCS Computertechnik GmbH
Oldesloer Str.97-99
22457 Hamburg
Germany

Table 29.1 Third party vendors for other stuff

Vendor Product(s)
Andataco Road
10140 Mesa Rim
San Diego, CA 92009
(619)453-9191
inquire@andataco.com
System integrator and peripheral reseller
Disk Emulation Systems, Inc.
3080 Oakmead Village Dr.
Santa Clara, CA 95051
FAX: 408-727-5496
(408)727-5497
diskmsys@netcom.com
Solid-state disk emulators (SSDs)
IEM, Inc.
1629 Blue Spruce Drive
Fort Collins, CO 80524
Voice: (303)221-3005
FAX: (303)221-1909
email: info@iem.com
Tapes (4mm, 8mm, QIC, 3480), disks, optical, floppy and backup software. SCSI and HP-IB peripherals.
Interphase Corporation
Dallas, Texas 75234
(214)919-9000
High performance bus interfaces 13800 Senlac (EISA/FDDI, VME/ATM.)
ITAC Systems, Inc.
3113 Benton St.
Garland, TX 75042
(800)533-4822
yvonne@moustrak.com
Supports Mouse-trak trackball for HP-HIL
MDL Corporation
15301 NE 90th St.
Redmond, WA 98052
FAX (206)861-6767
(800)800-3766
(206)861-6700
Disk, tape, optical, jukebox, EISA expansion, RAID, others.
Modular Industrial Computers
(615)499-0700
Norma Hansen
MICHIL PS2 to HP-HIL converter. Allows standard PC keyboards and mice to be connected to HP Workstations.
SBE, Inc.
4550 Norris Canyon Road
San Ramon, CA 94583-1389
(510)355-2000
(800)925-2666
fax (510)355-2020
EISA serial and SCSI boards.
Texas ISA
14825 St. Mary's Lane
Suite 250
Houston, TX 77079
(713)493-9925
(800)361-2258
sales@texasisa.com
support@texasisa.com
SCSI & HP-IB External Storage Sub-Systems. UNIX Power Management Solutions-Auto. Startup/Shutdown Devices for networked and non-networked UNIX systems.
Vital, Inc.
4109 Candlewyck Drive
Plano, TX 75024
U.S.A
(214) 491-6907
(214) 491-6909
info@vital.com
Modern Graphical File Editor With Enhanced Softbench Encapsulation.
Workstation Solutions
One Overlook Drive
Amherst, NH 03031-2800
Voice: (603) 880-0080
FAX: (603) 880-0696
jimm@worksta.com
(Jimm Parsons, Technical Services Manager)
Data backup and recovery solutions.
Confluent, Inc.
132 Encline Court
San Francisco, CA 94127
Voice: (415) 586-8700
FAX: (415) 586-8700
info@confluent.com
http://www.confluent.com
UNIX diagramming and flowcharting tools for engineering, technical, and business graphics.

How do I set up perl on my HP-UX machine?

Respond to the configuration questions as follows:

1. When asked for optimization flags: +O1 for HP-UX 7.05 or earlier -O for HP-UX 8.0 or later.

2. For additional flags to cc, type in -DJMPCLOBBER.

3. On additional libraries, only put in -lndbm -lm. Ignore any other libraries that may show up. You can also add -lBSD if you want to add the BSD signal semantics.

4. When asked to use perl's malloc, you can answer y, but in HP-UX 8.07 and above, HP's malloc will work just fine.

5. When asked on which boundary a double must be aligned, answer 8 if you are on a 9000/800 or a 9000/700 (server or workstation) series machine, or 2 for a Motorola 68k (Motorola CPU-based architecture) machine.

The HP-VUE Graphical User Interface

This section covers questions on the HP-VUE X windows based graphics system.

Why are there some things missing from X11 in HP-VUE?

As you may have noticed, HP does not ship a full set of X11 libraries and include files, and does not provide imake or associated tools. There is an HP-maintained, but UNSUPPORTED, set of X11R4 libraries and utilities for the HP 9000 Series 300, 400, 700, and 800. You can get the libraries, include files, and config files (imake) via anonymous ftp from

ftp://hpcvaaz.cv.hp.com/pub/MitX11R4/libs.s*00.tar.Z

The above file is archived on the iworks node. HP has also submitted X11R5 sources to the iworks node, and Bo Thide has X11R4 and R5 support available via anonymous FTP, as mentioned above.

Note that imake is shipped with HP-UX 10.x.

How would I display an image on the root window with HP-VUE?

To do this, you must change the following: Set Vuewm*backdrop*image: none. In the Style Manager for HP-VUE 3.0, there is an explicit choice for this option.

When the backdrop is clear, you can use xloadimage, xsetroot,or xv to display the image of your choice.

How can I get a scroll bar on hpterm windows?

First you must set the resources:

Hpterm*scrollBar:TRUE
Hpterm*saveLines:1024

The saveLines setting can be any large number you choose for saving the number of lines in a window. This number can also be specified for the number of screens you would like to save, such as 4s for four screens. You can do this interactively by using the command hpterm -sb -sl 1024.

These settings can be placed in the app-default file (/usr/lib/X11/app-defaults/Hpterm).

You can have the hpterm window come up with these setting from the VUE panel terminal icon. You can also have their login shell run at the startup of the terminal.

To do this, you must modify the default action of the VUE panel. For a system-wide change, you must modify the /usr/vue/types/xclients.vf file. Simply modify the line hpterm to read hpterm -ls -sb -sl 400. For example:

ACTION Hpterm
TYPE COMMAND
WINDOW-TYPE NO-STDIO
EXEC-STRING hpterm -ls -sb -sl 400
DESCRIPTION The Hpterm action starts an hpterm terminal emulator.

How can I put a title in my hpterm titlebar?

This short program should do the trick:

/* Quick and dirty program to put argv[1] in the title bar of an hpterm
   Tom Arons March 1992
*/
#include <string.h>
main(argc,argv)
        int argc; char **argv;
{
        printf("\033&f0k%dD%s", strlen(argv[1]), argv[1]);
        printf("\033&f-1k%dD%s", strlen(argv[1]), argv[1]);
}

An alternative is

#!/bin/sh
LENGTH='strlen $1'
echo "&f0k${LENGTH}D$1\c"

That's ESC between the first quote and the f0k.

strlen, in case you don't have it, comes from:

#include <stdio.h>

main(argc, argv)
   int argc;
   int *argv[];
{
   if (argc != 2)
      exit(0);
   printf("%d\n", strlen(argv[1]));
}

To set the title in the icon:

#!/bin/sh
LENGTH='strlen $1'
echo "&f-1k${LENGTH}D$1\c"

Where the & is ESC.

Or, you could do it the easy way and start a new window with nohup, run it in the background, and exit out of the original window, using hpterm with the -title option. For example:

nohup hpterm -title (window title) &

Then you can exit out of the original window.

Sometimes my hpterms are disappearing all by themselves. Why?

If you are using the C Shell, check to see if the autologout is set. The default is 60 minutes.

To get rid of this problem, simply edit your .cshrc file and add the line unset autologout.

If you are using the Korn shell, there is a value that may be set for the shell variable TMOUT. To get rid of the timeout period, set this variable to 0.

I'm using a Sun workstation running HP X/Motif clients. How come they take such a long time to display?

This is a problem specific to Sun workstations. There is a patch available from Sun; OW3 patch 100444-35 or the current replacement patch.

This was supposed to be fixed in OW 3.0.1. If you are unable to get a patch or you just need a temporary fix, you can get around this problem by setting the X resource *useColorObj: False on the Sun workstation side of things.

How can I get my login default to work when I use HP-VUE?

1. The HP-VUE User's Guide suggests that people make a copy of /usr/vue/config/sys.vueprofile to ~/.vueprofile. This file contains a detailed set of comments about setting it up so that .login or .profile will be sourced correctly (including details on making sure that tset(1)-like programs are only run when NOT in HP-VUE).

2. When you login via VUE, VUE sources ~/.vueprofile INSTEAD OF your .login (csh), .profile (sh/ksh), and other startup files. Whatever actions are taken in ~/.vueprofile are persistent across any children started by VUE. This means that if you symbolic link ~/.vueprofile to your ~/.profile, VUE will source your ~/.profile before starting the window system, and all children (hpterms, xterms, and their interactive shells) will inherit this environment (prompt variables and all).

The documentation indicates your ~/.vueprofile should contain either csh, or sh/ksh syntax, depending upon what your login shell is. When csh is my login shell, I set my ~/.vueprofile to contain only two lines:

if ( -f /etc/csh.login ) source /etc/csh.login
if ( -f ~/.cshrc ) source ~/.cshrc

When sh/ksh is my login shell, I set my ~/.vueprofile to contain only two lines:

test -f /etc/profile && . /etc/profile
test -f ${HOME}/.profile && . ${HOME}/.profile

So, before starting the window manager and any clients, VUE makes sure that all my shell startup files are sourced and all the variables I want in my shell environment are already there and waiting for me.

How can I get the console messages to go to an hpterm window on my workstation?

First, you need to designate an hpterm session as the window that will receive console messages. That's the easy part. The hard part is getting some kind of clean output that you can actually read.

You need to put this line into your ~/.vue/sessions/home/vue.session file (note that the second line is wrapped for readability):

# Start up the Terminal Console as iconic, and raise it if any output
vuesmcmd -cmd "hpterm -C -iconic -ls -sb -sl 256 -name Console -T Console
-xrm *mapOnOutputDelay:\ 30 -xrm *mapOnOutput:\ True
-xrm Console*clientFunctions:\ -close -xrm *workspaceList:\ all"

When you restart your workspace, this should pop up a window with the output of the system console messages.

How can I get my vuewm key accelerators to work again in VUE 3.0?

You need to add an entry into the ~/.vue/vuewmrc file:

Menu VueWindowMenu
{
    "Restore"          _R        Alt<Key>F5         f.normalize
    "Move"             _M        Alt<Key>F7         f.move
    "Size"             _S        Alt<Key>F8         f.resize
    "Minimize"         _n        Alt<Key>F9         f.minimize
    "Maximize"         _x        Alt<Key>F10        f.maximize
    "Lower"            _L        Alt<Key>F3         f.lower
     no-label                                       f.separator
    "Occupy..."        _O        Alt<Key>O          f.workspace_presence
    "Occupy all"       _a        Alt Shift<Key>O    f.occupy_all
     no-label                                       f.separator
    "Remove from WS"   _e        Alt Shift <Key>F4  f.remove
    "Close"            _C        Alt<Key>F4         f.kill

You also have to add the resource

Vuewm*windowMenu:    VueWindowMenu

and restart the window manager. Then you should be good to go.

Why does the vi editor get all whacked out in xterm on a 9.01 system?

If you are using the C shell, the problem is located in the initial settings for LINES/COLUMNS. You can work around this problem by adding the following to .cshrc:

if ( $?WINDOWID ) then
   set noglob;eval '/usr/bin/X11/resize';unset noglob
endif

A patch is available for this problem. It is PHSS-2753. I suggest that you get the patch and implement it as soon as you can, especially if you use the xterm window a lot.

What is the best way to disable HP-VUE?

Here is one recommendation that is documented for X terminals (it works for workstations too). This takes advantage of the fact that Vue sets several environment variables for the session, one of which is USER.

Modify the /usr/lib/X11/vue/Vuelogin/Xsession (pre-9.0 HPUX) or the /usr/vue/config/Xsession (9.0 HPUX and later) file:

1. Go to the portion that contains the comment Determine the startup if the user didn't specify one.--approximately line 295 in an unaltered version of the file.

2. Add a following case statement to fit your needs. It should look something like:

case $USER in
   martha | joe) startup=${HOME}/.x11start''
esac

You can add as much or as little intelligence to this as you like. The above assumes that the users' have a .x11start script in their home directories, that its permissions are correct, and so on. You can build in a fallback mechanism. For example, the script will check to see if the user has a .x11start script and, if not, fall back to /usr/lib/X11/sys.x11start. To see an example of this logic, do a more(1) on /usr/bin/x11start.

The above case statement is documented in Chapter 2 of the "HP 700/RX System Administrators Guide."

Another method of disabling VUE assumes you have a .xsession file that starts up your initial xterms, other programs, and window manager. Replace your ~/.vueprofile with:

#! /bin/sh
exec sh $HOME/.xsession

Note that the first line was needed, because /usr/lib/X11/vue/Vuelogin/Xsession looks for the shell it wants to use.

My whole screen just got stuck. What can I do, short of rebooting?

You could try to unplug the keyboard for about five seconds and plug it back in. If you do this, you must run xset -r to get the autorepeat back.

Is there any way to get an X client to come up in an alternate workspace?

You should be able to do this by running the command client -xrm workspaceList:<name>.

How can I override the system default printer in vuepad?

First, you must copy the global vuepad to your home directory:

cp /usr/vue/types/vuepad.vf $HOME/.vue/types

Next, you must edit the vuepad.vf file and change the ACTION PRINT_PR_VPAD line as follows:

# The PRINT_PR_VPAD

This action paginates its arguments using pr(1) and prints. It uses arg 2 for a title. It then removes the temp # file. This action is used by the client vuepad.

ACTION PRINT_PR_VPAD
        TYPE            COMMAND
        WINDOW-TYPE     NO-STDIO
        EXEC-HOST       %LocalHost%
        EXEC-STRING     /bin/sh -c "pr -h %Arg_2% %(File)Arg_1% | \
                                lp -d%"Printer:"%; rm %(File)Arg_1%"
END

If you implement this, the dialog box will prompt you for the printer name.

Be careful that you don't have the LPDEST set in your .vueprofile, because lp will use that instead of the system default.

How can I prevent anyone from logging in as root from the console with VUE?

This can be configured in your /usr/vue/config/Xstartup. Here is a good example of a configuration:

if [ -f /etc/securetty ] &&
      # pwget is an HP command which checks also for Yellow Pages.
      # exit code from awk is inverted (!) since sh's tests are...
      # === a more simple test would be [ "$USER" = root ] ===
      pwget -n "$USER" | awk -F: '{ exit !($3 == 0) }'; then
         echo Root Login not allowed | /usr/lib/X11/ignition/text_dialog ERROR
         exit 1
   fi
   if [ -f /etc/nologin ]; then
      exit 1
   fi
   exit 0

See man vuelogin(1X) for more details.

The HP-UX Operating system

This section focuses on operating system-specific issues, the solutions to which may not be so obvious.

How do I determine what the device name for the CD-ROM drive is so I can add it into the /etc/checklist file for mounting? I'm using an HP9000 machine running 9.04.

The best thing to do is to go into SAM under the disks and filesystems section to set up your CD-ROM. Sam not only gives the advantage of ease of use, but it also ties up all the loose ends, such as creating the entry in the /etc/checklist file.

Go into filesystem, then pull down Actions|Create a New Filesystem, then choose non-lvm filesystem. A list will pop up showing the configured disks on the system, one of which will be your CD-ROM. Now fill in the required fields. You will have to already have a directory created to which you mount the filesystem; /cdrom is often the directory name used.

How would I go about extending the root volume group?

Well, it ain't easy, but it can be done, though somewhat indirectly.

There are two schools of thought on this one: Rebuild the system from scratch, or move subdirectories and their contents to other mounted filesystems.

If you opt for rebuilding the system, you could actually look into building a new system on another group of disks and having two operating systems from which to choose on the same server or workstation.

Basically, all you have to do is define the primary boot path to the new root disk, install the operating system to that disk and modify certain system files, such as /etc/fstab, to point back to the original filesystems (except for the root filesystem, of course). I make it sound much easier than it is, but this procedure is actually well documented in the HP manuals.

If you decide to move the volatile directories (/usr, /opt, /var, and other user created filesystems to other filesystems, it may be a better idea if you don't have the extra disk space. You can only do this if you haven't already set up the usual volatile filesystems separate from the root, or if a directory or two is unusually large in the root filesystem.

Here, you want to do one of two things: You can create different filesystems and create links from the original directories; or you can move everything in the original directory to a temporary location, recursively delete everything from the original, create a logical volume with the appropriate amount of space, mount the filesystem from that directory, and move everything back from the temporary location. This must be done in single-user mode.

If you choose to do it the latter way, be very cautious; certain files and directories may not be very obliging to you, and the system may become confused. Be especially careful around device drivers. A system panic is not a pretty site.

Also, as with any kind of operating system surgery: ALWAYS MAKE A FULL BACKUP FIRST!!! This has come to be known as the "save your É job" step.

Whatever you choose, define a clear plan, document everything, and do a quick runthrough before you even consider giving the patient any anesthesia.

Is there any way to change the CDFS filename from all caps to lowercase on a 10.10 system?

No. What you must do is mount the CD using the pfs subsystem instead of the CDFS subsystem, as is the default. This will allow you to use lowercase.

I'm planning on upgrading from 9.04 to 10.01. Would it be easier just to do a completely new install?

Upgrading isn't that bad. As a matter of fact, it is preferable to do an upgrade because it provides transition links that will allow you to continue to use the old path names from 9.04, and it keeps important things intact, such as /etc/hosts, /etc/passwd, and more.

Since upgrading from 9.04 to 10.01 is really upgrading from the BSD-based UNIX to System V-based UNIX, many commands get moved to comply with the System V standards. For example, all of the lvm commands get moved from /etc to /usr/sbin.

Additionally, an upgrade will retain your site-specific information and provide analysis tools to help you convert any customized scripts you might have. The snoop tool is used to identify errors that will pop up when you upgrade, so you have a chance to straighten out any problems before they arise. This will help you to not run into an abort situation on upgrade, which can completely hose your system.

As always: DO A FULL BACKUP FIRST!!!

How can I get Windows 95 clients to use NFS on my HP-UX machine?

In general, the NFS server provides the basic file sharing capabilities (nfsd), as well as the establishment of connections through mountd. In its basic form it's used between all UNIX machines, which use intrinsic multi-user authentication systems using UNIX user name and UNIX user IDs. When a user logs into an NFS client machine, she is using its native authentication system to obtain a user ID. She can then access files using the user ID. By implication, both systems have the same view of the users. Since this is the case, the security authentication is performed by the NFS server machine.

The access control of the filesystem is done at the host level by exporting or publishing filesystems on the NFS server to individual workstations or to all NFS client workstations. Once exported, the NFS client can explicitly choose to mount any or all of these filesystems.

To enable file sharing between heterogeneous operating systems that employ different authentication systems, use the PCNFS utility. The NFS client is then deemed insecure, and the mount authentication is deferred to the NFS server or another delegated UNIX host.

The PC compatibility server PCNFSD handles this process at the server side. An NFS client initiates a filesystem mount by forwarding a UNIX username and password to the PCNFSD server. The username and password are then validated, and a corresponding UNIX user ID is obtained on behalf of the NFS client. Once the mount is established, the original NFS server NFSD handles file requests.

Filesystem access is then controlled by exporting to specific hosts and also by requiring the user name and user ID. Also, the PCNFSD can provide additional file locking and printer sharing capabilities.

To start PCNFS in HP-UX 9.x:

Edit the /etc/netnfsrc file and change the line

PCNFS_SERVER=0

to

PCNFS_SERVER=1

To start PCNFS in HP-UX 10.x:

Edit the /etc/rc.config.d/nfsconf file and change the line

PCNFS_SERVER=0

to

PCNFS_SERVER=1

On both systems you must reboot the server to enable PCNFS.

Is there a nice GUI for ftp on X Windows that I can install?

There is a program called LLNL XDIR. It provides a graphical user interface for file transfer and for direct manipulation of local and remote directories on UNIX and a few non-UNIX machines. It offers the ability to view directory information in four different formats, ranging from long lists to tree structures.

LLNL XDIR is based on UNIX, C, OSF/Motif, and FTP, so it is portable across most platforms.

Neale Smith of the Lawrence Livermore Computing Department wrote the code, and it is available at:

ftp://coral.ocf.llnl.gov/pub/ia/llnlxdir/latest_xdir.tar.Z

You can also check out the web site at:

http://www.llnl.gov/ia/xdir.html.

What is Hewlett-Packard doing about the year 2000 problem?

According to HP documentation:

"Complete year-2000 functionality will be fully supported with HP-UX 10.30, currently scheduled to be available in the summer of 1997. HP will patch 10.01, 10.10 and 10.20."

They are apparently not patching 9.04. Guess you might have to upgrade.

How can I look at all of the currently open files?

You can use the lsof command to show all open files for all processes or just their listing via a wide range of filtering options, including Internet address selections.

If you don't have losf loaded on your machine, you can pick up a free copy at:

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof

Why won't the catman command build my man database on 10.10?

There is actually a bug for which you must get a patch. You need to access the HP patch site to get it, or you can call the HP support line to have them send you a tape.

My system has 1.5 GB of real memory installed, and I'm running large Oracle databases. My memory utilization never gets above 84 percent even though I have the "Maximum Dynamic Buffer Cache Size as Percent" set to 90. Why isn't the remaining memory being used?

The Dynamic Buffer Cache is used in 10.x instead of "buffpages" for disk buffers. So the Oracle database will compete for the same memory as your disk buffers, which probably accounts for some very poor cache performance.

If you set that parameter to a lower number, say, 10 percent, you should get more performance out of your database.

When I use elm in hpterm, my arrow keys stopped working. Why?

The settings may be wrong in your elm configuration file. Check the $HOME/.elm/elmrc file to see if these values are set:

keypad = ON
softkeys = ON

How do I get swinstall to work with the CD-ROM disk?

First, you must mount the CD as a filesystem. Create a directory off the root (usually /CDROM) and use SAM to mount the CD to that directory. Then when in the swinstall window, specify the software depot as /CDROM. Now you can choose the software to install (after you enter the code words, of course).

How can I increase the number of inodes on a filesystem?

If you are using the VxFS filesystem, it is altered dynamically. If you're using HFS (standard), you will have to use newfs or mkfs to rebuild the filesystem. Unfortunately, this will also destroy all the files on this filesystem.

You can use the -i option with newfs or mkfs to change the number of inodes.

You should keep in mind, though, that when you increase your inodes, you lose disk space for files.

Can I make filenames that are longer than 14 characters?

If you don't already have long filenames, you can use the /etc/convertfs utility to change to long filenames. This is a one-way street, however. You can't go back after you've made the change.

To check for the existence of long filenames, do the following:

tunefs -v /dev/rdsk/(disk driver) |grep magic

You will get output that looks something like this:

magic   95014   clean   FS_OK   time    Tue Mar 23 14:13:01 1993

If the number in the second field is 95014, long filenames is installed on this file system. If the number equals 11954, the4 system is set to short filenames.

Then getconf command can also be used on each directory as follows:

getconf NAME_MAX (directory)

How can I tell what products have been loaded on my system?

You can check the /etc/filesets directory. There you will find a file for each fileset that has been loaded which summarizes the files in that fileset. Several utilities use this directory, such as /etc/update, /etc/updist, /etc/netdistd and /etc/rmfn for unloading and loading software.

On HP-UX 10.x there is a utility to do just this. Just use the swlist command.

What is the best way to safely remove software from an HP-UX system?

On HP-UX 9.x, the /etc/rmfn command will remove HP software cleanly. On HP-UX 10.x systems, the utility is swremove.

Why are mail files in /usr/mail owned by the daemon instead of the recipient?

The mail delivery agent /bin/rmail needs to be able to chown(2) these files. It cannot do so if you have removed the privilege CHOWN (see setprivgrp(1m); removing CHOWN is recommended to prevent cheating on disk quotas).

To get around this, noting that /bin/rmail runs setgid to group mail, you can grant privilege CHOWN to group mail only by inserting the line mail CHOWN in /etc/privgroup. The change takes effect on the next reboot, or immediately if you execute the command setprivgrp -f /etc/privgroup.

Should I worry about owning just a two-user license?

There are several fundamental things to remember about HP-UX licensing:

Ascii Terminals:

The simple rule to remember is any ASCII terminal that is logged in counts as a user.

ASCII terminal connections come in several different forms:

X-terminals and workstations:

When a customer buys an X-terminal or workstation from HP or from another vendor, HP acknowledges that the customer has also bought a single UNIX license-to-use.

Therefore, the customer has the right to an unlimited number of logins and terminal windows over the LAN to a Series 700 or Series 800 from either X-terminals or workstations. These logins can be via X terminal windows (hpterm and xterm), telnet, rlogin, or other means.

PC's that use X terminal emulation software, such as XView, each count the same as an X terminal. This is because the PC essentially becomes an X terminal when it is running the X server software. Therefore, when a PC is running an X terminal emulator, the PC has the right to an unlimited number of logins to an HP-UX system.

Exceptions:

The policy of counting DTC users is new for the Series 700. Customers who purchased Series 700 systems prior to HP-UX 9.0 shipments (late 1992) and use them as host systems for multiple DTC-connected terminals, may continue to use those configurations without buying a license upgrade.

An update to HP-UX 9.0 will not lock out these configurations.

How can I tell what patches are in my 9.x kernel?

On 9.x, you can run the command what /hp-ux. This will give you a list of patch strings. This you can compare to the strings in the patch text file to see if the patches are actually loaded or not.

How can I boot into single user mode?

There are two ways of doing this. You can either run (from the super user login) init 1, which will bring the system run level down to single user mode, or you can have it switch at bootup.

If you choose to do it the hard way, do the following:

1. Interrupt the automatic boot when asked by the system.

2. At the next prompt, tell the system to boot to the primary boot path. For example, in 10.x, give the command bo pri to boot to the primary boot disk.

3. It will then ask if you want to interact with the ISL. You reply y.

4. At the ISL prompt, type hpux -iS disc(;0)/hp-ux.

The system will now boot into single user mode.

Why does my Korn shell login hang?

This is usually a problem associated with a user's home directory being in an NFS mounted directory.

The workaround to the problem is to completely unprotect (chmod 777) .sh_history, or you can point to a different HISTFILE somewhere on your local machine.

Can I get rid of the copyright notices on login?

Yes. The following code in /etc/profile prints the copyright notice the first time each user logs in:

        NUMLOGINS='/etc/last -2 $LOGNAME | wc -l'
        if [ $NUMLOGINS -lt 2 ]
        then
                cat /etc/copyright
        fi

And, for /etc/csh.login:

set NUMLOGINS='/etc/last -2 $LOGNAME | wc -l'
if ( $NUMLOGINS<2 ) cat /etc/copyright

How do I go about turning off quota checking?

Here a few things that you can do:

1. rmfn quota fileset

This will still allow you to keep using quotas, as long as the NFS server still has quota enabled and is exporting it with all the quota settings turned on, even though the HP itself might not have it. Watch out though, since this deletes /usr/bin/quota. So make a copy, if you still want to have the ability to run the quota -v command.

2. mv /usr/bin/quota /usr/bin/quota_check. cp /bin/true /usr/bin/quota

This will still make the login program do the quota check, but at least it goes by quickly now (as opposed to actually checking every single NFS mount with quota, and so on.) Then, just run quota_check whenever you want.

3. Remove execute permissions for /usr/bin/quota as in:
$ chmod -x /usr/bin/quota
This prevents quota from running. It's also a self-documenting flag in that a future system manager who tries to run /etc/quota will get the cannot execute error message.

4. chmod -x /usr/bin/quote /etc/edquota

This appears to turn quota completely off (which is what I suspect the vast majority of people want) and not only speeds up the login process, but eliminates any annoying messages.

What limits the amount of memory a process uses?

The first limiting factor is probably swap space. The combined virtual data space of all running processes can't exceed swap size. Run /etc/swapinfo -t and look at the total line. That's all you have left.

For FORTRAN programs:

1. Increase the kernel's stack limit (maxssiz). You can do this with SAM (Kernel Configuration-> Modify Operating System Parameters-> Process Parameters). The practical limit for user stacks is around 80 MB. Your system probably has an 8 MB limit. Try 16 MB or 32 MB depending on your expected use. Give SAM a number that is a multiple of the 4096-byte pagesize.

2. Change your array allocation. HP FORTRAN allocates noncommon, nonsaved arrays on the process stack. Common blocks and saved variables are allocated in the process data segment (with much larger size limits). If your arrays are declared in the main program and passed to subroutines, you can just save the big ones in the main program, or put them in a common block in the main program, or recompile with -K because -K puts all local variables in the data segment. (-K is a sledgehammer approach, but it gives you a quick indication that stack size is the issue.)

3. Make sure you have enough swap space.

How can I install ramdisk?

HP does not support this, but you can still install it if you want. First, make sure ram is configured into your kernel and then make device files with major 9 (both blcok and char), minor 0xVSSSSS, where V is the volume number, SSSSS is the number of sectors in the ram disk, and a sector is 256 bytes.

An example would be:

mknod /dev/ramlm c 9 0x101000

This would make a 1 MB ram disk. Next, you must make a file system on it, and mount it to be used:

mkfs /dev/ramlm 1024

In addition, you will have to make a block device file.

What is a good suggestion for clearing the /tmp and /usr/tmp directories?

Here are a couple of scripts to run from cron:

#!/bin/sh
DAYS=7
find /tmp /usr/tmp -depth -hidden -fsonly hfs -atime +$DAYS -exec rm -rf {} \;

The -depth option ensures that no directory is removed before its contents; -fsonly hfs is used because occasionally I've NFS-mounted directories there, and it's better to do the clearing in the machine where it's local, and -hidden is used in case a CD-ROM filesystem (CDFS) appears there for some reason.

Another way of doing it is:

#!/bin/sh
DAYS=7
DIRS="/tmp /usr/tmp"
find $DIRS -type d -atime +$DAYS -exec rm -rf {} \;
find $DIRS ! -type d -atime +$DAYS -exec rm -f {} \;

What is a good way of partitioning HP-UX disks on a 700 series workstation running 9.x?

Following is a sample file that lists the sdsadmin commands to divide a disk into two partitions. Note that this is specific to the M2654SA disk; your mileage may vary. The mediainit is probably not required if the vendor has formatted or verified the disk. It is not supported to partition the boot disk, and you must go through some contortions to do it.

Note also that, in order to have several partitions on the root disk and have swap, you must create another partition that you dedicate to swap.

Note that 10.x s700 systems support LVM, which allows great flexibility in partitioning.

#
# SDS configuration file for this node.
#
# To rebuild the /u1 and /news Fujitsu M2654SA disk partitions, do:
#    mediainit -v /dev/rdsk/c201d5s0
#    sdsadmin -m -C /usr/local/etc/sdsadmin.config.u1news /dev/dsk/c201d5s0
#    newfs -L -n -v -m 2 -i 16384 /dev/rdsk/c201d5s1 HP_M2654Su1x1-2
#    newfs -L -n -v -m 2 -i  2048 /dev/rdsk/c201d5s2 HP_M2654Su1x1-2
#
# Disk partitions:
#
# 1   /u1     145xxxx 1K blocks (/dev/dsk/c201d5s1, /dev/rdsk/c201d5s1)
# 2   /news    55xxxx 1K blocks (/dev/dsk/c201d5s2, /dev/rdsk/c201d5s2)
# -   -----   -------
#             2006016 1K blocks
#
type    M2654Su1x1-2
label   u1_news

partition 1
   size 1450000K

partition 2
   size      max

What is a good way to print man pages?

You can get all fonts, line widths, and sizes on a Laserjet printer as follows:

zcat manfile.1 | nroff -man -Tlj | lpr (printer)

To get a PostScript printout, with the GNU groff, do the following:

zcat manfile.1 | groff -man -Tps | lpr (printer)

For man pages with tables, you will also have to pipe the output through tbl.

Also, some man pages may need the HP macros to print. For example:

zcat manfile.1 | groff -t -e -C -M/usr/lib/tmac -man -Tps | lp (printer)

You can also print off a more crude version of the man pages by simply piping the output to the lp command, using the -onroff option:

man <manfile> | lp -onroff

What is a good way to limit core files?

There really is no way to limit core files in the standard shells. However, there are a couple of workarounds if you know where to expect core dumps to take place.

One is to create a directory called core with no permissions (000) in the directory in which you expect a core dump to occur. Or you could create a file called core in the directory where the dump occurs and link it to /dev/null.

Two programs are available that act as wrappers around other programs that you may expect to dump. These are nocore and corelimit.

In addition, some shells are publicly available, such as tcsh, which allow you to limit core files.

The only exception to the rule for standard shells comes in version 10.10 and later, where the csh does allow you to limit the core files.

Here is the source for the corelimit program.

Build it in the usual way (cc -o corelimit corelimit.c) and use it in the format of: corelimit hpterm 0. This will limit the core file size of all children of the hpterm process to 0.

#include <stdio.h>
#include <sys/resource.h>
#define RLIMIT_CORE     4               /* core file size */

main(argc, argv)
int argc;
char **argv;
{
int res;
struct rlimit rlp;
        if (argc != 3) {
           fprintf(stderr, "%s: wrong number of parameters\n", argv[0]);
           fprintf(stderr, "\tformat: %s command core_size\n", argv[0]);
           exit(-1);
        }
        rlp.rlim_cur = atoi(argv[2]);
        res = setrlimit(RLIMIT_CORE, &rlp);
        if (res < 0) {
                perror("setrlimit: RLIMIT_CORE");
                exit(-2);
        }
        system(argv[1]);
}

Or, you can edit /etc/vuerc to start all of VUE that way:

at line 22 replace:

  exec $VUELOGIN $VL_ARGS </dev/null >/dev/null 2>&1

with:

  exec /usr/local/bin/nocore $VUELOGIN $VL_ARGS </dev/null >/dev/null 2>&1

Is it possible to put more than one backup volume on a tape with fbackup?

Unfortunately, fbackup will always rewind the tape on you. However, here are some alternatives:

1. Stick with dump/cpio/tar.

2. Use a pipe. Instead of telling fbackup where the DAT is, let it send its output to stdout (-f -) and pipe it to the DAT, using Berkeley no-rewind device and dd with a suitable block size (for instance, 10 KB). You'll lose fast search and resync capability after error functionality, though. Also, the complexities of managing multiple archives per tape make this a high risk proposition.

3. Turn your machines into a cluster served by the one with the DAT and do all backups there. Unfortunately, clusters are not supported by HP-UX 10.0, so this is not a long-term solution.

4. Use NFS and mount the disks of the machine without DAT to the other machine and back them both up there. You'll have to mount them with root permissions, and restoring a completely destroyed root disk will be messy.

I have a large number of patches that must be loaded onto a machine. Is there any way to do this automatically?

You can do batches of patch installs at one time on both 9.x and 10.x, though they use different methods.

For 9.x, you must set up a netdist server by running /etc/updist to load all the patches you want into a netdist area. Then you start /etc/netdistd to install everything from there.

10.x has a utility called swcopy that you use on each patch to copy the patch into a central depot. You can then use the swinstall utility to install all the patches from this depot.

What's the best way to set up an HP-UX workstation as an X terminal?

Do the following steps:

1. Install the minimum operating system with network and X11. When you install X11, you have to install it without Motif or VUE).

2. Edit the /etc/inittab file and change the following lines:
init:2:initdefault:
vue :34:respawn:/etc/vuerc #VUE validation and invocation
to:
init:3:initdefault:
vue :34:respawn:/usr/bin/X11/X -query HOSTNAME # X server startup
3. Replace HOSTNAME with the name of the host running the X Windows server and reboot.

How come I'm unable to access all of my swap space?

In the kernel parameter, the default value of maxswapchunks is defined as 512 MB. When you add more swap to the system, you also must increase the value of maxswapchunks.

What must I do to get a daemon to successfully start from /etc/rc in HP-UX 9.x?

/etc/rc kills all child processes on exit; daemons started from localrc() (for example) must have called setsid() and have been given time to "daemonize" themselves.

If your system doesn't have the C compiler, you can use a call to nohup to start the daemon instead of calling setsid().

Another trick that works is to include the following command in the rc file:

   /usr/bin/at now + 1 minute < /etc/rc.at

Then create a file named /etc/rc.at, which should contain the command to start the daemon. Your daemon will start one minute after the rc file calls the command. You can use times other than one minute as well.

How come I sometimes just "lose" my /dev/null?

This is a problem that may occur when root invokes the C compiler on a nonexistent file in 9.x. You may want to track down any root commands that may be doing this.

What can I do to trace network packets?

HP has a utility called nettl to trace all packets seen by the device driver on the HP nodes, except diskless packets. These packets are those sent by the node or addressed to the node.

Here are the steps to follow when using this utility:

1. Start trace--Put data into 1 MB trace file. The data will be stored in /tmp/raw.TRC0 and /tmp/raw.TRC1. The most recent data will always be in TRC0. When it fills up, TRC0 is renamed TRC1, and new logging continues in the TRC0 file. They fill up quickly!
     /etc/nettl -tn pduin pduout -e all -f /tmp/raw
If you need to trace a LOOPBACK interface as well, consider:
     /etc/nettl -tn pduin pduout loopback -e all -f /tmp/trace
2. Stop trace as soon as an event occurs!
    /etc/nettl -tf -e all
3. Format trace into a print file:
    /etc/netfmt -N -n -l -f /tmp/raw.TRC0 [ -c /tmp/filter ] > /tmp/fmt0
    /etc/netfmt -N -n -l -f /tmp/raw.TRC1 [ -c /tmp/filter ] > /tmp/fmt1

    -N - print in "nice" format (e.g. interpret)
    -n - print IP addresses, not hostnames
    -l - do not highlight fields (for hpterm)
    -f - optional, use a filter file (see "filtering", below)


NOTE: netfmt takes a while to run! There will be plenty of information in the trace file--interpretation may be necessary!
4. Filtering. Create a filter file to tell netfmt what packets you are interested in seeing.
    E.g. only display packets to/from IP address 192.10.10.1:
    filter ip_saddr 192.10.10.1
    filter ip_daddr 192.10.10.1

    Filter out all put NFS packets (to/from UDP port 2049)
    filter udp_sport 2049
    filter udp_dport 2049

    Filter out all but TCP packets to/from port 25 (sendmail)
    filter tcp_sport 25
    filter tcp_dport 25

    Filter on ethernet addresses:
    filter dest 08-00-09-49-91-4a
    filter source 08-00-09-49-91-4a
You can put these together (filter all NFS packets to or from an IP address).
    filter ip_saddr 192.10.10.1
    filter ip_daddr 192.10.10.1
    filter udp_sport 2049
    filter udp_dport 2049

For some reason my Alt key combinations don't work in emacs X mode. How can I fix this?

Run the following through xmodmap:

keysym Alt_L = Meta_L
keysym F12 = Multi_key
clear mod1
add mod1 = Meta_L
clear mod2
add mod2 = Alt_R Mode_switch
keysym Alt_R = Mode_switch

The result is:

The left Alt key acts as the Meta key.

The right Alt key (Alt Gr) selects the extra characters Martin is talking about. (AltGr-o = o).

It is even possible to use both Alt keys together, resulting in Meta versions of the extra characters.

Why can't I get FLEXlm-based licensing to work?

There is a bug in version 2.4 that requires /dev/lan0 to have read and write permissions for everyone. This may be a bit insecure, but in versions after 2.4 this was fixed.

If you can't upgrade right away, here is a workaround:

1. Create a new group called lan0.

2. Modify the groups and permissions to look like this:
crw-rw----   1 root     lan0      52 0x202000 May 20  1993 /dev/lan0
3. Change the groups and permissions with g+s on any binaries that need to access /dev/lan0. For example, for Interleaf, you need to do this for /interleaf/ileaf5/hp700/bin:
-rwxr-sr-x   1 compsci  lan0     5255168 Jan 29  1992 ileaf

There will probably be a problem if you are using an FDDI card, particularly if there is no Ethernet card present in the machine. The problem would pop up when you run the Flex utility lmhostid, as it might not return the LAN address of the FDDI card. This specific problem occurred in 9.01 and may not be present in later releases, but just be aware of the problem.

If you are running 9.01 you can get the patch PHNE_4003 to fix this problem.

How do I set up group-based FTP access?

Here is how to set up ftp so that a group of users only have ftp access, they all have their own individual password, but they all access the same set of files (the system thinks they are all really the same ftp user). With only a slight change, you can have a group of users, all of whom only have ftp access, each with their own individual password, and access only to their own set of files (this is left as an exercise for the reader).

1. Set up anonymous ftp (assumed in later instructions to be at /users/ftp).

2. Add a user and group to /etc/passwd and /etc/group.

For example, in /etc/passwd:
        ftpuser:*:1000:1000:FTP User:/users/ftp/ftpusers:/bin/false
and in /etc/group:
        ftpgroup:*:1000:ftpuser
Note that ftpuser login is disabled (a * in the password field). This allows various utilities (such as ls) to recognize files that belong to an ftp user (particularly important for backups).

3. In /users/ftp/etc, you must have group and passwd files of the same format as their related system files. For example, in /users/ftp/etc/group add:
   ftpgroup:*:1000:
and in /users/ftp/etc/passwd add:
   ftpuser:*:1000:1000:FTP User:/ftpusers:/bin/false
Also, for each individual to whom you want to give access, add an additional entry. Note that these have passwords (see passwd(1) for instructions on setting passwords in this file).
   george:3RgfBzfnipJPQ:1000:1000:George Smith \
               (FTP User):/ftpusers:/bin/false
A few things to notice. ftpuser is disabled. The home directory for ftpuser is simply /ftpusers, because anonymous ftp performs a chroot to the home directory specified for ftp in /etc/passwd (see chroot(2) and chroot(1M) for details). george has the same user ID, group ID, and home directory that ftpuser has. george will login as george with his own password.

4. Under /users/ftp, create the directory ftpusers. Make this directory with owner ftpuser and group ftpgroup, with 770 permissions. This effectively prevents anonymous ftp access to this directory, since it is not world readable/writable.

That's it.

   Users access the system via anonymous:
   $ ftp sysname
   Connected to sysname.whatever.
   220 sysname FTP server
   Name (something:someuser): ftp
   331 Guest login ok, send ident as password.
   Password:
   230 Guest login ok, access restrictions apply.
   Remote system type is UNIX.
   Using binary mode to transfer files.
   ftp>

   Then, they use a sublogin to access their files:

   ftp> user george
   331 Password required for george.
   Password:
   230 User george logged in.
   ftp> pwd
   257 "/ftpusers" is current directory.
   ftp>

Users are placed in whatever directory is specified as their home directory in /users/ftp/etc/passwd (relative to the chroot at /users/ftp).

To remove access, remove their passwd entries from

   /users/ftp/etc/passwd.

This is all documented (though poorly) in the various ftp-related man pages.

What does the number in the uname tell me?

The first number will always be 9000 (at least for HP-UX boxes). The second number, however, does relate to specific machine types. Here is a translation:

Model number on the     String returned
   outside of the box      by uname -m
   -------------------     ---------------
        default ----------> 9000/800
        E25 --------------> 9000/806
        E35 --------------> 9000/816
        E45 --------------> 9000/826
        E55 --------------> 9000/856
        F10 --------------> 9000/807
        F20 --------------> 9000/817
        H20 --------------> 9000/827
        K400 -------------> 9000/829
        F30 --------------> 9000/837
        G30/H30 ----------> 9000/847
        I30 --------------> 9000/857
        G40/H40 ----------> 9000/867
        I40 --------------> 9000/877
        G50/H50 ----------> 9000/887
        I50 --------------> 9000/897
        G70/H70 ----------> 9000/887
        I70 --------------> 9000/897
        G60/H60 ----------> 9000/887
        I60 --------------> 9000/897
        T500 -------------> 9000/891

If HP-UX can't determine the model number of the machine, it defaults to 9000/800 (800 as a general designation for servers). If you get this as a return value, you probably should contact HP to update your stable storage in your machine.


TIP: If you are using HP-UX 10.0, you can run the model command to show which model you have.

Can I get an MS-DOS floppy formatted using HP-UX?

Although you can use the dosif commands to read and write to floppies, there really is no fully supported way of formatting a floppy.

There is a workaround though. First, perform the basic mediainit with the -f16 switch (which will cause the floppy to be formatted with the full 80 tracks, rather than HP's default safer, but nonstandard, 77+3 spare tracks, 512-byte sectors, with no sector skew). This is the setting for most standard PC floppies.

Next, you copy the FAT, directory, label, and other such disk information into the first N sectors, where N=20 would be more than enough.

Before you can copy the disk header onto other disks, you must first copy it from an already formatted, blank PC diskette. You do can this with the following command:

dd if=/dev/rfloppy of=/(directory) bs=512 count=20

To format a floppy, you simply write back that header to each floppy to be formatted with the same command, only you need to switch the if and of commands.

A variant of this command for faster formatting would be:

dd of=/dev/rfloppy if=/(the copied header) ibs=512 count=20 obs=9k conv=sync

Doing this will cause the floppy I/O to be done in multiples of 9 KB, or one cylinder at a time.

You should also have two headers: one for 720 KB and one for 1.44 MB floppies.

The following is a ksh script to determine the capacity of a floppy loaded in the drive:

#!ksh
kbsize=$( diskinfo -b /dev/rfloppy 2>/dev/null )
    if (( $? != 0  ||  $kbsize == 0 )) ; then
        print -u2 "$0: No media found"
        rm -f core  # 9.01s700 diskinfo coredumps
        exit 1
    fi

Is there any way to get the MAC address of a network card automatically?

The following is some sample LLA code for determining the MAC address of your station's card. It will only work on 9.x or previous versions of HP-UX. For 10.x, you need to use DLPI code, which can be found on HPSL. The document number is CWA940907000, and it gives a more thorough explanation.

/*

Here's some sample code that you can use to get your own station address (otherwise known as MAC address or LAN card address). Be sure to compile this with the -ln option, since the net_ntoa(3N) call is found in /usr/lib/libn.a.

This program was compiled by doing: cc get.c -o get -g -ln.

*/

#include <stdio.h>
#include <netio.h>
#include <fcntl.h>

main(argc, argv)
int    argc;
char   *argv[];
{
   struct fis s_fis;
  
int lanic;
   char *ascii[6];

   if (argc < 2) {
      printf ("Usage: %s <device file>\n", argv[0]);
      exit (1);
      }

   lanic = open(argv[1], O_RDWR);
   if (lanic < 0) {
      perror("Error in opening %s", argv[1]);
      printf("Error = %d\n", lanic);
      exit(1);
   } else {
      s_fis.reqtype = LOCAL_ADDRESS;
      s_fis.vtype = INTEGERTYPE;

      ioctl(lanic, NETSTAT, &s_fis);
      net_ntoa(ascii, s_fis.value.s, 6);
      printf("Station address of %s is %s\n", argv[1], ascii);

      s_fis.reqtype = PERMANENT_ADDRESS;
      s_fis.vtype = INTEGERTYPE;
      ioctl(lanic, NETSTAT, &s_fis);
      net_ntoa(ascii, s_fis.value.s, 6);
      printf("Permanent Station address of %s is %s\n", argv[1], ascii);
      close(lanic);
      }
}

Is there a way to disable IP forwarding in 9.x?

First, you must be logged in as root. Then you can use the following commands:

adb -w /hp-ux /dev/kmem
ipforwarding/W 0
ipforwarding?W 0
<CTRL-D>

Any time you install a new kernel, you must repeat these steps to disable IP.

Are threads supported on HP-UX 9.0?

A user space thread package was shipped with the DCE product. On HP-UX 10.0, this package was shipped as part of the operating system.

Why can't I type an @ character?

You probably have the @ key set to a kill character. To check this, run the command stty -a to see the settings. If it is set to kill, you can reset the kill character by running the command stty kill ^C.

In addition, you should add this line to your .profile or .cshrc file to get this option every time you log in.

I have a 9.x machine, and I want to check to see if a specific fileset is installed on my machine. How would I go about that?

You can create a script on your machine that checks to see whether all the files are installed in the correct place. It won't, however, check file permissions or whether the kernel files are in the kernel.

#!/bin/sh
FSET=/etc/filesets/$1

if [ "$FSET" = "" ]; then
   echo "syntax of command $0 Filesetname "
   exit 1
fi

if [ ! -f $FSET ]; then
   echo "Fileset $FSET not found"
   exit 1
fi

# simple test to see non zero size files of any type
while read File
do
  if [ ! -s $File ]; then
     echo "$File not found"
  fi
done < $FSET
exit

Certain filesets have their own verify scripts in 9.x. These are:

NS-SERV, which has the script /usr/nettest/nsverify/ver_ns
STREAMS, which has the script /usr/bin/strvf

Can you bundle up a package of files on HP-UX 9.x?

The fpkg program is used to build a special tar file that is readable by the update utility. That way, you can just install any fileset that you can create with the update utility.

In addition, you must create a PDF file with the mkpdf program. The following will add the PDF file:

pn  MY-PROD
    pd  My product description
    fv  V.1.0.0
    F
>    <somedir>/PDF /system/MY-PROD/PDF             <
    pr <somedir>/prod-dir
    F *

The reason you add this is because the PDF file contains a complete file manifest, which tech support can use to verify that the files in a product are correctly installed with the command pdfck.

I have a 700 series workstation, and I just put in a new network card. When I do an ifconfig to set the IP address, I get the error message ifconfig: no such interface. What's wrong?

The network interfaces in 700 workstations must be connected to a network before you can configure them with ifconfig. That error message indicates that the interface's hardware state is down.

To get it going again, plug it into a network and reset the network with the following command:

/usr/bin/landiag

If no errors are returned, you should be able to run ifconfig to set the IP settings.

How would I go about disabling new logins?

It's actually quite easy. Add an empty file in the /etc directory called nologin. Then, add the following lines to /etc/profile:

   uid='id -u'
   if [ -f /etc/nologin -a $uid -ne 0 ]; then
     echo "Sorry, no login allowed, try later!"
     sleep 5
     exit 0
   fi

What is the difference between HP-UX 9.x and HP-UX 10.20?

The biggest change is the move from the VUE graphical desktop to the CDE (Common Desktop Environment). This is the new industry standard UNIX desktop that will replace VUE in future releases. The main differences are as follows:

New and more customizable Front Panel:

Graphical MIME-enabled mail application

Graphical Calendar

Graphical Print Queue Manager

New terminal emulator

Action and datatype syntax changes

ToolTalk messaging support

Desktop application registration

More standard X-Windows stuff is part of the installation:

Athena Widget library (Xaw)

X Miscellaneous Utilities library (Xmu)

Imake

HP also implemented a new filesystem layout modeled after the AT&T SVR4 and OSF/1 standard. The files are organized into categories such as static versus dynamic, executable versus configuration data, and so forth.

In addition, OS software is kept in separate directories from application software. System shared files are kept in separate directories from host-specific files.

SAM can be accessed by regular users, but only on a limited basis. Specified users can be given more access to SAM functionality or other custom utilities that may be part of SAM. In certain cases, these users are actually promoted to superuser while they are executing SAM functions.

In addition, certain commands were modified:

What changes are present from 10.01 to 10.2?

The following is different between the two:

Where are all my filesystems in 10.x? Where did /usr/local go, and what is /usr/contrib used for?

Here is a short list of a few standard directories and what goes into them:

What's new with the HP-UX 10.x automounter?

HP-UX 10.x ships with an automounter running with a -hosts option. You can then define /net/hostname/directory/..., and the automounter does the rest.

The automounter is a nice feature, in that you don't have to worry about misplaced exported NFS directories on bootup. The machine where NFS is exported to will hang on bootup if the connection with the NFS server is severed in any way.

Without going into SAM in 10.x, how can I change such settings as hostname, IP address, and DNS Server?

The following shows the switches you can use with /sbin/set_parms:


To change the hostname:
          # /sbin/set_parms hostname
To change the IP address:
          # /sbin/set_parms ip_address
To change DNS Server, domain, etc.:
          # /sbin/set_parms addl_netwrk
or to set everything just like doing the first-time install:
          # /sbin/set_parms initial

Be careful with this command: it can be disastrous if checking for such things as the presence of duplicate addresses is not done first.

What is it that I should include in my PATH and MANPATH variables?

At the very least, you should add the following to the PATH statement:

If you also have an HP ANSI C compiler installed on the machine, you need to include these directories:

System management pieces go into:

The file /etc/MANPATH actually lists the directories for the man pages. To set these paths, run the following:

Why does lpstat report that the printer is down, even though it is not?

Check to see if the following line is in your /etc/passwd file:

lp:*:7::/var/spool/lp:/sbin/sh

Where is root's shell located?

The location of root's shell must be /sbin/sh, or /bin/csh, and it must be defined in /etc/passwd. No matter which shell root is using, it must be located on the root partition since the /usr filesystem is not mounted when init needs to use the root shell to run the startup scripts.

Programming Related Issues

This sections covers some of the more commonly asked questions regarding C coding.

Where does the GNU C++ compiler look for libraries?

To check where GNU C++ is looking for files, run g++ -v to compile a file with an include in it. You will see a list of directories that g++ looks into.

In general, the g++ headers are stored in $PREFIX/lib/g++-include, and the libraries are located in $PREFIX/lib.

Why am I getting the error /usr/ccs/bin/ld: Unsatisfied symbols: alloca (code)?

You will have to add the /lib/libPW.a library to your link line.

The reason HP never shipped a /lib/libPW.sl may be because they want to phase out libPW.a in the future. In other words, they may be merging it into libc.a|sl.

When I compile with C++ I get the message pxdb: internal error. File won't be debuggable (still a valid executable). What does it mean?

The reason for the error is that the program /opt/langtools/bin/pxdb aborted when trying to process the debug information. Since this happened it left a.out alone.

You may not be able to use xdb nor dde to debug your problem, except in assembly mode. The version of pxdb that comes with HP-UX 10.20 does have problems like this, so you might want to look for a patch (if one is available).

I'm running a GNU compiler and I'm getting a P-FIXUP error. What's that?

The question involves the GNU C++ compiler and the linker message below:

gcc  test_h.o -o test_h ../libg++.a -lm
ld: R_DATA_ONE_SYMBOL fixup in file ../libg++.a(streambuf.o) for code unsat symbol "abort" - use P' fixup
collect: /bin/ld returned 1 exit status

This is caused by the code generator emitting assembly code in a data subspace to initialize a function pointer, equivalent to :

        .word   foo()

where (in this case) foo() is an extern, and shared libraries are referenced by the executable being built (usually libc.sl).

This problem has been fixed in gcc-2.4.5.u5; if you are still running into this error:

1. You've got an old version of gas. (pa-gas-1.36.u8, I believe, is the first one to handle this correctly.)

2. You're linking with a library built with some old combination of gcc and gas.

The solution is to make sure gcc and gas are up-to-date and any libraries have been built with the latest gcc/gas combination. For a temporary workaround, the option -static to gcc will suppress dynamic linking and thus avoid the error.

Why can't I do anything with the default C compiler?

The C compiler that is shipped with HP-UX is intended only to rebuild the kernel. It was not intended for use with program development.

To get a full blown C compiler, you must buy the ANSI C program development bundle. Or, you could just get a copy of gcc.

How do I get around the error too many defines?

This refers to a deficient table size for C++. Use the -Wp,-Hxxxxxxx option, where xxxxxxxx is the number of bytes that you will add to the C++ table size.

In lint or cflow, there is no equivalent to the cc driver's -W flag to pass options to subprocesses like cpp. However, both lint and cflow invoke cpp via the cc driver, so you can achieve the same effect by setting the CCOPTS environment variable.

Here is an example:

CCOPTS="-Wp,-H500000"
export CCOPTS
lint large_file.c

I'm using gcc (the GNU C++ compiler), and I'm getting the error _builtin_va_start undefined when I build. What going on?

The <varargs.h> and <stdarg.h> include files define va_start in terms of this function, which is built-in on the HP C compiler.

If you're using gcc, you should be picking up include files from the gcc library directory. These include files do the right thing for both GCC and HP C.

More often than not, these files were never installed, or someone has placed a copy of varargs.h/stdarg.h into /usr/local/include (gcc searches there first).

When all else fails, you can replace the definition of va_start as follows, depending on whether you are using varargs or stdarg (K&R or ANSI, respectively).

    #include <varargs.h>
    #ifdef __hppa
    #undef va_start
    #define va_start(a) ((a)=(char *)&va_alist+4)
    #endif

    #include <stdarg.h>
    #ifdef __hppa
    #undef va_start
    #define va_start(a,b) ((a)=(va_list)&)
    #endif

For <varargs.h>, this replacement should always work.

For <stdarg.h>, this replacement will work unless the last fixed parameter (b in the call to va_start) is a structure larger than eight bytes. Large structures are passed by reference, with the callee responsible for copying the structure to a temporary area if it will be modified. In this case, &b will take the address of that temporary area instead of the position in the argument list, and va_next won't work. That's why HP uses a built-in compiler.

Is there is a way to find out if a program was built as debuggable?

Yes. Just run the command /usr/contrib/bin/oodump -spaces file.o. If the output shows a space name $DEBUG$, the program was compiled as debuggable with the -g option.

Why am I getting errors with FLT_MIN in ANSI mode?

The C compiler gets hung up on this construct in ANSI mode:

x=FLT_MIX;

The problem is that the ANSI mode (_PROTOTYPES) version of FLT_MIN/FLT_MAX in <float.h> ends its constants with an F, which the compiler apparently does not like.

The only workaround is to (temporarily) undef_PROTOTYPES around the <float.h> inclusion:

#ifdef _PROTOTYPES
#undef _PROTOTYPES
#include <float.h>
#define _PROTOTYPES
#else
#include <float.h>
#endif

What happens with _INCLUDE_xxxx_SOURCE?

The ANSI standard clearly states which identifiers it reserves, and says the rest are available to you, the programmer. Many important things, such as ulong, are not specified by ANSI, so ANSI header files are not allowed by the standard to define them.

Each standard supported by HP-UX (POSIX1, POSIX2, XPG2, XPG3, XPG4, AES, and so on) has its own set of reserved identifiers and header files, and the convention is to require -D_POSIX_SOURCE (and all others) to enable their respective name spaces. Since HP could not predict what future standards would come along and claim more header files and identifiers, it proved much simpler to make the name space as restrictive as possible unless -D_HPUX_SOURCE is specified.

While this has turned into one the most frequently asked FAQs about HP-UX, at least once you learn this, you don't have to deal with inconsistencies again. Had all nonstandard headers been allowed to define all nonstandard symbols, you'd find identifiers randomly disappearing from headers over time as they were claimed by various standards.

Check the man page for cc -Ae; it enables the HPUX_SOURCE name space.

Why do I need to always explicitly specify -I/usr/include?

You may not be running the correctly updated C compiler. The patches PHSS_3773 for A.09.63, PHSS_4061 for A.09.64 and PHSS_4151 for A.09.65 can be applied, but they all require the C compiler from the April 1994 Application CD-ROM (A.09.61).

Why is my syslog() call not doing what I want it to do?

My program looks like:

#include <syslog.h>
void main(int argc,char *argv[])
{
 syslog(LOG_EMERG,"This is an emergency message\n"));
 syslog(LOG_ALERT,"This is an alert message\n");
 syslog(LOG_CRIT,"This is a critical message\n");
 syslog(LOG_ERR,"This is an error message\n");
 syslog(LOG_WARNING,"This is a warning\n");
 syslog(LOG_NOTICE,"This is a notice\n");
 syslog(LOG_INFO,"This is an informal message\n");
 syslog(LOG_DEBUG,"This is a debug message\n");
}

It does not log all the messages to /usr/adm/syslog. Why not?

First of all, the LOG_EMERG cannot be used with user processes and should return -1 (if you check the return status). This is not documented in the man page! All the other message should appear, but your /etc/syslog.conf file might not be configured correctly. To test it, replace the /etc/syslog.conf file with the following line:

   *.debug                 /usr/adm/syslog

Then kill -HUP 'cat /etc/syslog.pid' Then run the test program and tail the /usr/adm/syslog file. You should see all the messages:

   Nov 23 09:02:54 orca syslogd: restart
   Nov 23 09:02:58 orca syslog: This is an alert message
   Nov 23 09:02:58 orca syslog: This is a critical message
   Nov 23 09:02:58 orca syslog: This is an error message
   Nov 23 09:02:58 orca syslog: This is a warning
   Nov 23 09:02:58 orca syslog: This is a notice
   Nov 23 09:02:58 orca syslog: This is an informal message
   Nov 23 09:02:58 orca syslog: This is a debug message

Does HP-UX come with trace?

You can get trace from the Interworks ftp site (ftp.interworks.org). The following is the README file for trace:

"Trace prints out system call (and optionally kernel) traces of programs. It compiles and installs fairly easily. It should work fine on 700s running HP-UX 9.X, and probably not at all otherwise.

To run the header file generation scripts, you'll need Perl 4.0pl36 or better, installed as /usr/local/bin/perl.

If you have problems with too much defining, uncomment HFLAGS in the Makefile.

If you encounter undefined ioctls, just comment them out and send me mail about them and what version of HP-UX you're running. fixheader will make sure that nonexistent header files aren't included.

Trace needs to be installed with setuid root so that users can run it.

What do I have to set to make C programs automatically generate stack dumps?

There is an undocumented function called U_STACK_TRACE() in libcl.a. You can set up the signal handling like this:

#include <signal.h>
extern void U_STACK_TRACE();
signal(SIGSEGV, U_STACK_TRACE);

Various Hardware and Peripheral Issues

This section deals with how HP-UX handles its hardware.

I have a 9000/715 workstation with a scanner and CD-ROM drive. The manuals say not to power off any device on the SCSI chain until the system is powered off. Do we really need to keep our scanner on all day?

One possible way around this little problem is to put all your peripherals on a surge protector, leave all the switches in the on position and just turn off the surge protector.

Using this strategy should prevent the small feedback surges that can occur, as well as other problems.

Can I get Netscape 3.0 to use the sound capabilities of my 735 workstation?

Netscape does not supply example mime.types and mailcap files for UNIX Netscape, nor does it include a Makefile to do a make install.

What you can do is put a mime.types file in /usr/local/lib/netscape and include these lines:

audio/basic    au snd
auto/x-wav    wav

You would probably want a mime type file there for helper apps defined for files with particular extensions (.wav, .doc, .zip, and so on).

The next step is to create a file called /usr/local/lib/netscape/mailcap. You should include the lines:

audio/basic; /usr/audio/bin/send_sound -u %s
audio/x-wav; /usr/audio/bin/send_sound -wav %s

(If you are using 10.x, you must use /opt/audio/bin/send_sound instead).

The next thing you must do is start running Aserver and run Netscape. Make sure you start Aserver in the background.

Now that you have these files in place, any time you click on a file with either of the extensions .au or .wav, it should play the sound file.

Does HP have different keyboards for its workstations and X Terminals?

There are actually two different keyboards available for HP workstations and X Terminals.

The default for the workstation is the A1099B keyboard, and the default for X terminals is the A2205A PC-101-style keyboard.

All 712, 715, and newer workstations do support PS/2 compatible keyboards and mice.

Is there a way to play audio CDs on an HP workstation?

There is a contributed application, xcd, that will pop up a CD-player front panel in X Windows. It will work in HP-UX 7.0 and HP-UX 8.0, on Series 300, 400, and 700 machines. Also, it works with either SCSI or HP-IB CD-ROM drives.

In order for the SCSI drives to work, they must be HP-supplied or Toshiba XM-3201B or XM-3301B. Officially, xcd does not yet work on 9.x, but some people have tried it and had no problems running it in 9.x.

Unfortunately, xcd plays only through the CD player's headphone jack, not through the workstation's speaker.

You can get xcd from the InterWorks workstation user group, their ftp site, the CD-ROM, or DDS tape.

There are two similar programs called xdp and xmcd. They are basically the same as xcd, but with more functionality.

Can I get an exabyte tape drive to work on an HP?

People have, under HP-UX 8.07, used device files with major number 54, minor numbers 0x201202 and 0x201203 for /dev/rmt/2m and /dev/rmt/2mn, respectively, for low density. Other people had used 0x201242 and 0x201243.

Note that with HP-UX 9.01, low density means 8200 format in 8500 drives. Major number 54, minor numbers 0x201202 and 0x201203 are low density handles. With 8200 drives, the density does not matter. Software compression control with 8505 drives will require a patch to HP-UX 9.01.

Some Exabyte drives will not support a dump blocking factor greater than 64 from the HP. Others are apparently limited in the commands they will accept (TTI noted that their 8501 tape drive will not properly interface with the HP under all conditions; however, the TTI 8510 does interface correctly). TTI had a firmware problem, which should be corrected in recent 8510s.

Note that 8500 drives act as SCSI-2, while 8200s are SCSI-1. People appear to have been more successful with getting the 8500s to work with 9.01.

Experience has also shown that you may need PHKL_2898. People have also reported that you need patch PHKL_2838 for HP-UX 9.x to get compression to work.

Do 700 series workstations have node IDs?

700 series workstations do indeed have node IDs. Most licensing systems, such as FLEXlm and NetLS, are driven from the LLA, which is found in /etc/lanscan or /usr/etc/netl/ls_targetid. HP also used a CPU ID number for /etc/update, which may be a transformation of the LLA. This is not guaranteed to remain the case, and it may be disturbed by the replacement of the LAN board.

In addition, the LLA (license code) can be reset by a CE (field engineer) if he uses the correct secret magic program.

What is a safe way to get a stuck DDS tape out of the tape drive?

Here is a good procedure to follow:

1. First turn off the drive. You may be able to get away with just powering down the tape drive, but you may want to do a shutdown on the system as well first (if the drive is inside the machine, you will definitely have to shut down the system).

2. Open the top of the tape drive.

3. If you look on the side of the drive, you should see a small rectangular piece of plastic. You should gently pry this off.

4. That piece of plastic covered a hole, which houses a small dial. If you spin this dial, it should eject the tape.

5. Now all you have to do is replace the piece of plastic and close everything.

Is there any way I can use the dump utility with a DDS tape?

Although the dump utility was originally written only for the nine-track tape system, you can actually fake it into working with DDS tapes.

Here are some parameters and some alternatives for different needs:

The approximate capacity of 60m DDS tape is 1.3 GB.

Approximate DDS tape density is 1.3 GB/60 m = (550KB/inch).

dump assumes an inter-record gap (IRG) of 0.3 inches for density = 6250, 0.7 in otherwise.

dump uses a default blocking factor of 10 for density less than 6250, 32 otherwise.

Alternative 1)
density = 550000
blocking factor = 32 (default)
assumed IRG = 0.7 in
Block length = (32K bytes/block) / (550K bytes/in) + (0.7 in) = (0.76 in)
Effective tape length =
        (1.3G bytes) / (32K bytes/block) * (0.76 in/block) = (2511 ft)
Alternative 2)
density = 6250
blocking factor = 32 (default)
assumed IRG = 0.3 in
Block length = (32K bytes/block) / (6250 bytes/in) + (0.3 in) = (5.54 in)
Effective tape length =
        (1.3G bytes) / (32K bytes/block) * (5.54 in/block) = (18325 ft)
Alternative 3)
density = 1600
blocking factor = 10 (default)
assumed IRG = 0.7 in
Block length = (10K bytes/block) / (1600 bytes/in) + (0.7 in) = (7.10 in)
Effective tape length =
        (1.3G bytes) / (10K bytes/block) * (7.10 in/block) = (75113 ft)
Alternative 4)
density = 1600
blocking factor = 32
assumed IRG = 0.7 in
Block length = (32K bytes/block) / (1600 bytes/in) + (0.7 in) = (21.18 in)
Effective tape length =
        (1.3G bytes) / (32K bytes/block) * (21.18 in/block) = (70022 ft)

For a 700 series workstation, what would be the correct major number for DDS Drives under a 9.x OS?

The major number for DDS drives from 9.01 on is 121, up from the previous 54. Major number 54 had partition support while 121 doesn't, but 121 does have lun (logical unit number) support. luns's are another way of defining disks (and sometimes tapes) to the operating system and segmenting them.

This way you can set it up so the system defines a lun to the tape drive.

How can I get the audio driver pointed to an external jack on my 700 series workstation?

The audio device file is /dev/audio. The proper settings for an external jack and an internal speaker are:

crw-rw-rw-   1 root     sys    57 0x208011  /dev/audio  ; external jack
crw-rw-rw-   1 root     sys    57 0x208000  /dev/audio  ; internal speaker

In order to make this change to the device driver, use the mknod command:

mknod /dev/audio c 57 0x2080??

All you have to do is replace the ?? with either 11 (external jack) or 00 (internal speaker).

Where can I get my hands on the specs for audio hardware on 700 series workstations?

This is a summary of the audio features supported by model 715, 725, 735, and 755 workstations. The 705 and 710 also have audio, but the specs are not available. The 720, 730, and 750 models do not have audio.

Audio features the programmable sample rates (in kHz): 8, 11.025, 16, 22.05,32, 44.1, and 48.

Programmable output attenuation: 0 to -96 dB in 1.5 dB steps.

                Programmable input gain: 0 to 22.5 dB in 1.5 dB steps
                Input monitoring
                Coding formats: 16-bit linear, 8-bit mulaw, or A-law

Audio inputs Line in (not on all models) Mono microphone with 1.5V phantom power.

Editorial comment: A Sun microphone appears to work just fine.

Audio outputs       Line out
(not on all models)     Headphone
                    Mono speaker jacks
                    Built-in mono speaker
Audio CODEC         Crystal CS4215

Typical specifications measured on a stock 715. Values will differ only slightly on other models.

Frequency response      25 - 20,000 Hz
Input Sensitivity/Impedance
            Line In         2.0 V(pk) / 47 kohms
            Microphone  22 mV(pk) / 1 kohm

Output Impedance (nominal):

            Line out    619 ohms
            Headphone   118 ohms
            Speaker (ext)  11 ohms

Max Output Level/Impedance:

            Line Out    2.8 V (p-p) / 47 kohms
            Headphone   2.75 V (p-p) / 50 ohms
            Speaker (ext)  5.88 V (p-p) / 48 ohms

Signal to Noise:

            Line In     61 dB
            Line Out    65 dB
            Microphone  57 dB
            Headphone   61 dB
            Speaker (ext)  63 dB

THD (at nominal load):

            Line In     -75 dB
            Line Out    -73 dB
            Microphone  -73 dB
            Headphone   -70 dB
            Speaker (ext)   -68 dB

What's the revision history of the PA-RISC architecture?

In going from the beta-ish PA-RISC 1.0 architecture to the 1.1 architecture, HP kept the PA-RISC 1.0 standard and simply extended its capabilities. Therefore, anything that ran on 1.0 will also run on 1.1.

The major changes in going to PA-RISC 1.1 were:

The initial release of PA-RISC 1.1 CPUs came with the first Series 700 workstations, also known as the Snakes series. Soon after the Snakes release, the Nova series came out. These were a series of Series 800 servers (8x7) with the same PA-RISC 1.1 CPUs. From that point on, every new PA-RISC-based machine from HP is based on the PA-RISC 1.1 architecture.

This means all of the 700 series workstations and the newer series 800 (from Nova on) machines all have the PA-RISC 1.1 standard.

On a Series 700 machine, compiling a program will generate PA-RISC 1.1 code by default. However, for all Series 800 machines the compiler will generate PA-RISC 1.0 code by default. This is to ensure that the program will run within the entire 800 series family of servers.

You can actually force the compiler to generate PA-RISC 1.0 code by using the +DA 1.0 compiler option. This will work fine as long as you are careful not to link your code with any libraries that were compiled for PA-RISC 1.1. If you do compile any object module in your program, the entire program will be marked as a PA-RISC 1.1 program.

If you use the file command on a program, it will show you which architecture is required for execution of the program.

Almost all of the system archive libraries that HP ships are compiled for the PA-RISC 1.0 architecture, with one exception: the math library. This is shipped in both 1.0 and 1.1 forms; the PA-RISC 1.1 version is located in /lib/pa1.1. The 1.1 version contains a few entry points that are not available in the 1.0 version.

If you use the scheduling option (+DS xxx), it will not affect the compatibility of the object code. The only effect it has is in how the optimizer schedules instructions that have long latencies. With this in mind, it might be a good idea to schedule the code for the fastest machine currently in production (if you choose to use this option).

The only thing you really have to worry about when compiling code on one platform to run on another is the OS release. For example, you can compile a program on a series 700 machine with the option +DA 1.0 and everything should run fine. The only requirement is that the program will execute on the same or a later release of the OS as the one it was compiled on.

An example of a condition where code will not run is where code is compiled on a 700 machine running 9.0, and you try to run it on an 800 server, which is running HP-UX 8.0. This does not work.

I've written a tar archive to DDS tape on an SGI machine, and my HP machine won't read it. How can I get it to read the tape?

To get it to read the tape, you'll have to do a byte swapping operation to get tar to read it. Here is a sample command:

dd if=/dev/rmt/0m ibs=512k obs=10k | tar -xvf -

You only have to do this for tapes that were created on swapping devices. On IRIX 4 machines, swapping tape devices were the default, and IRIX 5 machines were given nonswapping devices by default.

For either system, you can use the command /dev/nrtapens on either system to produce tapes as non-byte swapped. Furthermore, Irix 5.0x and above uses a 512 KB block size. Here is a sample command for reading a tar tape from Irix 5.0x or above:

dd if=/dev/rmt/0m ibs=512k obs=10k | tar -xvf -

Is there any place I can get disktab entries for third-party disks?

Generally, the supplier should provide a disktab entry. Andataco does a good job of this. One place to try:

http://hpwww.epfl.ch/HPUX/tools/disktab.html

Additionally, Ion has set up a mail service; to access it, send e-mail to <mailer@hpwww.epfl.ch> and respect the following syntax for the subject field:

disktab table - returns the available disktab file.
disktab how - returns two methods to create a new disktab entry from scratch.

Patch PHSS_4981 has the disktab entries for the following drives:

   Seagate ST32430WD, Seagate ST32430N, Seagate ST31230WD,
   Seagate ST31230N, HPC3324A, HPC3324W, HPC3325A, HPC3325W
   Seagate ST31200N, Seagate ST31200W, Seagate ST12400N,
   Seagate ST12400W, DEC DSP3107LS, DEC DSP3107LSW, DEC DSP3210S,
   DEC DSP3210SW, Quantum LPS1080S, Quantum LPS1080WD

I have an internal SCSI on a 700 series workstation. Do I really need to terminate it?

If there is ever any doubt, do it just to be safe. Some say that the machine will work, but it will be slowed down by this condition. Fact or fiction? Why take a chance?

How large can I make a partition on a disk on a series 700 workstation running 9.x?

Because the logical volume manager was not implemented on 9.x workstations, you can only get a maximum 2 GB partition. You can, however, get a SCSI patch that will boost you up to 3.7 GB.

No matter what size disk you attach to the workstation, it will only be able to access up to 2 GB (or 3.7 GB) of disk space. If you're stuck with a big disk, however, at least you can use most of it.

What's a good way to determine the amount of RAM I have on my system?

Here is a short program that returns the RAM size:

#include <sys/pstat.h>
main()
{
   struct pst_static buf;
   pstat(PSTAT_STATIC, &buf, sizeof(buf), 0, 0);
   printf("Physical RAM = %ldMB\n", buf.physical_memory/256);
}

If you are root, you can use adb as follows:

echo "physmem/D" | adb /hp-ux /dev/kmem | tail -1 | \
awk '$2 > 0 { print $2 / 256 }'

Of course, the easy way to check memory, if /etc/dmesg is still current, is to grep it:

/etc/dmesg | grep "real mem" | tail -1 | awk '$4 > 0 { print $4 / 1048576 }'

How can I get the spooler to create cover pages?

There are a few ways you can do this. If you only want to turn it off for one job, you can use the alias for lp -onb.

If you want to turn off the cover page for all print jobs, choose one of the following methods, depending on the type of spooler you are using:

1. You can edit the file /usr/spool/lp/interface/printer name and comment out the banner page. If you are using the JetAdmin tool, the actual script that gets used is /usr/spool/lp/interface/model.orig/printer name.

2. Newer interface files are available in the /usr/spool/lp/interface/ directory. These call /usr/lib/rlp, and if your model script does this, you can insert the following line before the /usr/lib/rlp statement:
BSDh="-h"

The model script would now look something like this:

...
shift; shift; shift; shift; shift
#You should enter the no banner option here
BSDh="-h"
/usr/lib/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 ...
...

Why are the filenames for a CD-ROM all UPPERCASE with a ;1 version numbers attached?

HP-UX uses this convention with CD-ROM filenames because they only support ISO 9660. This does not allow it to translate the all UPPERCASE 8.3 character filenames to lowercase, nor does it remove the ; version numbers, because they are stored in exactly this manner on the CD-ROM.

There isn't any problem with HP-UX storing these filenames, but this turns into a real problem when you try to do simple moves, for instance, on the files since the ; is a command separator.

Though that problem is really more of a major annoyance than a problem, the real trouble starts when software that is not written for this filename format tries to access these files.

Basically, you can do one of three things to get around this problem:

1. Write a script (or use cdrutil.ksh, available at many archive sites) to perform the translation by creating a series of symbolic links. These links would have to be created and removed after mount and umount commands, respectively. Some CD-ROMs may require 15-45 minutes to complete this task.

2. Get the patch (These are listed by series #):
             PHKL_6075: s700 at 9.03, 9.05, 9.07 (no 9.01 or earlier)
             PHKL_6272: s700: 10.01
             PHKL_6076: s700: 10.00
             PHKL_6338: s800: 9.04 (none prior to 9.04)
             PHKL_6077: s800: 10.00
             PHKL_6273: s800: 10.01
These add a modification to the cdfs code, which can translate all mounted CD-ROMs (not selectively) to accomplish the same task. This patch adds no additional filesystem support such as POSIX or the RockRidge extensions. This patch can only be activated by modifying the kernel with adb. An example of how to modify the 9.xx kernel is shown in the patch. Note that this patch affects every mounted CD-ROM in the system at the same time.

3. Through an agreement with Young Minds, Inc, the Portable File System (PFS) code has been made available to 700 and 800 series systems running 9.xx and 10.xx. This code accomplishes not only the lowercase translation and version removal (both are separate options and can be specified on or off for each CD-ROM), but also provides RockRidge Extensions (long filenames, ownerships, permissions). This code is available on the Nov-Dec 1995 application CD-ROM and tapes for the 700s, and on the Jan-Feb 1996 Application CD-ROM and tapes. The media can be purchased at any time for a nominal fee.

PFS handles exporting of CD-ROM filenames as well as importing these names from other HP-UX systems, and is the most versatile solution to the CD-ROM compatibility problems in HP-UX.

What is causing HP-UX to insert 4 spaces at the beginning when I use a parallel port to print?

To get rid of these four spaces, you have to edit the /etc/rc file (in 9.x). Find the line containing the string slp and change it to read slp -i0.

How can I find how fast my HP-UX 9.x system is?

You can find the system clock speed by typing the following command (you have to log in as root first):

echo itick_per_tick/D | adb /hp-ux /dev/kmem | tail -n1 \
| awk '{print $2 / 10000, "MHZ"}'

This will give you the clock speed of the CPU in MHz.

File Locations

It's always frustrating trying to find files and binaries, especially when dealing with people who, well, may not have a clue what you are talking about.

In this section you should be able to find a few of the more sought after, yet not-that-often found, files that you may be looking for.

I've upgraded from an 8.x system to 9.x. Why don't I have xline anymore?

Xline is no longer shipped as part of the OS. There is a much better program called Glance Plus, which does what xline did and much more.

A trial version of Glance Plus should be included with your software distribution free of charge. The trial period seems to run out far too soon, so you might want to think about actually kicking up some dough for this thing (in my estimation, it's worth it).

Why can't I find the man page Help index on VUE 2.01?

To get this index you must copy over the pre-9.x copies of the files /usr/lib/X11/vue/help/C/manpage.cat and /usr/lib/X11/vue/help/C/manpage/(all files in this directory) with the updated manpages.

How can I get my hands on SLIP for HP-UX?

The SLIP distribution is called ppl. It is actually part of the LAN/9000 Link product, and it's available for both 9000 servers and workstations.

Where is the pcnsfd for HP-UX?

It comes packaged with the NFS distribution.

SLIP is all well and good, but I really need PPP. Any idea where I can get my hands on that?

A company called Morningstar has a commercial implementation available. Take a look at their ftp site for more details:

ftp.morningstar.com

Another place you might be able to get PPP is the following ftp address:

ftp://ee.utah.edu/ppp/iijpp.0.93.hp.tgz

Be sure to read all the README files that may be there.

Where would I look for STREAMS/UX?

This is being sold as a separate product that can be purchased for use with HP-UX 9.x. It is actually bundled now with 10.x.

STREAMS/UX is based on the OSF/1 STREAMS code, and you can get a datasheet on it from their fax-back service. The number is 1-800-333-1917, and the document # is 31502.

Where can I get POSIX threads?

The POSIX user space threads are currently available as part of the DCE product, which includes thread-safe C libraries.

How about the Interviews product?

There is a product called Interviews Plus, which is available for both servers and workstations. For the s800 servers, the product number is B2625A, and for s700 workstations, the product number is B2626A.

How do I get my hands on POP for HP-UX?

You can get the pop3d package from the Interworks archive site:

ftp://interworks.org/pub/comp.hp

This will give you a list of available software.

The company Qualcomm also maintains a POP called qpopper, which is a modified version of Berkeley's 1.831 beta popper. The current version can be found at:

ftp://ftp.quallcomm.com/quest/unix/servers/popper/

Any idea where I can get disktab entries for certain Seagate drives?

If you are missing some disktab entries for drives, you need to get the patch PHSS_4981. The following disktab entries are covered in that patch:

Seagate ST32430WD

Seagate ST32430N

Seagate ST31230WD

Seagate ST31230N

Seagate ST31200N

Seagate ST31200W

Seagate ST12400N

Seagate ST12400W

HPC3324A

HPC3324W

HPC3325A

HPC3325W

DEC DSP3107LS

DEC DSP3107LSW

DEC DSP3210S

DEC DSP3210SW

Quantum LPS1080S

Quantum LPS1080WD

Version 10.x Specifics

A number of things have changed with the move from 9.x to 10.x, and if you think file locations is the extent of the changes, you may want to sit down before you read further.

This section contains some of the more frequently asked questions people, along with clarifications of some of the more common misconceptions.

Is there a way to get Multiple IP addresses on one interface?

Yes, but you have to get HP ServiceGuard to allow you to configure multiple IP addresses on one interface.

So, what version of named is running at HP-UX 10.0?

The version shipped for 10.0 is Version 4.8.3. To find the current version, you can use the what command. For example:

$ what /usr/sbin/named
/usr/sbin/named:
   Copyright  1986, 1989, 1990 Regents of the University of California
   named 4.8.3 Tue Nov  1 17:03:51 GMT 1994

Where can I get documentation on HP-UX 10.0?

The two URL sites are:

http://support.mayfield.hp.com/
http://us.external.hp.com/

Specifically, the URL for any particular document is:

http://us.external.hp.com/kdb-bin/wwwsdoc.pl?<Document ID>

You can also have HP send you a specific document by mail. To get it, just send a message to support@us.external.hp.com. The body of the message should read:

send doc <Document ID>

Of course, to get the Doc ID, you must access the site, so while you're there you might as well go ahead and print it, if you have the capability to do so.

What is SD-UX, and why is it taking the place of the /etc/update utility?

This is a complete change to the distribution format for software. HP now uses the Software Distributor 2.0 to install, update, remove, and package HP-UX software for 10.x. This is commonly called SD-UX.

Unfortunately, this also means that /etc/update won't even recognize 10.x software in this format and vice versa.

SD does provide some nice tools over /etc/update though. SD also offers three new user interfaces to replace /etc/update's user interface:

1. An interactive graphical user interface available for the swinstall, swcopy, and swremove commands.

2. An interactive user interface suitable for ASCII terminals (on S800) for the swinstall, swcopy, and swremove commands.

3. A noninteractive command line user interface for all commands.

Version 9.10

HP-UX version 9.10 is used for the Series 300 and Series 400 machines, which run on the Motorola 68k platform.

What are some of the highlights of 9.10?

The HP-UX 9.10 release for Series 300/400 provides many tools to improve interoperability with Series 700/800 10.x systems:

Summary

This chapter provides a fairly well-rounded group of answers to frequently asked questions that may pop up from time to time on most HP 9000 systems. I won't pretend to have answered anywhere near all of the questions that everyone may have, but I hope you were at least able to come away knowing what the problem wasn't.

Some material in this chapter was taken from the HP-UX FAQ.

TOCBACKFORWARDHOME


©Copyright, Macmillan Computer Publishing. All rights reserved.