aixtutorial
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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 !
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 !
Anyhow this is not relevant to your question, but I may guess that sendmail going down could be due to DNS issue.
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