Operating System - Linux
1753448 Members
5819 Online
108794 Solutions
New Discussion юеВ

Equivalent to /etc/inittab

 
SOLVED
Go to solution
skt_skt
Honored Contributor

Equivalent to /etc/inittab


Is there an an equivalne file in Linux to /etc/inittab of hp-UX to specify the run level(like single user mode), other than /etc/grub.conf.

11 REPLIES 11
Ivan Ferreira
Honored Contributor

Re: Equivalent to /etc/inittab

Linux also uses /etc/inittab and you can specify there the runlevel in the line initdefault.

What Linux distribution?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
TwoProc
Honored Contributor

Re: Equivalent to /etc/inittab

Well... there's /etc/inittab. :-)

At least in RH there is. What version of Linux are you on? I think that maybe some Debian variants (if I remember correctly, but it's been a while) don't use it though.

What version are you speaking of?
We are the people our parents warned us about --Jimmy Buffett
Stuart Browne
Honored Contributor

Re: Equivalent to /etc/inittab

All major linux varients I've come across on a PC/Server/Desktop type platform use an 'inittab'.

The 'id:X:initdefault:' line specifies the default run level.
One long-haired git at your service...
Mike Stroyan
Honored Contributor

Re: Equivalent to /etc/inittab

Ubuntu uses 'upstart' instead of sysvinit and /etc/inittab.
http://en.wikipedia.org/wiki/Upstart

Upstart is configured by files in /etc/event.d/. The /etc/event.d/rc-default script selects the default level. That script still looks at /etc/inittab and the initdefault setting.
dirk dierickx
Honored Contributor

Re: Equivalent to /etc/inittab

grub is not the same thing as init/upstart and the config file inittab.

grub is the boot manager of linux, compare it with ISL on HPUX.

just to be sure you know.
Huc_1
Honored Contributor
Solution

Re: Equivalent to /etc/inittab

In /etc/inittab change the following line to the level you want here it is level 5

id:5:initdefault:

If you want it to level 1 (single user) use

id:1:initdefault:

But this is usualy not done like this but at boot time at the console by interrupting grub
just type then

Select the line that starts with kernel you want and type e to edit the line.

Go to the end of the line and type single or 1 as a separate word (press the [Spacebar] and then type single or 1). Press [Enter] to exit edit mode.

Back at the GRUB screen, type b to boot into single user mode.

this will get you in single user mode for just this one boot if you need to be more permanent ie at each boot you could write this into the file /boot/grub/menu.lst

when your are in single user mode you need to manualy type a d to execute the rest of startup...

this will then execute your /etc/inittab to the level you specified there...


Hope this is what you needed

enjoy life.

Jean-Pierre Huc
Smile I will feel the difference
~sesh
Esteemed Contributor

Re: Equivalent to /etc/inittab

The /etc/inittab file is present in Linux also. I'm not sure if it has a similar format as HP-UX.

id:X:initdefault: is the line specifies the default run-level that the system will boot into.

grub.conf or editing the boot options during the Grub loader will also help you boot into the run-level you would like.
skt_skt
Honored Contributor

Re: Equivalent to /etc/inittab

is there a harm in inittab method compare to gur.conf method to boot in single user mode.

Later (once in single user mode)update the inittab to normal run level and doing ctrl+d..
Alexander Chuzhoy
Honored Contributor

Re: Equivalent to /etc/inittab

No harm, but it is less common to specify the default runlevel in grub.conf.