Solved

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

Posted on 2010-11-09
6
609 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
Comment Utility
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
Comment Utility
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
Comment Utility
look into inittab to see how to run this:

http://linux.die.net/man/5/inittab
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
good comptia a+ teacher? 4 73
Linux operating system 12 64
unix solaris snoop command 6 43
My bash alias isn't executing 5 31
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now