1827318 Members
6054 Online
109961 Solutions
New Discussion

Re: inittab

 
SOLVED
Go to solution
Joe Profaizer
Super Advisor

inittab

We have an application that we want to ensure it is always running. We put an entry in /etc/inittab. We were informed that this was monitored by the init process and would restart processes that were terminated.
Below is our entry:
----------------------------
hrms::respawn:su - hradm -c "cd /opt/appserver/psfthrms/hrms751/appserv; ./psad
min -p start -d STL_HDEV"
----------------------------

Upon killing this process, the process didn't restart. Did we define the entry wrong or do we have to notify the init process that the inittab has changed? Must we reboot for every entry we put in the inittab?

Please consult.

..Joe
8 REPLIES 8
John_16
New Member
Solution

Re: inittab

Do an "init q" and it will reread the inittab and the new changes will take effect.
whazup
John Palmer
Honored Contributor

Re: inittab

After changing inittab you need to inform init with the command 'init c'.

Also init will only respawn a process that it started in the first place. ie if you started your daemon manually and then killed it, init would not be aware.
Robert Gamble
Respected Contributor

Re: inittab

Joe,

I would recommend using a different method of keeping that 'aemon' alive.
Use a start script that not only starts your process, but a second process that checks to see if the 1st is still alive with logic included to restart it.

Good Luck
John Palmer
Honored Contributor

Re: inittab

Joe,

Sorry about the typo, I meant 'init q'
John Palmer
Honored Contributor

Re: inittab

Joe,

You should also consider defining a runlevel (second field of the inittab entry) the same as your default (second field of the first record). This will ensure that your daemon only gets started when the system gets to the normal runlevel after a boot.
Vincente Fernandes
Valued Contributor

Re: inittab

You need to define a runlevel(second field), this will make sure that your daemon will restart automatically) when the system comes up in normal runlevel. Do "who -r" will tell you the current level of system. Also you have to create a script in "/sbin/init.d/appscriptname" and linked to the appropriate "rc.?" directory if you want your application to come bootsup/shut down automatically when the server comes bootsup/down. To test it, change second field in inittab to the require runlevel, kill the application and it should come up automatically otherwise do "init q".
Joe Profaizer
Super Advisor

Re: inittab

Thank you all!!!
Joe Profaizer
Super Advisor

Re: inittab

Thank you all!!!