10 Jan
2006
10 Jan
'06
10:14 p.m.
On Tue, 2006-01-10 at 14:27 +0200, Timo Sirainen wrote:
BTW. Postfix debugging howto tells how to run Postfix processes in gdb:
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont; echo where; sleep 8640000) | gdb $daemon_directory/$process_name $process_id 2>&1 >$config_directory/$process_name.$process_id.log & sleep 5
Maybe the same thing could be implemented for Dovecot..
Attached gdbhelper.c will do pretty much the same for Dovecot. It writes /tmp/gdbhelper.* files when a process crashes (or rather, writes them constantly and deletes them if the process didn't crash). If you have trouble getting backtraces, this should help.
Compile:
gcc gdbhelper.c -o gdbhelper -Wall
And move it to eg. /usr/local/bin/
Change dovecot.conf:
.. protocol imap { mail_executable = /usr/local/bin/gdbhelper /usr/local/libexec/dovecot/imap ..
The same can be done for pop3 and dovecot-auth if needed.