Solved

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

Posted on 2010-11-09
6
640 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:aixtutorial
  • 3
  • 2
6 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 34099887
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
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 250 total points
ID: 34099899
Sorry, the sequence of the greps is wrong -
* * * * * ps -ef | grep -v "grep" | grep -q "sendmail:" ||  startsrc -s sendmail -a "-bd -q30m"
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 34100067
look into inittab to see how to run this:

http://linux.die.net/man/5/inittab
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 68

Expert Comment

by:woolmilkporc
ID: 34100094
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
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 34100244
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 !
0
 
LVL 5

Expert Comment

by:balasundaram_s
ID: 34139997
Anyhow this is not relevant to your question, but I may guess that sendmail going down could be due to DNS issue.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question