1846764 Members
4898 Online
110256 Solutions
New Discussion

Re: /etc/init

 
Alice_4
Occasional Advisor

/etc/init

what is the relationship between the inittab and the /etc/init?

what are the files in inittab and what is /etc/rc?

i get so confuse with all these key concepts/files.

thank you guys...
2 REPLIES 2
Jeff Schussele
Honored Contributor

Re: /etc/init

Hi Alice,

Well in HP-UX it's /etc/inittab, /sbin/init.d & /sbin/rcX.d where X could equal 0,1,2,3,4,5 or 6

The inittab file is what spawns most everything including the rc stuff.

It's not files in inittab it's commands - to be spawned - including when & how.

The files in the /sbin/rcX.d dirs are actually links to the real files in /sbin/init.d
Where the files are in the various directories (rc2.d, rc3.d, etc) determine just when they run i.e. in which run-level they are executed. For instance if you bring up the system in single-user mode (run level 1) the files in rc2.d & rc3.d are NOT run. But the files in /sbin/rc1.d ARE.

The inittab file contains a field (the 2nd) which defines just what run level(s) these init processes will be spawned in.

There's a lot more involved here, but this should get you started.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bill Hassell
Honored Contributor

Re: /etc/init

/etc/init and /etc/rc sound very much like HP-UX version 9 or earlier (hint: uname -r). In the old days (before version 10), there were a lot of executables and scripts in /etc and init was one of them. So init is started by the kernel at bootup and init reads the inittab file to know what to run (or respawn in some cases).

/etc/rc is the main start script. The kernel starts a shell to read this script and perform the required actions. /etc/rc and /etc/inittab are plain ASCII files so you can look at them. man init will give some details.

In version 10 and later, /etc/rc is replaced by a series of setting files (/etc/rc.config.d) and a series of start/stop scripts in /sbin/init.d/

Version 9 has been obsolete for many years.


Bill Hassell, sysadmin