[Dovecot] syslog with PID
Heiko Schlichting
dovecot-l at fu-berlin.de
Wed Aug 13 11:59:34 EEST 2008
Timo Sirainen wrote:
> On Jul 31, 2008, at 12:20 PM, Heiko Schlichting wrote:
>> Without logging the pid, it is impossible to match 'Disconnected' log
>> entries and the corresponding session start/login.
>
> You can use %p in mail_log_prefix to log imap/pop3 process PID. It can't be
> done with login processes, but even if it could be done I doubt it'd be
> useful in figuring out the matching login and disconnect? Unlike other IMAP
> servers Dovecot's login process doesn't directly execv() the imap process..
Using
mail_log_prefix = "%Ls[%p]: user=<%u>, "
is ok but it does not fully solve my problem.
> I've thought about this before too though. Maybe some kind of a unique
> cookie could be useful.
Sounds good but complicated. The only reason why I try to match login and
disconnect is that "imap" and "pop3" does not log a starting message
(without enabling debug) and login was the only entry during connect. The
following minimal patch solves this in a sufficient way and I suggest to
adopt it into the official release:
--- ./src/imap/main.c.org 2008-07-20 19:57:07.000000000 +0200
+++ ./src/imap/main.c 2008-08-06 12:23:16.000000000 +0200
@@ -286,6 +286,7 @@
lib_init();
drop_privileges();
+ i_info("Connected");
process_title_init(argv, envp);
ioloop = io_loop_create();
--- ./src/pop3/main.c.org 2008-07-20 19:57:16.000000000 +0200
+++ ./src/pop3/main.c 2008-08-06 12:29:11.000000000 +0200
@@ -268,6 +268,7 @@
lib_init();
drop_privileges();
+ i_info("Connected");
process_title_init(argv, envp);
ioloop = io_loop_create();
Heiko Schlichting Freie Universität Berlin
heiko at FU-Berlin.DE Zentraleinrichtung für Datenverarbeitung (ZEDAT)
Telefon +49 30 838-54327 Fabeckstraße 32
Telefax +49 30 838454327 14195 Berlin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 245 bytes
Desc: not available
Url : http://dovecot.org/pipermail/dovecot/attachments/20080813/988c0593/attachment.bin
More information about the dovecot
mailing list