1832910 Members
2884 Online
110048 Solutions
New Discussion

altering init level

 
amit mehta_2
Regular Advisor

altering init level

hi,
will altering the
init:3:initdefault: to init:1:initdefault:
in /etc/inittab file will change the run level persistant across reboot?

thanks,
amit
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: altering init level

Shalom amit,

This will cause the machine to boot up in single user mode, without networking and without mounting any filesystems.

It will make the system only accessible from the console(GSP/MP/iLo should work).

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
freddy_21
Respected Contributor

Re: altering init level

yes you will run at init 1. but at init1 all file system already mount, but network not running.

Diferent with single user mode. At single user mode all file system will not mount.


Thanks
Freddy
Mridul Shrivastava
Honored Contributor

Re: altering init level

Single user mode is used for maintenance purposes as there are some activities which can't be performed when system is running in level3 (or say multi user mode).
Time has a wonderful way of weeding out the trivial
amit mehta_2
Regular Advisor

Re: altering init level

thanks steven,
As you said, the machine is now accessible only from the console now, but i can still see the entire file system mounted:-)
i know the following command at ISL promt will bring me into single user mode:
"hpux -is"
but will it be persistant across reboots?
do we have any environment variable which can return the run level?

thanks,
amit
amit mehta_2
Regular Advisor

Re: altering init level

hi,
figured how to find the run level.
# who -r
. run-level 3 Jul 10 11:57 3 0 S

thanks.
Bill Hassell
Honored Contributor

Re: altering init level

Just a note about single user mode:
init cannot take the system to a true single user mode, defined as no mounts (except / and /stand), no networking and other daemons. Despite tha man page concerning init s/S (and the man page for shutdown), this has not worked reliably for more than 10 years. The only guarenteed way to enter single user mode is to reboot and interrupt the boot process when it says you have 10 seconds. shutdown 0 was a really good way to bypass the (often lengthy) selftests going from an active run level to single user mode, but alas, filesystems remain mounted and other non-essential processes are still running.

Note that on newer processors (N/L class and rp models), a feature called SpeedyBoot was made available (without a lot of docs) to turn off various selftests. The command to set SpeedyBoot options is setboot. Note that full selftests are automatically re-enabled if a RAM or processor error causes the system to crash and reboot.


Bill Hassell, sysadmin
amit mehta_2
Regular Advisor

Re: altering init level

Thanks a lot :-)