Link to home
Start Free TrialLog in
Avatar of aixtutorial
aixtutorialFlag for United States of America

asked on

This is in AIX 5.3..Need a script to start th process every time goes down

This is in aix 5.3..The sendmail daemon goes down quite often,I need a script to bring it up every time it goes down
the comand to bring up the sendmail..This is I am doing manually evertytime it goes down

starsrc -s sendmail -a "-bd"  ..Please let me know as how to automate it as whenever it goes down

ps -ef | grep sendmail
    root  258148  176254   0   Nov 09      -  0:00 sendmail: accepting connections
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

I'd rather do some research to find out why sendmail might die that often
Isn't there anything in errpt?
Anyway, create an entry like this in root's crontab to check every minute for sendmail and restart it if it's not there.
* * * * * ps -ef | grep -q "sendmail:" | grep -v "grep" ||  startsrc -s sendmail -a "-bd -q30m"
wmp
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
look into inittab to see how to run this:

http://linux.die.net/man/5/inittab
omarfarid,
AIX's sendmail is not started from inittab but from /etc/rc.tcpip.
Adding it to inittab with "respawn" would break AIX standards, which I don't recommend here.
wmp
That is understood, but if you want to use crontab then there will be one min gap, while inittab can do better.

An alternative, is to have a script running at system startup and that script loops for ever and it monitors the sendmail as you showed above. One problem here, is that you need to make sure that this script does not die or hangs !
Avatar of balasundaram_s
balasundaram_s

Anyhow this is not relevant to your question, but I may guess that sendmail going down could be due to DNS issue.