SIS deduplication fails to create intermediate directories and funny permissions

Jesus Cea jcea at jcea.es
Fri Apr 1 11:44:45 UTC 2016


I have configured my system to use SIS, sharing the same same storage
for all users, and offline deduplication.

I have this in my "root" cron:

"""
53 1 * * *  /usr/local/bin/doveadm purge -A
16 * * * *  /usr/local/bin/doveadm sis deduplicate
/home/dovecot/buzones/attachments /home/dovecot/buzones/attachments/queue
"""

Yes, it is launched as "root" but I would expect doveadm drop privileges
as soon as possible.

This is working great, but from time to time I get this error message:

"""
Your "cron" job on babylon5
/usr/local/bin/doveadm sis deduplicate /home/dovecot/buzones/attachments
/home/dovecot/buzones/attachments/queue

produced the following output:

Error: mkdir(/home/dovecot/buzones/attachments/dc/62/hashes) failed: No
such file or directory
"""

Looks like doveadm is trying to create the "hashes" directory but the
parent "62" doesn't exits yet. If I create that directory by hand and
set permissions correctly, everything (seems to) work.

Talking about this, I see something strange wit the permissions.

All files and directories in SIS are created with "dovemail" user and
group EXCEPT the "hashes" directory inside the newly created directory.

That is:

When I get the error message, I have this:

"""
drwx------   7 dovemail dovemail   7 Apr  1 13:28 .
drwx------ 237 dovemail dovemail 237 Mar 24 20:09 ..
drwx------   3 dovemail dovemail   3 Feb 29 02:30 1d
drwx------   3 dovemail dovemail   3 Mar  9 01:53 7f
drwx------   3 dovemail dovemail   3 Feb 29 02:30 88
drwx------   3 dovemail dovemail   3 Feb 29 02:30 8d
"""

I create the missing directory by hand and change permissions. Now I have:

"""
drwx------   7 dovemail dovemail   7 Apr  1 13:28 .
drwx------ 237 dovemail dovemail 237 Mar 24 20:09 ..
drwx------   3 dovemail dovemail   3 Feb 29 02:30 1d
drwx------   3 dovemail dovemail   3 Apr  1 13:30 62
drwx------   3 dovemail dovemail   3 Mar  9 01:53 7f
drwx------   3 dovemail dovemail   3 Feb 29 02:30 88
drwx------   3 dovemail dovemail   3 Feb 29 02:30 8d
"""

I run the deduplicator again (as root) and it creates a "hashes"
directory inside the "62" directory... with user/group root/root.

"""
drwx------ 2 root root 2 Apr  1 13:30 hashes
"""

-- 
Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
jabber / xmpp:jcea at jabber.org  _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://dovecot.org/pipermail/dovecot/attachments/20160401/74185528/attachment.sig>


More information about the dovecot mailing list