Qmail Supervise : no way to kill it


Our QMail installation run under svscan (daemontools v0.76).

We had a crash 1 month ago (overload), I managed to put everything back up and it's working fine, but for obvious reason there is no way to kill qmail processes (to clean the qmail queue for example), i tried this so far :

kill -9 [PID] -> using all of the below PIDS as they are displayed via "ps -fx" command
svs -k qmail-pop3d
svs -k qmail-send
svs -k qmail-smtpd

None ove the above commands give results (or errors), the svscan relaunch itself with a new PID and all subsequent services (qmail daemons)

Here is the output of 'ps -fx' (only on the qmail part), you'll see that readproctitle gives an error, i don't know if is related to my problem but I remember that before the crash the kill commands I use before worked (I then restarted Qmail using the following commands : "csh -cf '/command/svscanboot &'" to launch dameontools without the need of reboot and then "/etc/init.d/qmail restart" wich worked fine)

30526 ?        S      0:00 /bin/sh /command/svscanboot
30528 ?        S      0:00  \_ svscan /service
 2965 ?        S      0:00  |   \_ supervise qmail-pop3d
29620 ?        Z      0:00  |   |   \_ [tcpserver <defunct>]
 2967 ?        S      0:00  |   \_ supervise log
 2969 ?        S      0:00  |   \_ supervise log
 2971 ?        S      0:00  |   \_ supervise qmail-smtpd
29619 ?        Z      0:00  |   |   \_ [tcpserver <defunct>]
 2973 ?        S      0:00  |   \_ supervise log
 5098 ?        S      0:00  |   \_ supervise qmail-send
30532 ?        S      0:00  \_ readproctitle service errors: ..............supervise: fatal: unable to acquire qmail-pop3d/supervise/lock: temporary failure?

So how do I kill this tricky stuff ? ;-)

Thanks for your help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Duncan RoeSoftware DeveloperCommented:
You could try taking the system sown to single-user mode with "telinit s". Then you could perform your housekeeping, and then reboot.
FFTAuthor Commented:
Unfortunately it is our production server, and getting it down is not really the first option it think ok (and it is located on a dedicated datafloor 10 kilometers away...) can you think of an alternative ? ;-)

Duncan RoeSoftware DeveloperCommented:
The general method would be to mv binaries to their name with some suffix (.backup, .real &c) and replace them with shell scripts which sleep for a long time. Then kill the process hierarchy and the scripts will get run in their place.
Does init start svscanboot? Perhaps you could modify inittab.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

FFTAuthor Commented:
I see your point but what should contain these shell scripts ?

Yes Svscanboot is launched at startup, but since I do not wish to reboot...


Could you precise a little bit ?

Thanks for your help


I faced the same problem in my Server...

i did this way...

1) Kill all the "qmail" related process
2) Comment out the following line in "/etc/inittab"...


3) # init q
4) Rebuid the binary.
5) Enable the above commented line in "/etc/inittab"
6) #init q
7) start Qmail using "qmailctl" script or ur customised script.

Hope this will solve ur problem.

If this will not solve the issue make sure u have correct error patches installed for "Qmail","Daemon-tool" Etc...

You can get the pathes from here...


All the best.

Duncan RoeSoftware DeveloperCommented:
Edit /etc/inittab - comment out the line that fires up svscanboot. By the way, you should not start it in runlevels 1 or 6(probably).
Once you have done that, send a signal to init:
  kill -HUP 1
This will cause init to reread /etc/inittab. It will kill svscanboot since this is no longer in its table. After that you can kill the qmail processes. Do your housekeeping, uncomment the line in inittab, kill -HUP 1 again, and the whole show should restart.
FFTAuthor Commented:
Ok thanks, I will test all of that tonight, but I'm a bit afraid of the 'kill -HUP 1' stuff, will it make my server reboot and Kill all other running process (Apache, Mysql, etc...) ?
Also About rebuilding binaries I use qmail-scanner (wich mcafee anti virus) and spam assassin bind to qmail, I used the following page to do it : http://sylvestre.ledru.info/howto/howto_qmail_vpopmail.php. So, will it kill all my current configuration if I rebuild them ? (pop accounts, etc.).
Duncan RoeSoftware DeveloperCommented:
kill -HUP 1 is a pretty standard thing to do. See man 8 init.
Actually I see the modern way to do it is "telinit q", having checked the man page myself.
FFTAuthor Commented:

I did not have the time to make the test yesterday, but I would like to have some precision before to do this, since I'm will do this thru an SSH session, I assume I'll lost it as soon as I enter 'telinit q" right ? This sounds like a reboot to me and I'm not sure that all services are configured to start automatically after this (especially SSH server wich would force me to drive 10 km away ;-)
Duncan RoeSoftware DeveloperCommented:
No, it's nothing like a reboot. All it does is get init to re-read /etc/inittab. If services are no longer listed that used to be, then init kills them (sends TERM signal and if they don't exit in a few seconds then sends KILL). If services are now listed that didn't used to be, then it starts them. It leaves the rest *alone*. I use it frequently at work (actually kill -HUP 1, I haven't tried telinit q yet). What I *don't* know is how powerful is svscanboot. Does that kill services under its control when it gets a TERM signal? Your doco should tell you if it does. How many services do you have under its control anyway?
FFTAuthor Commented:
My /etc/inittab :

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
x:5:respawn:/etc/X11/prefdm -nodaemon
Duncan RoeSoftware DeveloperCommented:
Ok, so comment-out the last line and kill -HUP 1. svscanboot will go away, then you can shut down qmail. When done, uncomment the last line and kill -HUP 1 again. svscanboot will restart.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FFTAuthor Commented:
Ok duncan, everything went fine as you explained, svscanboot was killed and merelly all other supervised qmail processes went down as well, I just killed the tcpserver to be sure everything went down and restarted everything back with no problem, everything is working fine now ! Thanks very much for your help.

I would like to also thanks deepakjena_2003 about his(her ?) suggestions.

Have a good day.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.