[Dovecot] dovecot-pgsql.conf can't find in chroot? (debian)

Matthew J. Harmon mjharmon at gmail.com
Sun Mar 6 02:19:39 EET 2005


In my original email I noted that the directory /usr/local/etc was in
the dovecot.conf variable valid_chroot_dirs :

valid_chroot_dirs = /usr/local/etc:/etc:/var/mail:/lib

Is that not sufficient?  Under the /var/run/dovecot directory the
directories ./usr/local/etc exist with dovecot-pgsql.conf in.

Is there some big RTFM item I'm missing here?

-Matthew

P.S. - email address changed due to problems with upstream, will jump
back as soon as this is fixed so I can finish my migration :)

On Sat, 2005-03-05 at 09:06 +0100, Gunter Ohrner wrote:
> Am Samstag, 5. März 2005 05:27 schrieb Matthew J. Harmon:
> > I have dovecot (+ssl) configured on debian in a chroot with
>                                                   ^^^^^^
> 
> I've never run dovecot chrooted, but...
> 
> > The file exists, and permissions look good:
> > root at alfa:~# ls -la /usr/local/etc/dovecot-pgsql.conf
> 
> ...let me guess, you're not in the chroot here?
> 
> So, how should dovecot be able to find this file while it runs chrooted? 
> You need to put all needed files into the chroot.

> Yep, that's how it's with 0.99.x. With 1.0-tests however Dovecot opens
> the dovecot-pgsql.conf before chrooting.

---
Plagued with an error I can't get past:
==> dovecot_info.log <==
dovecot: Mar 04 22:09:06 Info: Dovecot starting up
==> dovecot.log <==
dovecot-auth: Mar 04 22:09:07 Fatal: Can't open configuration file 
/usr/local/etc/dovecot-pgsql.conf: No such file or directory
dovecot: Mar 04 22:09:07 Error: child 18211 (auth) returned error 89
dovecot: Mar 04 22:09:07 Error: Auth process died too early - shutting 
down
pop3-login: Mar 04 22:09:07 Fatal: fd_send(-1) failed: Broken pipe

I have dovecot (+ssl) configured on debian in a chroot with 
postfix+pgsql+sasl.

The file exists, and permissions look good:
root at alfa:~# ls -la /usr/local/etc/dovecot-pgsql.conf
lrwxrwxrwx  1 root dovecot 31 2005-03-04 20:35 
/usr/local/etc/dovecot-pgsql.conf -> /etc/dovecot/dovecot-pgsql.conf
root at alfa:~# ls -la /etc/dovecot/dovecot-pgsql.conf
-rw-r--r--  1 root dovecot 2875 2005-03-01 23:38 
/etc/dovecot/dovecot-pgsql.conf

But... dovecot-auth can't see it?  That's weird...
root at alfa:~# strace -vffF /etc/init.d/dovecot start 1>& ~/dovecot.strace
root at alfa:~# less ~/dovecot.strace
[...] :/chroot
[...] :/dovecot-pgsql.conf

[pid 18211] open("/var/log/dovecot_info.log", 
O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666 <u
nfinished ...>
[pid 18213] fcntl64(5, F_SETFD, FD_CLOEXEC <unfinished ...>
[pid 18211] <... open resumed> )        = 5
[pid 18213] <... fcntl64 resumed> )     = 0
[pid 18211] fstat64(5,  <unfinished ...>
[pid 18209] <... fcntl64 resumed> )     = 0
[pid 18211] <... fstat64 resumed> {st_dev=makedev(22, 1), st_ino=917830, 
st_mode=S_IFREG|060
0, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=16, 
st_size=4264, st_atime=200
5/03/04-22:09:07, st_mtime=2005/03/04-22:09:06, 
st_ctime=2005/03/04-22:09:06}) = 0
[pid 18211] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
x40019000
[pid 18211] fstat64(5, {st_dev=makedev(22, 1), st_ino=917830, 
st_mode=S_IFREG|0600, st_nlink
=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=16, st_size=4264, 
st_atime=2005/03/04-22:
09:07, st_mtime=2005/03/04-22:09:06, st_ctime=2005/03/04-22:09:06}) = 0
[pid 18211] _llseek(5, 4264, [4264], SEEK_SET) = 0
[pid 18211] fcntl64(5, F_GETFD)         = 0
[pid 18211] fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
[pid 18211] open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 6
[pid 18211] fcntl64(6, F_GETFD)         = 0
[pid 18211] fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
[pid 18211] open("/etc/localtime", O_RDONLY) = 7
[pid 18211] fstat64(7, {st_dev=makedev(22, 1), st_ino=6193169, 
st_mode=S_IFREG|0644, st_nlin
k=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=1279, 
st_atime=2005/03/04-22:
09:07, st_mtime=2004/12/26-20:19:40, st_ctime=2005/02/09-03:35:52}) = 0
[pid 18211] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
x4001a000
[pid 18211] read(7, 
"TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0"..., 4096) = 127
9
[pid 18211] close(7)                    = 0
[pid 18211] munmap(0x4001a000, 4096)    = 0

** chrooting dovecot-auth
[pid 18211] chroot("/var/run/dovecot-auth") = 0
[pid 18211] chdir("/")                  = 0
[pid 18211] gettimeofday({1109995747, 798541}, {360, 0}) = 0
[pid 18211] rt_sigaction(SIGHUP, {0x404a07a0, [], SA_RESTORER, 
0x4027e678}, NULL, 8) = 0
[pid 18211] rt_sigaction(SIGINT, {0x404a07a0, [INT], 
SA_RESTORER|SA_RESTART, 0x4027e678}, {SIG_DFL}, 8) = 0
[pid 18211] rt_sigaction(SIGTERM, {0x404a07a0, [TERM], 
SA_RESTORER|SA_RESTART, 0x4027e678},
{SIG_DFL}, 8) = 0
[pid 18211] rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_IGN}, 8) = 0

*** lets look at dovecot-pgsql.conf!
[pid 18211] open("/usr/local/etc/dovecot-pgsql.conf", 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No
such file or directory)
[pid 18211] time(NULL)                  = 1109995747
[pid 18211] write(4, "dovecot-auth: Mar 04 22:09:07 Fa"..., 128) = 128
[pid 18211] munmap(0x40018000, 4096)    = 0
[pid 18211] exit_group(89)              = ?
Process 18211 detached

Excerpts from /etc/dovecot/dovecot.conf:
auth_userdb = pgsql /usr/local/etc/dovecot-pgsql.conf
auth_passdb = pgsql /usr/local/etc/dovecot-pgsql.conf
login_chroot = yes
valid_chroot_dirs = /usr/local/etc:/etc:/var/mail:/lib
auth_chroot = /var/run/dovecot-auth

Any recommended next steps?

Thanks a million!

-Matthew



More information about the dovecot mailing list