Koozali.org: home of the SME Server

qmhandle and qmail not stopping

Offline bosco555

  • *****
  • 152
  • +0/-0
qmhandle and qmail not stopping
« on: January 22, 2018, 09:35:52 AM »
Hi all,

I'm trying to delete some huge emails in the queue, but I am unable to stop qmail.
Tried:
sv t /service/qmail
sv d /service/qmail
/etc/init.d/qmail stop to no avail.
I know that this topic came up a lot in the past, and searched and read the topics, but qmail still doesn't want to stop:

Calling system script to terminate qmail...
timeout: run: qmail: (pid 4880) 892s, normally down, want down, got TERM
Uncaught exception from user code:
        Could not stop qmail:
 at /usr/bin/qmHandle line 178

Could any good soul please shed some light?
thanks in advance

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: qmhandle and qmail not stopping
« Reply #1 on: January 22, 2018, 01:27:54 PM »
Left to its own devices, qmail will not stop until the last open connection closes.  If your server is sending a large email to a large number of recipients, that can take quite a while.

If you're local to the server unplugging network connection for 2 - 5 minutes should allow the open qmail connections to timeout, which would then allow qmail to close.

Killing qmail-remote might do it, too:
Code: [Select]
sv d qmail
killall qmail-remote
#
# ... verify that qmail is down, do your queue cleanup
#
sv u qmail


Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: qmhandle and qmail not stopping
« Reply #2 on: January 22, 2018, 03:12:31 PM »
Most of the time qmhamdledoes the job stopping qmail, but yes i have seen this issue too when qmail remote is already trying to send a bunch of email when you try to remove them.


Sometime service qmail stop before qmhamdle and then service qmail start helps.

Indeed the more efficient approach is killing qmail remote. Should we add this on qmhandle wiki page?

I do not think it is necessary to kill every time so might not need a code change... unless we make the killing conditionnal.

Offline Eugene

  • 3
  • +0/-0
Re: qmhandle and qmail not stopping
« Reply #3 on: January 26, 2018, 02:33:44 PM »
sorry , I have  understand
« Last Edit: January 26, 2018, 02:36:02 PM by Eugene »