Issue 1:
qmHandle should check to see if qmail (send) is running, and if it is, stop it. I find that some email (typically spam bounces) cause the qmail-remote processes that qmail-send spawns run for a long time. Often then, you issue qmail-send to terminate (gracefully) and it just waits for all its spawned processes to complete.
I think qmHandle should WAIT until qmail-send terminates gracefully, and then manipulate the queue. Or perhaps kill the long-running qmail-remote processes.
Issue 2:
When trying to terminate qmail-send, I get this error:
Calling system script to terminate qmail...
svc: warning: unable to chdir to /service/qmail-deliver: file does not exist
then the system hangs until qmail-send does terminate naturally, and then it errors on the message that was being processed but has now gone:
Uncaught exception from user code:
cannot open message 14/359! Is qmail-send running?
at /var/qmail/bin/qmHandle line 246
main::getSubject('14/359') called at /var/qmail/bin/qmHandle line 701
I use daemontools, and have used the default:
my ($stopqmail) = '/usr/local/bin/svc -d /service/qmail-send';
(and that command on its own works fine)
so where does /service/qmail-deliver come in to it??
(I have v1.3.2)
Logged In: YES
user_id=783751
Originator: YES
Ahh, partially my mistake; I was looking at source code for version 1.2.0 but using 1.3.2.
Re Issue 2:
v1.2.0 has
my ($stopqmail) = '/usr/local/bin/svc -d /service/qmail-send';
v1.3.2 has
my ($stopqmail) = '/usr/local/bin/svc -d /service/qmail-deliver';
The latter does not work on my system; I suppose there is no standard for the /service/ directory except Dave Sill's book? So perhaps this is just a documentation issue
Logged In: YES
user_id=1391925
Originator: NO
Issue #2: Yes. There is no standard for /service. Some people even have multiple qmail-send queues that are monitored by daemontools. I have yet to come up with a solution for that.
Issue #1: As you have reported the missing pidof problem in FreeBSD, I consider this invalid for 1.3.x does wait for qmail-send to exit and I have safety measures in case deletes are attempted while qmail-send is still running. Hmm...except for delete all cases which does not check for qmail-send activity...