Debian Bug report logs - #829418
pptpd uses incorrect method to identify systemd

version graph

Package: pptpd; Maintainer for pptpd is Christoph Biedl <debian.axhn@manchmal.in-ulm.de>; Source for pptpd is src:pptpd (PTS, buildd, popcon).

Reported by: Craig Sanders <cas@taz.net.au>

Date: Sun, 3 Jul 2016 07:21:01 UTC

Severity: important

Tags: confirmed, help

Found in version pptpd/1.4.0-8

Fixed in version pptpd/1.4.0-9

Done: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Christoph Biedl <debian.axhn@manchmal.in-ulm.de>:
Bug#829418; Package pptpd. (Sun, 03 Jul 2016 07:21:05 GMT) (full text, mbox, link).


Acknowledgement sent to Craig Sanders <cas@taz.net.au>:
New Bug report received and forwarded. Copy sent to Christoph Biedl <debian.axhn@manchmal.in-ulm.de>. (Sun, 03 Jul 2016 07:21:06 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Craig Sanders <cas@taz.net.au>
To: submit@bugs.debian.org
Subject: pptpd uses incorrect method to identify systemd
Date: Sun, 3 Jul 2016 17:17:26 +1000
Package: pptpd
Version: 1.4.0-8

pptpd.postint uses the following to identify whether a system
is using systemd as init:

        if [ -x "$(which systemctl || true)" ] ; then

this doesn't work. the systemd package is an almost mandatory install
on debian due to dependencies these days, almost impossible to avoid
it even if you don't want it (i could purge it but then i'd lose about
half-a-dozen packages I want, plus another twenty or so I don't care
much about)- even a sysvinit box has systemctl installed, resulting in:

# dpkg --configure --pending
Setting up pptpd (1.4.0-8) ...
Failed to restart systemd-modules-load.service: No such method 'RestartUnit'
See system logs and 'systemctl status systemd-modules-load.service' for details.
dpkg: error processing package pptpd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 pptpd


You need to check whether the systemd-sysv package is installed.

The easiest way to do that is to check if the directory 
/usr/share/doc/systemd-sysv/ exists, e.g.:

        if [ -d /usr/share/doc/systemd-sysv/ ] ; then


craig



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#829418; Package pptpd. (Sun, 03 Jul 2016 08:15:15 GMT) (full text, mbox, link).


Acknowledgement sent to Christoph Biedl <debian.axhn@manchmal.in-ulm.de>:
Extra info received and forwarded to list. (Sun, 03 Jul 2016 08:15:15 GMT) (full text, mbox, link).


Message #10 received at 829418@bugs.debian.org (full text, mbox, reply):

From: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
To: Craig Sanders <cas@taz.net.au>, 829418@bugs.debian.org
Subject: Re: Bug#829418: pptpd uses incorrect method to identify systemd
Date: Sun, 3 Jul 2016 10:12:44 +0200
[Message part 1 (text/plain, inline)]
tags 829418 confirmed help
severity 829418 important
thanks

Craig Sanders wrote...

> (...) even a sysvinit box has systemctl installed (...)

*yuck* Trying to do things for the best yields results like this.

And while I agree systemd is more or less unavoidable these days, I
still want to support those who run Debian without it.

> The easiest way to do that is to check if the directory 
> /usr/share/doc/systemd-sysv/ exists, e.g.:
> 
>         if [ -d /usr/share/doc/systemd-sysv/ ] ; then

Unfortunately not that way, by Policy 12.3:

| Packages must not require the existence of any files in
| /usr/share/doc/ in order to function.

    Christoph
[signature.asc (application/pgp-signature, inline)]

Added tag(s) confirmed and help. Request was from Christoph Biedl <debian.axhn@manchmal.in-ulm.de> to control@bugs.debian.org. (Sun, 03 Jul 2016 08:15:20 GMT) (full text, mbox, link).


