Re: [exim] Kick user - force disconnect authenticated sessio…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Jan Ingvoldstad
Datum:  
To: exim users
Betreff: Re: [exim] Kick user - force disconnect authenticated sessions
On Thu, Aug 8, 2013 at 3:26 PM, Marcin Gryszkalis <mg@???> wrote:

> As I dislike the idea of parsing log files (takes too long etc.) - but
> another idea came to my mind after reading your advise - I can save
> pair(pid,autenticated_id) to database with pid as unique key (to solve
> pid reuse) and simple select+kill would do.



You would also have to check that the process is an exim process, and you
should probably check that the process you want to kill belongs to the exim
user.

If this is a Linux, chances are that you can get the message identificator
from ps, too:

$ ps -o cmd -p 17940
/usr/sbin/exim4 -Mc 1V7QMJ-0005WT-CR

So here's my idea on how to check this reasonably reliably:

1) Ensure that the PID isn't re-used while you work: kill -STOP $pid
2) Check that $pid is the right process given the information in e.g. "ps
-o cmd -p $pid"
3) Send it an uninterruptable kill signal: kill -KILL $pid
4) Resume to actually have it killed: kill -CONT $pid

Please note that kill -KILL is very brutal, and gives the process no chance
to clean up its state. This may be what you desire if it is very important
that exim doesn't get to do its job.

--
Jan