Solved

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

Posted on 2010-11-09
6
655 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

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

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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é.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

631 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