Bug#985054: coturn: fails to purge: rmdir: failed to remove '/var/lib/turn': No such file or directory

2021-03-22 Thread wferi
Control: tag 985054 + pending

Andreas Beckmann  writes:

> That's something I haven't come across so far ;-) (Conditional usage
> of /usr/share/doc content in postinst, unconditional usage of the
> generated side effect in postrm purge.)
> Please move the bits needed by the package out of /usr/share/doc/$pkg
> to /usr/share/$pkg and use it from there.

The schema file is already present there as well, so it's a simple
matter of changing the path in the postinst.

> PS: for your reference, this is the template we use for packages
> failing to access /usr/share/doc content in nodocs tests: [...]

Thanks, that's abundantly clear.  Pity it wasn't triggered, but the
report was right anyway.
-- 
Feri



Bug#985054: coturn: fails to purge: rmdir: failed to remove '/var/lib/turn': No such file or directory

2021-03-22 Thread Andreas Beckmann

On 21/03/2021 18.59, wf...@niif.hu wrote:

wf...@niif.hu writes:


Andreas Beckmann  writes:


According to policy 7.2 you cannot rely on the depends being available
during purge, only the essential packages are available for sure.


I can't see coturn rely on any of its dependencies during purge, do you?


Hi Andreas,

Have you got anything to add here?


No. In the past, a common error causing failure to purge was 
unconditionally using some command provided by the package dependencies 
and the template was coined for that. (We even have more specific 
templates for unconditional ucf and adduser usage, not needed for years.)



(this was observed in a piuparts nodocs test)


Could you please explain to me what a "nodocs" test is?


I read through the Salsa repo, I get it now.


Since the postinst creates /var/lib/turn/turndb if it doesn't exist,
I've got no idea how /var/lib/turn can be missing during purge.


Now I understand: it's created only if the needed schema file is
present.  Unfortunately it's used from under /usr/share/doc.  I'll
upload a fix shortly.


That's something I haven't come across so far ;-) (Conditional usage of 
/usr/share/doc content in postinst, unconditional usage of the generated 
side effect in postrm purge.)
Please move the bits needed by the package out of /usr/share/doc/$pkg to 
/usr/share/$pkg and use it from there.


Andreas

PS: for your reference, this is the template we use for packages failing 
to access /usr/share/doc content in nodocs tests:


To: sub...@bugs.debian.org
Subject: postinst uses /usr/share/doc content (Policy 12.3):

Package:
Version:
Severity: serious
User: debian...@lists.debian.org
Usertags: piuparts

Hi,

a test with piuparts revealed that your package uses files from
/usr/share/doc in its maintainer scripts which is a violation of
Policy 12.3: "Packages must not require the existence of any files in
/usr/share/doc/ in order to function."
https://www.debian.org/doc/debian-policy/ch-docs.html#additional-documentation

These files must be moved to /usr/share/$PACKAGE and may be symlinked
from /usr/share/doc/$PACKAGE.

This piuparts test prevents the installation of (most) files into
/usr/share/doc with 'dpkg --path-exclude=...'.

From the attached log (scroll to the bottom...):



Cheers,



Bug#985054: coturn: fails to purge: rmdir: failed to remove '/var/lib/turn': No such file or directory

2021-03-21 Thread wferi
wf...@niif.hu writes:

> Andreas Beckmann  writes:
>
>> According to policy 7.2 you cannot rely on the depends being available
>> during purge, only the essential packages are available for sure.
>
> I can't see coturn rely on any of its dependencies during purge, do you?

Hi Andreas,

Have you got anything to add here?

>> (this was observed in a piuparts nodocs test)
>
> Could you please explain to me what a "nodocs" test is?

I read through the Salsa repo, I get it now.

> Since the postinst creates /var/lib/turn/turndb if it doesn't exist,
> I've got no idea how /var/lib/turn can be missing during purge.

Now I understand: it's created only if the needed schema file is
present.  Unfortunately it's used from under /usr/share/doc.  I'll
upload a fix shortly.
-- 
Thanks,
Feri



Bug#985054: coturn: fails to purge: rmdir: failed to remove '/var/lib/turn': No such file or directory

2021-03-13 Thread wferi
Andreas Beckmann  writes:

> According to policy 7.2 you cannot rely on the depends being available
> during purge, only the essential packages are available for sure.

Hi Andreas,

I can't see coturn rely on any of its dependencies during purge, do you?

> (this was observed in a piuparts nodocs test)

Could you please explain to me what a "nodocs" test is?  Since the
postinst creates /var/lib/turn/turndb if it doesn't exist, I've got no
idea how /var/lib/turn can be missing during purge.  Was it removed by
the testing framework for being "unowned", for example?  (Anyway, I
agree that the postrm should be protected from such occurrences.)

> From the attached log (scroll to the bottom...):
>
>   Purging configuration files for coturn (4.5.2-2) ...
>   rmdir: failed to remove '/var/lib/turn': No such file or directory
>   dpkg: error processing package coturn (--purge):
>installed coturn package post-removal script subprocess returned error 
> exit status 1
>   Errors were encountered while processing:
>coturn
>
> Why don't you ship the (empty) directory in the package and let dpkg
> take care of creation and removal?

The postinst creates a database in /var/lib/turn, so dpkg --remove could
only emit a warning about not removing an empty directory in most cases.
So the database (and the containing /var/lib/turn directory) must be
removed by the postrm during purge.  Thus I don't see much point in
shipping an empty /var/lib/turn, but I may be overlooking something.
And I actually do, as this bug report proves; but what is it?

(BTW the current setup has another problem: /var/lib/turn must also be
writable by the server for the SQLite database within being writable.)
-- 
Thanks,
Feri



Bug#985054: coturn: fails to purge: rmdir: failed to remove '/var/lib/turn': No such file or directory

2021-03-12 Thread Andreas Beckmann
Package: coturn
Version: 4.5.2-2
Severity: serious
User: debian...@lists.debian.org
Usertags: piuparts

Hi,

during a test with piuparts I noticed your package failed to purge.
According to policy 7.2 you cannot rely on the depends being available
during purge, only the essential packages are available for sure.

(this was observed in a piuparts nodocs test)

>From the attached log (scroll to the bottom...):

  Purging configuration files for coturn (4.5.2-2) ...
  rmdir: failed to remove '/var/lib/turn': No such file or directory
  dpkg: error processing package coturn (--purge):
   installed coturn package post-removal script subprocess returned error exit 
status 1
  Errors were encountered while processing:
   coturn

Why don't you ship the (empty) directory in the package and let dpkg
take care of creation and removal?

cheers,

Andreas


coturn_4.5.2-2.log.gz
Description: application/gzip