1832511 Members
4645 Online
110043 Solutions
New Discussion

inittab

 
vladimir gershman
Occasional Advisor

inittab

Hello,

I have a script that starts a user application on bootup. The script is in /etc/inittab as a LAST line. If a run state for the script is not specified, is there a chance that the script may start at any state or is evrything in inittab executed sequentially and before it gets to the last line?

Thanks,

Vlad
5 REPLIES 5
John Poff
Honored Contributor

Re: inittab

Hi Vlad,

If you don't specify a run state for an entry in inittab, init will assume that the entry is valid for all run levels. I'm pretty sure that init will execute the lines in inittab in order that they are listed.

I'm just curious, but is there any particular reason to put your script in inittab instead of in /sbin/init.d with a symlink in the appropriate run level directory /sbin/rc#.d ?
I can understand putting it in inittab if you need something respawned in case it dies, but just for getting something to run at startup the /sbin/rc#.d machinery works great and is a standard practice in HP-UX and other flavors of Unix.

JP
Radhakrishnan Venkatara
Trusted Contributor

Re: inittab

hi,

john is correct, normal pratices we will add it /sbin/init.d/rc#.d

directories .

there is problem is putting the program in /etc/inittab if u specified respawan the process will be getting respwaned every time, it might affect ur performance also.

check it whether is it required to be put in inittab otherwise u can put /sbin/init.d/ and have symlink to runlevels.

u template file in /sbin/init.d/template which can copy and customize it.

one thing add an entry in /etc/rc.config.d/

for the file script u r starting.


regards

radhakrishnan
Negative thinking is a highest form of Intelligence
Ravi_8
Honored Contributor

Re: inittab

Hi,

it's standard followed in all Unix to put the script under /sbin/rc#.d and make softlink to /sbin/init.d , so the script start at the particular run level(#).

Scripts in /etc/inittab are for init process


never give up
Bill McNAMARA_1
Honored Contributor

Re: inittab

What is useful about the inittab approach is that if your application crashes init will respawn it.

I also have apps running from there with no problem (all lines always processed)

Bill
It works for me (tm)
vladimir gershman
Occasional Advisor

Re: inittab

Thanks all for the insight on correct usage of startup apps. More of the issue was that an application (it uses network comms) that normally takes 0.5% of CPU time on boot sometimes takes 99% of the CPU time. I was trying to figure out if the fact the app is in inittab w/o any run state specified can start at any run state. This is why I'd like to know if it is possible for the app to start at an earlier state even though it is at the LAST line in inittab.

Thanks,

Vlad