Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

whenever i have an unclean shutdown, which is often due to power failure most of the time i get problems with amavis starting up.

The error amavisd Net server pid_file already exists for running process comes when i start it under debug mode, so i always have to delete the amavisd.pid and amavisd.lock files manually before it starts.

Is there a way i can stop this from happening or get a way to delete the files during reboot in the case of an unclean shutdown.

I am running the latest version of amavisd-new 2.6.4 on a centos 5.4 server

Thanks

share|improve this question
    
If it happens often enough to be a problem, you might look into getting a good UPS and cable it to the server so it can do a clean shutdown if power is going to cut out. Otherwise you risk having a damaged filesystem so nothing will start... –  Bart Silverstrim May 5 '10 at 11:24
    
I am working on that too. –  Simiyu May 5 '10 at 15:44
add comment

1 Answer

One not very smart way to handle this problem is to add a line in your initd startup script that deletes the file in question at startup.

Make sure you put it somewhere before amavisd starts.

share|improve this answer
    
I would put anyway a little check to see if no other amavis instances are running and then delete the pid file –  Pier Jun 6 '10 at 12:20
    
Even better ! :) –  Antoine Benkemoun Jun 7 '10 at 8:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.