Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling the crontab entry following a power failure

Status
Not open for further replies.

justanobody

Technical User
Feb 2, 2005
9
0
0
US
We are running AIX 5.3 and after a power failure the OS writes an entry to the crontab file do a "wall" command every 12 hours notifying the user of the previous power failure.

We know how to remove the entry from the crontab file, but how do we disable the entry from even being written in the first place?
 
have you looked at /etc/rc.powerfail script ?????
 
Thank you for your reply. I had not looked at the /etc/rc.powerfail file. Per your suggestion, I just looked at the file, but I do not understand how to implement the disabling of the power failure messages. Can you guide me through the changes?

Thank you.
 
Why would you want to just remove the cron job like the good books say to do
 
> Why would you want to just remove the cron job like the good books say to do
I am sorry, but I do not understand what you are implying.

We have been removing the cron job (via the "crontab -e" command) so the users are not hindered by the messages. We have over 1000 of these systems on the UPS, but for the 90-100 of these systems not on the UPS it is quite time consuming to login to each system and remove the crontab entry.

A mechanism to disable the cron job from being created will save loads of time.

Can you please step us through the process of modifying the /etc/rc.powerail file?

Thank you.
 
> Why would you want to just remove the cron job like the good books say to do
I am sorry, but I do not understand what you are implying.

We have been removing the cron job (via the "crontab -e" command) so the users are not hindered by the messages. We have over 1000 of these systems on the UPS, but for the 90-100 of these systems not on the UPS it is quite time consuming to login to each system and remove the crontab entry.

A mechanism to disable the cron job from being created will save loads of time.

Can you please step us through the process of modifying the /etc/rc.powerail file?

Thank you.
 
Presumably you're saying that you don't mind receiving the first message, but the subsequent ones are a pain?

I don't think I'd go tinkering with the rc.powerfail script at all. My approach (if I wished to do as you want to do) would be to periodically refresh the crontab to eliminate any entries found which cause this 12 hourly message. Maybe cron this to run every two hours or so. Pseudo script might be:

crontab -l | grep -v 'text re power problem' > crontab.tmp
crontab crontab.tmp

So that this refreshes the crontab without including the power failure message. Any comments on the viability of this welcome.
 
why are some many systems not on UPS guess you don't care about data corruption hardware problems due to numerous power drops
 
Management believes the cost of not having these systems on the UPS outweighs the cost of replacing the UPS.
 
I feel for you I too had a similiar issue once until a power hit wiped out 35 data bases that ran on unprotected machines. They lost more in overtime and replacement of hardware than the cost of UPS systems, this was verified with an after action report and analysis was done
 
>>crontab -l | grep -v 'text re power problem' > crontab.tmp
If you do something like this as suggested (which sounds like a good idea), just be careful with the temporary file. Make sure it is only writable by root, such that a normal user can't put their own commands in it for cron to run on their behalf!
 
I will make sure it is only writable by root. Thank you for the suggestion.
 
check the corresponding entry in /etc/rc.powerfail, comment function send_warning()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top