HPUX Tips

1. HOW MANY BITS?

HP-UX counterpart for finding on which mode you are currently working (32-bit or 64-bit):

getconf KERNEL_BITS

2. The locale info will be present in

/usr/lib/nls/README.nls.10.01

3. Profiling programs - use prof

(acc -p)

Profiling C++ programs

Use gprof

aCC -G

Programs should not be compiled with the -G option to profile Shared Libraries.

To profile a shared library:

Set LD_PROFILE=Sharelibpath

eg: LD_PROFILE=/opt/OV/lib/libOvCoda.sl

Set the env. variable GPROFDIR

The profiled output file will be present in

${GPROFDIR}

4. To Copy sw depots from a remote system

Use the following command to Copy the depot:

swcopy -s @ localsystem:/

eg:

swcopy -s dumpy.abc.com:/swdist/IPF/OpenSource @ ramki.abc.com:/ramki

5. To install a software from a remote machine

swinstall -s

Example:

swinstall -s ramki.abc.com:/home/ramki/add_to_be/11.00/aCC.3.37.01.depot

You can list one of the entries with this command: swlist -s

You can preview installing the software with: swinstall -p -s

Or you can install the software with: swinstall -s

6. Enable/disable file system mounting for swinstall

swinstall, like HP-UX, assumes that every mounted disk is crucially

important to the running of the system. If it isn't important, it

should not be mounted. You've probably already seen the hangs with bdf

and logins when an NFS servicer fails. You can override the requirement

that everything in /etc/fstab must be mounted with the swinstall option:

-x mount_all_filesystems=false

7. To create shared library in HPUX

cc -b +z test.c -o libtest.sl

+z - Generate Position Independent Code (PIC)

-b - Generate shared library

8. To find out machine information

Use the command:

/opt/ignite/bin/print_manifest on IA or PA

Only on IA

machinfo

9. To find out physical memory

a) grep Physical /var/adm/syslog/syslog.log

Works for any user

b) /usr/sbin/dmesg | grep Physical

Works only if u r root

10. To tune kernel paramaters

Use /usr/sbin/kmtune OR

/usr/sbin/kctune

11. Tuning network paramaters

------------------------

- tcp_time_wait_interval

Set the value to 1 second:

# ndd -set /dev/tcp tcp_time_wait_interval 1000

- tcp_fin_wait_2_timeout

Set the value to 10 minutes:

# ndd -set /dev/tcp tcp_fin_wait_2_timeout 6000000

These settings need to be defined whenever the system is re-booted.

To do this update /etc/rc.config.d/nddconf with the required

parameter as shown in the following example:

TRANSPORT_NAME[0]=tcp

NDD_NAME[0]=tcp_time_wait_interval

NDD_VALUE[0]=1000

TRANSPORT_NAME[1]=tcp

NDD_NAME[1]=tcp_fin_wait_2_timeout

NDD_VALUE[1]=600000

12. Why do I get a malloc error during swremove?

* Session selections have been saved in the file

"/.sw/sessions/swremove.last".

ERROR: "hpomt1:/": Could not allocate memory on this remote host

during task initialization, analysis or execution -- malloc()

failed.

* The analysis phase failed for "hpomt1:/".

* Analysis had errors.

While removing softwares, the following two rules must not be broken:

1. no patch left on the system without its base

2. under a no-rollback situation, a patch cannot be removed without also removing its base.

this generally happens if a path removal is tried after removing Base product

13. To remove a particular revision when multiple revisions are present

To remove a particular revision of software, when multiple revisions are present:

swremove ,r="revision"

eg: swremove Ramki,r="4.51.000"

14. How can I change the timezone?

The timezone is dtermined by reading the 'TZ' environment variable.

This variable is set when you execute 'set_parms timezone'. Set_parms

edits the file '/etc/TIMEZONE,' which exports the 'TZ' environment

variable. When you reboot after executing set_parms, the file

/etc/TIMEZONE will be read and your TZ variable set to the value you

specified. The value is in the format:

[:]STDoffset[DST[offset][,rule]]

For example: PST8PDT for the U.S. Pacific Time Zone

See the environ(5) manpage for a detailed description of the format.

Note, the offset for daylight savings time is supplied by the

'/usr/lib/tztab' configuration file.

libc functions like ctime use the 'TZ' variable to determine the

15. To Fix the compiler crash with error

Error (internal problem) 7108: Exact position unknown; near ["../../test.cpp", line 1033]. # The value 0x22ec did not fit into a signed 14 bit field at offset 0x99dc (op code - MOVB) (7108)

Apply patch: PHSS_29483

16. Downgrading a software

swinstall -x allow_downdate=true -s $PWD/ \*

Comments

Popular posts from this blog

Graylog - an easy solution for log management