Operating System - HP-UX
1834978 Members
2257 Online
110073 Solutions
New Discussion

What processes uses /var and /usr

 
SOLVED
Go to solution
Jdamian
Respected Contributor

What processes uses /var and /usr

If I run

shutdown now

in order to set the system in single user mode, both /usr and /var file systems are mounted. Then I try umount /var the "Device Busy" known error message is reported.

If I boot in single user mode, /usr and /var aren't mounted.

Why ?
13 REPLIES 13
Justo Exposito
Esteemed Contributor

Re: What processes uses /var and /usr

Hi J. Damian,

If you try:
ps -ef | grep usr
ps -ef | grep var

You should view that there are process using this directories.

Another thing is to uses a third party tool in order to see wich process use this directories.

Best Regards,

Justo.
Help is a Beatiful word
Emiel van Grinsven
Valued Contributor

Re: What processes uses /var and /usr

Hi,

You can also use fuser, see man fuser for syntax.

Hth, Emiel
Carlos Fernandez Riera
Honored Contributor

Re: What processes uses /var and /usr

Several process will be runnong for /usr/bin and they will have open files on /var.

If you are trying to change size of /usr or /var the best way is boot in maintenance.


stop boot
boot pri
interaact with IPL > Yes
hpux -lm


This way vg00 is not activate, you must activate it, and this is the correct way.
unsupported
U.SivaKumar_2
Honored Contributor

Re: What processes uses /var and /usr

HI,
there are lot of online executables under
/usr/bin/ , online libraries under /usr/lib
which will accesing the filesystem and keeping
the file system busy.
there are lot of processes like sendmail , syslogd , and other daemons which uses /var/adm/syslog for logging and there are
processes which creates socket files in /var and accesing sockets all the time keeping that
filesystem busy.
regards,
U.SivaKumar
Innovations are made when conventions are broken
Victor BERRIDGE
Honored Contributor

Re: What processes uses /var and /usr

Hi,
Most system logs are in /var/adm which explains why its busy...
Most libraries used by dynamicaly linked commands (and the libs of course) are in /usr...
This is why you have to in single user, mount /usr if you want to use vi and /var if you want to use sam...

All the best

Victor
Steven Gillard_2
Honored Contributor

Re: What processes uses /var and /usr

Shutting down to single user mode is never completely clean, there are always a number of processes left running and as you've noticed this means you can't unmount file systems unless you kill them manually.

I think its always best to reboot and startup into single user mode.

Regards,
Steve
U.SivaKumar_2
Honored Contributor

Re: What processes uses /var and /usr

hi,
using
#fuser -u /var
shows the user id of processes accesing /var

regards,
U.SivaKumar
Innovations are made when conventions are broken
Jdamian
Respected Contributor

Re: What processes uses /var and /usr

Hi

1. The following commands suggested by someones are not capable to find the processes:

ps -ef | grep usr
fuser -u /var

However

fuser -c /dev/vg00/lvol8
fuser -c /dev/vg00/rlvol8

do work.

2. Some of repliers say there are processes running...

But... shutdown commands uses "init s" who runs the scripts on /sbin/init.d directory in order to kill all these processes, i.e, these processes should be dead when "umount /var" is executed.

I think these processes are unnecessary in single mode, in fact, they don't exist when booting in single mode.

Thanx for all

U.SivaKumar_2
Honored Contributor

Re: What processes uses /var and /usr

HI,
you can use fuser -ku /var
for killing the processes without rebooting.
regards,
U.SivaKumar
Innovations are made when conventions are broken
Victor BERRIDGE
Honored Contributor
Solution

Re: What processes uses /var and /usr

And fuser -cu ...

More seriously, as already mentionned, the state on a system IS NOT the same if you boot into run level S at powerup or from a higher run level changing to level S:
From the man pages: Transitioning into run level S from a higher run level does not terminate other system activity and does not result in a "single-user state"

All the best

Victor
Carlos Fernandez Riera
Honored Contributor

Re: What processes uses /var and /usr

And, if i recall well , /usr is mounted again on single-user, but not on maintenance.
unsupported
Bill Hassell
Honored Contributor

Re: What processes uses /var and /usr

To clarify things a bit:

shutdown now or shutdown 0 used to truly shutdown into true single user mode.

Definition: True Single User Mode (TSUM) means that ONLY / is mounted (possibly /stand) and there are no processes running except the bare minimum needed for the HP-UX kernel. vg00 is activated along with primary swap but no other volume groups are activated. bdf will not exist (it's on /usr/bin) so you must use mount with no options.

Since 10.10 (apx) and later, the shutdown process no longer kills all processes that are using /usr and /var. So neither init s nor init S nor shutdown 0 will reliably enter TSUM. The only choice is to shutdown -r and then interact with the boot ROMs so you can boot with:

hpux -is

Then you'll be in TSUM.


Bill Hassell, sysadmin
Jdamian
Respected Contributor

Re: What processes uses /var and /usr

Thanks Victor and Bill.

You definetively clarify this issue.

That's what I suspected: running "shutdown" from a run level 3 doesn't set the system on TRUE single user.