Operating System - HP-UX
1832085 Members
3022 Online
110037 Solutions
New Discussion

How to find running binaries are shared by many programs ?

 
SOLVED
Go to solution
Shivkumar
Super Advisor

How to find running binaries are shared by many programs ?

Hi,

We have installed HP apache 2.x binary on NAS filer mounted file system.

We share the binary in test, stage and prod environment.

My question is:
1) In case of performance testing in stage environment, will this impact the hp apache binary ?

2) I am assuming this binary is shared one. BTW, How do we find out if binary is shared one or not ?

3) If hp binary is removed by mistake by someone, will it cause running apache process to stop ?

Appreciate your help.

Thanks,
Shiv
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: How to find running binaries are shared by many programs ?

Hi Shiv:

> 1) In case of performance testing in stage environment, will this impact the hp apache binary ?

There should be negligible overhead here other than the I/O to initially read the instructions.

> 2) I am assuming this binary is shared one. BTW, How do we find out if binary is shared one or not ?

If we are speaking of a simply binary file, then multiple uses reuse the text (instructions) portion resident in memory.

> 3) If hp binary is removed by mistake by someone, will it cause running apache process to stop ?

You can't remove an inuse executable. Trying to do so gives a "Text file busy" error.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: How to find running binaries are shared by many programs ?

All (normal) programs in HP-UX are shared. That is, you can run 500 copies of vi or httpd (Apache) and there will be just one copy of the file on disk. The text portion (unchanging instructions) exists one time in memory and all the processes share this code area. As mentioned, you cannot remove the disk file as long as at least one copy is still running.

However, your disk is connected over a potentially unstable connection (ie, LAN) and this can indeed hang your system. The NAS disk array must be connected as a completely dedicated network -- no PCs, no routers, no other boxes that are potentially unstable. I would keep your applications on a local disk (binaries and config files are extremely small) and just put data on the NAS box.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: How to find running binaries are shared by many programs ?

>How do we find out if binary is shared one or not?

Use: file executable
Or: chatr executable
If shared:
/usr/bin/ksh: PA-RISC1.1 shared executable dynamically linked
$ chatr /usr/bin/ksh
/usr/bin/ksh:
32-bit ELF executable
...
address space model: default

If not shared:
a.out: PA-RISC2.0 executable dynamically linked -not stripped
$ chatr a.out
a.out:
32-bit ELF executable
...
address space model: EXEC_MAGIC

>3) If hp binary is removed by mistake by someone

It can't be removed if busy.