1825768 Members
2327 Online
109687 Solutions
New Discussion

inittab configuration

 
Clode
Advisor

inittab configuration

I have to configure the start of IBM agent.
Then I inserted in inittab the follow row but I'm not sure:

ems5:bootwait:/sbin/sh "/opt/IBM/ITM/bin/itmcmd agent start all"

6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: inittab configuration

As long as ems5 is a unique id within inittab, it looks ok. The more typical way to start something like this is to use rc rather than inittab but I assume that you are following the vendor supplied documentation. By putting the agent under the control of rc, you would be able to stop and restart it --- something that inittab really doesn't handle. The other thing that is a little surprising is need to invoke the shell to start this daemon. You should be able to simply list the daemon itself with its arguments.
If it ain't broke, I can fix that.
Clode
Advisor

Re: inittab configuration

thank you for reply,
I would to know if my string is correct.
in my inittab I have :
ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
ems2::bootwait:/sbin/sh -c "/sbin/cat /etc/opt/resmon/persistence/reboot_flag; /sbin/chmod 644 /etc/opt/resmon/persisten
ce/reboot_flag"
ems3:3456:wait:/sbin/sh -c "/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmon/persistenc
e/runlevel4_flag"
ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
ems5:bootwait:/sbin/sh "/opt/IBM/ITM/bin/itmcmd agent start all"

thanks
A. Clay Stephenson
Acclaimed Contributor

Re: inittab configuration

Yes, it will invoke /sbin/sh to in turn spawn your itmcmd at boot time. The system will wait for this command to complete before continuing with the boot process.
If it ain't broke, I can fix that.
Clode
Advisor

Re: inittab configuration

but if my itmcmd failed, boot is go to up or it is stop ??

tx
A. Clay Stephenson
Acclaimed Contributor

Re: inittab configuration

That is the difference between "boot" and "bootwait". The danger is not if your command fails but rather if it hangs. Man inittab for more details.

Again, starting this under the control of rc is probably a much better method.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: inittab configuration

AS Clay states, inittab is a very poor way to start a large application. By rewriting the script to handle the standard 4 parameters (start, stop, start_msg, stop_msg) and return the appropriate codes listed in the /sbin/inittab/template file, you can see exactly what is happening. inittab should only be used for small processes, in particular, daemons.


Bill Hassell, sysadmin