Difference between revisions of "HP-UX tricks"

From WTFwiki
Jump to navigation Jump to search
m (7 revisions)
(No difference)

Latest revision as of 22:49, 4 January 2013


If your machine is one of the older HP boxen or has low RAM, you should probably consider 10.20 - it's no longer supported but should work fine (Stian - add your observations). If you have at least 128 MB RAM, 11.11 (or 11i v1) is probably the way to go. Runs nicely on my C3700 and is still supported. Installation itself is a piece of cake - all menu-driven, lots of useful help etc - +1 to HP.

After installation, use swinstall to install latest patches - they're well worth it. You'll probably just grab the latest "support plus" bundle: [1] (or [2] for 11.0 and 10.20 stuff). This fixes a lot of issues - added some UTF-8 locales for me and mouse wheel began to work with no setup, xterm got colors etc. You'll probably need to register with HP's "IT resources center" (ITRC) to download the above mentoined stuff. Also, HP's website is a maze of (often broken) links, just be patient and keep searching, it's all there (for the persistent).


SAM (system administration manager) will be your friend for most tasks. It has both console and X version, both are fine. It can do most of the system related stuff - filesystem management, network settings, display configuration and software installation. The user-level stuff is a bit harder to configure - I have yet to find a configuration tool for that. CDE has a tool for setting some basic behavior of the interface, but it's scope is limited to CDE (first person to find a way to turn off the annoying beeping of HP iron without using this tool has a free beer from me). If you want to use something else than CDE, copy /usr/dt/config/Xconfig to /etc/dt/config/Xconfig, edit it there and uncomment and/or set Dtlogin*xdmMode to True. The login manager will then run ~/.xsession instead of launching CDE for you. This file has a lot of other useful settings - explore :)

Software sources

There is some useful software at HP software depot - make sure to grab the latest patch bundles. The "HP-UX developer's toolkit' contains some highly useful stuff - mainly X11 header files so grab that as well. HP also provides some a binary distribution of GCC - you'll probably want this (or some other distribution of GCC) - HP's own aCC is unobtainium unless you have some extra $1000 or so.

The Porting And Archive Centre for HP-UX has quite a lot of stuff too, but only for 11.11 - older versions are no longer supported by this site!

Pkgsrc is probably the largest software collection for HP-UX, but it is not as well supported as it is for Solaris for example. Be prepared to do a lot of tweeking and nasty hacks in order to make stuff compile - I'll make a separate page for this.

Some random knowledge

  • swinstall expects absolute pathnames to .depot files - run it like "swinstall -s/home/dragon/gcc.depot" - this is my candidate for the most retarded thing about HP-UX
  • CDE won't start if the machine can't resolve it's own hostname - just add an entry to /etc/hosts. When given a chance, disable all the NIS-related nonsense in nsswitch configuration (using sam). If DHCP changes your hostname, you can update it at different config locations using "set_parms hostname" - that may (or may not) help.
  • HP's ld understands the -R parameter in a completely different way than GNU ld does - to pass shared library search paths, use "+b/path1:/path2:/path3...
  • Bundled version of JFS can only grow filesystems, not shrink them - pretty annoying. Logical volumes and volume groups can be shrinked even with the bundled stuff.

pkgsrc tricks

  • latest pkgsrc blows up with HP-UX make, install gmake
  • net/Orbit2 needs if_freenameindex() and if_nameindex() to be happy and those are part of the libipv6 library on HP-UX 11.11 - just build it with LDFLAGS=-lipv6 and it'll be happy. Maybe someday I'll post a patch to upstream pkgsrc for this.
  • sysutils/dbus explodes on a simple function called vsyslog() in file dbus-sysdepds-util-unix.c - just change its name to syslog() and it will do just fine. Also, it needs /etc/nologin as a valid shell - just symlink it to /bin/false or something.
  • security/PolicyKit is a major piece of shit. It claims to be for Unix-like systems while in reality it uses several linuxisms and non-POSIX stuff. The shit you're going to look for is LOG_AUTHPRIV (in several files, they have #ifdef for solaris to define this - making a patch shouldn't be too hard), setenv() - I just commented it out (I have no intention of using PolicyKit, it was just a dependency in my case and the function calls didn't look too important) and the awful getopt.h/getopt_long() shit - I ended up commenting almost whole main() in one file to quickly get rid of this. A proper fix would probably be to include a customized version of getopt.h/getopt_long() along with the package.