Severity set to 'important' from 'normal' Request was from Christoph Biedl <debian.axhn@manchmal.in-ulm.de> to control@bugs.debian.org. (Sun, 03 Jul 2016 08:15:20 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Christoph Biedl <debian.axhn@manchmal.in-ulm.de>:
Bug#829418; Package pptpd. (Sun, 03 Jul 2016 09:15:05 GMT) (full text, mbox, link).


Acknowledgement sent to Craig Sanders <cas@taz.net.au>:
Extra info received and forwarded to list. Copy sent to Christoph Biedl <debian.axhn@manchmal.in-ulm.de>. (Sun, 03 Jul 2016 09:15:05 GMT) (full text, mbox, link).


Message #19 received at 829418@bugs.debian.org (full text, mbox, reply):

From: Craig Sanders <cas@taz.net.au>
To: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Cc: 829418@bugs.debian.org
Subject: Re: Bug#829418: pptpd uses incorrect method to identify systemd
Date: Sun, 3 Jul 2016 19:05:56 +1000
On Sun, Jul 03, 2016 at 10:12:44AM +0200, Christoph Biedl wrote:
> >         if [ -d /usr/share/doc/systemd-sysv/ ] ; then
> 
> Unfortunately not that way, by Policy 12.3:
> 
> | Packages must not require the existence of any files in
> | /usr/share/doc/ in order to function.

It's arguable whether that **requires** the existence of a file/dir in
order to function, it's just using the existence to decide which method
to use for loading the module(s).

the next best method (slower, from calling dpkg-query and grep, but just
as certain if not more so) would be to use dpkg-query:

    if dpkg-query --show --showformat '${status}\n' systemd-sysv |
	  grep -q " installed$" ; then

or, with short options:

    if dpkg-query -W -f '${status}\n' systemd-sysv |
	  grep -q " installed$" ; then

It should be possible to run dpkg-query in a postinst, it's a read-only
operation so isn't affected by the lock.

BTW, the space in " installed$" is essential, as "not-installed" is also
valid there.

Also, the '\n' in the format string isn't strictly necessary, but some
tools (not grep) ignore the last line of input if it isn't terminated by
a newline.

craig

-- 
craig sanders <cas@taz.net.au>



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#829418; Package pptpd. (Sun, 03 Jul 2016 10:03:10 GMT) (full text, mbox, link).


Acknowledgement sent to Christoph Biedl <debian.axhn@manchmal.in-ulm.de>:
Extra info received and forwarded to list. (Sun, 03 Jul 2016 10:03:10 GMT) (full text, mbox, link).


Message #24 received at 829418@bugs.debian.org (full text, mbox, reply):

From: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
To: Craig Sanders <cas@taz.net.au>, 829418@bugs.debian.org
Subject: Re: Bug#829418: pptpd uses incorrect method to identify systemd
Date: Sun, 3 Jul 2016 12:00:36 +0200
[Message part 1 (text/plain, inline)]
Craig Sanders wrote...

> It's arguable whether that **requires** the existence of a file/dir in
> order to function, it's just using the existence to decide which method
> to use for loading the module(s).

Yes but but still I'd like to make the postinst behaviour as robust as
possible. Espescially since I've screwed up the first time.

> the next best method (slower, from calling dpkg-query and grep, but just
> as certain if not more so) would be to use dpkg-query:
(...)

Actually, the test should be "Is pid1 systemd"? So I will rather check
either /proc/1/exe or /run/systemd/system - the latter seems to be the
better choice. (About /proc/, that should work pptpd is Architecture:
linux-any so I don't have to care for bsd and hurd.)

    Christoph
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christoph Biedl <debian.axhn@manchmal.in-ulm.de>:
You have taken responsibility. (Sun, 03 Jul 2016 22:57:15 GMT) (full text, mbox, link).


Notification sent to Craig Sanders <cas@taz.net.au>:
Bug acknowledged by developer. (Sun, 03 Jul 2016 22:57:15 GMT) (full text, mbox, link).


Message #29 received at 829418-close@bugs.debian.org (full text, mbox, reply):

From: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
To: 829418-close@bugs.debian.org
Subject: Bug#829418: fixed in pptpd 1.4.0-9
Date: Sun, 03 Jul 2016 22:53:16 +0000
Source: pptpd
Source-Version: 1.4.0-9

We believe that the bug you reported is fixed in the latest version of
pptpd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 829418@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christoph Biedl <debian.axhn@manchmal.in-ulm.de> (supplier of updated pptpd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 03 Jul 2016 20:34:15 +0200
Source: pptpd
Binary: pptpd bcrelay
Architecture: source armhf
Version: 1.4.0-9
Distribution: unstable
Urgency: medium
Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Changed-By: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Description:
 bcrelay    - Broadcast relay daemon
 pptpd      - PoPToP Point to Point Tunneling Server
Closes: 829418
Changes:
 pptpd (1.4.0-9) unstable; urgency=medium
 .
   * Fix systemd check in postinst. Closes: #829418
   * Fix a typo in the pptpd manpage
   * Upgrade to Standards-Version: 3.9.8, no changes
Checksums-Sha1:
 ec4cf70c4cdb167f0f5854be14405ef300203218 1820 pptpd_1.4.0-9.dsc
 3e4625c3a0f2b230d80a34c2562e42b07be3227f 23884 pptpd_1.4.0-9.debian.tar.xz
 6b7a7b1ceff9aabebf90235a4bc6fc9671e1def4 18292 bcrelay-dbgsym_1.4.0-9_armhf.deb
 409eb0ce8df97824e5330f8e8d90179fd8efbe7c 26680 bcrelay_1.4.0-9_armhf.deb
 a910d6a77e3d5055c234bd2096bcd150f9e81b63 64696 pptpd-dbgsym_1.4.0-9_armhf.deb
 a703ccfae42b3b22ffd6c5fe4db4b749ab5426fd 89828 pptpd_1.4.0-9_armhf.deb
Checksums-Sha256:
 fb7c85a92389d03e6312c7446b6742408075161a29ded8919caf5ec9470d0e39 1820 pptpd_1.4.0-9.dsc
 08005ffc0ae3738d5065528251b69d35a00cd3c89885b2405ec12fcb26b27971 23884 pptpd_1.4.0-9.debian.tar.xz
 00d6ba7d302ad068ba62faa48e1a1fcfb2bd2664f239b485eae8337ee045df5d 18292 bcrelay-dbgsym_1.4.0-9_armhf.deb
 34d224a7e1bca8dd7e3c0c7cef064b89236120c3e23050b000b031d9fb66df0f 26680 bcrelay_1.4.0-9_armhf.deb
 e34ed8381ea6088e552653a05a6d6dd6666b74d270b481bdedd10edfc4d32f38 64696 pptpd-dbgsym_1.4.0-9_armhf.deb
 144a42f01322be03b2fa1711003037346e5accab682e73a23e64eca6f98b5a67 89828 pptpd_1.4.0-9_armhf.deb
Files:
 c90c82e6785d9f95ee267d3ca274a743 1820 net optional pptpd_1.4.0-9.dsc
 f540d13efd02c24571fe9edb8101c075 23884 net optional pptpd_1.4.0-9.debian.tar.xz
 4df8545d0f5d9b1ad93ac7bcdf07befa 18292 debug extra bcrelay-dbgsym_1.4.0-9_armhf.deb
 a5f88ee4432f1427cfdd353f84476b5a 26680 net optional bcrelay_1.4.0-9_armhf.deb
 e497d4c9d2103e0dc075776e3e189ff4 64696 debug extra pptpd-dbgsym_1.4.0-9_armhf.deb
 fa5b07e2e61189998fcd3faffcf7ca6e 89828 net optional pptpd_1.4.0-9_armhf.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJXeWMIAAoJEMQsWOtZFJL9Sw4QAKkoP1tY3UYfwpLq6TMrnJS5
txZR06M4R2zdbKqirTbXen9CCZP0d3mZkDR8Of0KN55lBdmaN+b0PXbC0Z7LW1DX
lMXAFmrhWnVGisw1OnBusNdlQOyRHMw0C5VIn0gvehuyvKCQ7jSY78XXBg9pyb9H
hOhsp71dI3iEOkwG//82Rt9cA4Jpo8hSd0nLk55eLcWg4hM2NUbIm5t1LerqAY9Y
kREYKOw/cNX842/+yKGPIKK+uod9wtpE0xmOjNkPaTU9HhGkwKOTiXMGmJRCM8QB
/Ol0mA59x/32bMC/ax3EGktl2/XE3sXOXfuf8aK77AxWFTRlsrmgugaZ/N3zoaAM
T5mxLovERQG55PsyfboEPPOmWbdc2wE2FpStpvaOsx0iW+D5vxPSejJpSC8FeLFF
wRrcq5s0KVHZcYNvNlHWddfIvv7fpmDjgEg0xXCGSDwUaYR4pfg5Mr0kpd6vPSlF
t5EjLi3NoEIObRZ/nETIpZcttoVreOEIBO9xOeBJhMOK+Aa+aEkKjXcIiDt7X2Kj
CJGWY39klGDr2aQNYi9/MVdR1aySH1l6AsqrWJ1vltjAC+xPjGFxCbuHtXChz/s+
PPU0TOBRbsgHB7AO5f6dw4ArkNP/O0Gvgg+QMFjGPT3z1xIEIt2zBspe1DCaOTVy
YR464+2OYCJXCxD4fxcp
=DOzW
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 02 Aug 2016 07:28:48 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Aug 8 03:45:40 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.