Am 10.05.20 um 23:06 schrieb Michael Biebl:
> On Sat, 7 Mar 2020 16:01:22 +0200 Mpampis Kostas <charkost...@gmail.com>
> wrote:
>> diff --git a/debian/tests/control b/debian/tests/control
>> index 7abd238c3..5bf1dc94b 100644
>> --- a/debian/tests/control
>> +++ b/debian/tests/control
>> @@ -6,5 +6,5 @@ Tests: systemd
>>  Depends: dovecot-core, systemd-sysv
>>  
>>  Test-Command: run-parts --report --exit-on-error debian/tests/usage
>> -Depends: dovecot-imapd, dovecot-pop3d, python3
>> +Depends: dovecot-imapd, dovecot-pop3d, python3, netcat-openbsd
>>  Restrictions: needs-root, breaks-testbed, allow-stderr
>> diff --git a/debian/tests/usage/00_setup b/debian/tests/usage/00_setup
>> index 2eeeb2f73..e90ca7e92 100755
>> --- a/debian/tests/usage/00_setup
>> +++ b/debian/tests/usage/00_setup
>> @@ -29,6 +29,17 @@ chown nobody:nogroup /srv/dovecot-dep8
>>  echo "Restarting the service"
>>  systemctl restart dovecot
>>  
>> +echo "Waiting for the service to be available"
>> +c=0
>> +while ! nc -z -U /var/run/dovecot/auth-userdb; do
>> +    c=$(($c+1))
>> +    sleep 2
>> +    if [ $c -gt 30 ]; then
>> +            echo "Timed out waiting for the service to be available" >&2
>> +            exit 1
>> +    fi
>> +done
> 
> Looping until the service is ready appears to be a workaround/hack at
> best imho.
> 
> The dovecot service should only signal its readiness when the
> communication sockets are ready yet to accept connections. I.e. this
> autopkgtest appears to point at a real issue that should be fixed properly.

Quickly glancing at dovecot.service, I see cat ./dovecot.service.in
...
Type=simple

This is problematic. Type=simple means, the service is considered ready
as soon as the process has been forked off. In case of dovecot, this
does not appear to be the correct choice, as the service is marked ready
before it had a chance to setup its communication channels.

See also https://www.lucas-nussbaum.net/blog/?p=877

My recommendation would be, that dovecot implements the systemd
readiness protocol sd_notify:
https://www.freedesktop.org/software/systemd/man/sd_notify.html


If there are questions, please don't hesitate to ask.

Michael

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to