1843970 Members
2071 Online
110226 Solutions
New Discussion

Re: hpux -is boot

 
subhashni
Regular Advisor

hpux -is boot

After I run hpux -is boot It is not in single user mode. when i run who -r it shows run level 4. Why?

Thanks

unix4me
10 REPLIES 10
Patrick Wallek
Honored Contributor

Re: hpux -is boot

Where are you running 'hpux -is' from? To boot single user '-is' you must reboot the machine, interrupt the boot process, boot from the primary boot disk, or secondary if mirrored, say YES to interact with IPL and then do an 'hpux -is'.

If that is what you are doing, you've got problems elsewhere. If you are just doing 'hpux -is' from a # prompt, that won't work.

If you want to go to single user mode without rebooting the machine, you can do an 'init 1' to go directly to single user mode from multi-user mode.
A. Clay Stephenson
Acclaimed Contributor

Re: hpux -is boot

Are you trying to run hpux from unix or at the ISL prompt?

You should do this:
Interupt the normal boot:

BOOT PRIMARY
Interact with ISL? Y
ISL> hpux -is

This should bring you up in single-user mode.

If you are already running unix then you use the init S command. Man init for details.



If it ain't broke, I can fix that.
Michael Tully
Honored Contributor

Re: hpux -is boot

One other thing to add, what has the first line of your /etc/inittab file have. It should have something like this, where either 3 or 4 is used.

init:4:initdefault:

You can also go from multi-user to single user using the 'shutdown' command with no options.

-Michael
Anyone for a Mutiny ?
subhashni
Regular Advisor

Re: hpux -is boot

Hi

I am sure that I am running this command from ISL. After rebooting the system I am getting

BOOTADMIN>Boot pri isl
ISL>hpux -is boot

--

#who -r
.runlevel 4


This is I am getting .
unix4me
Patrick Wallek
Honored Contributor

Re: hpux -is boot

Try just doing an 'hpux -is' at the ISL prompt. Don't put the boot on there.

What messages, if any, are coming up between when you do the 'hpux -is' command and when the machine gets to the prompt?

What version of HP-UX is this? What type of machine?
Patrick Wallek
Honored Contributor

Re: hpux -is boot

I found the following in the TKB. It reflects your problem very accurately, though it doesn't give a fix.

From TKB document 5003433680:

Problem Text

who -r (from who man page) states:

Indicates the current run-level of the init process. The last three fields contain the
current state of init, the number of times that state has been previously entered, and the previous state. These fields are updated each time init changes to a different run state.

This is not always the case. For instance if you do an /etc/reboot or shutdown -r then esc to boot to single user mode (hpux -is). "who -r" reports the previous multiuser run level before the reboot was issued instead of the current single-user run level.

*****************


Roger Baptiste
Honored Contributor

Re: hpux -is boot

<<Boot pri isl
ISL>hpux -is boot
#who -r
.runlevel 4 >>>

Hi,

Seems like this is a bug. So, if you
really want to find out the level you have
booted on, check the /etc/rc.log file
and it shows the scripts it has run.
If it has not run anything under /sbin/rc2.d
or /sbin/rc3.d , then you are definitely
booted in single user mode.

HTH
raj

Take it easy.
Bill Hassell
Honored Contributor

Re: hpux -is boot

Single user mode is a bit tough to characterize. Most people assume that it means a fresh kernel, no mounted disks except / and /stand, and no daemons such as networking.

However, the man pages ofr init seem to imply that you can get to single user mode with:

init s

But you can't. init will remove any process it owns that is not listed in inittab with an 's' state...but init does not own all processes and certainly doesn't un-mount anything or refresh the kernel.

man shutdown implies that shutdown without any options (like shutdown 0) will take you to single user mode. Well, it used to, but not any more. It still leaves some processes running and /usr is often left mounted.

So the only way to get into single user ins through an interrupted boot sequence as mentioned before.


Bill Hassell, sysadmin
Bill McNAMARA_1
Honored Contributor

Re: hpux -is boot

Yea, Bill is right,
I still see shutdown 0 and init S in some docs.. and have always wondered if it was me or the machine...

Have fun,
Bill
It works for me (tm)
Frank Slootweg
Honored Contributor

Re: hpux -is boot

As to 'who -r" showing run level 4:

As far as I know, that is because for a single-user *boot*, the /etc/utmp file is not yet updated, so "who -r" just reports the last run level that was recorded in /etc/utmp, which is your normal run level.

For a *switch to* single-user mode, i.e. run level 1-6 -> 0 or S, "who -r" should report the correct run level.

You can check the above 'theory' with:

# /sbin/ls -l /etc/utmp
(the timestamp will probably be older than the boot time)

# mount /dev/vg00/lvol? /usr
# /usr/sbin/acct/fwtmp (the text form of /etc/utmp will probably only report the old run level (4))

For the format of the utmp file see the utmp(4) manual page.