Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-05-29 Thread Thilo Six
Hello Andreas,
Hello Simon,

Andreas Metzler schrieb/wrote:
> Control: reopen -1
> Control: severity -1 serious
> 
> On 2016-04-30 Thilo Six  wrote:
>> --  --
> 
>>> Conditions we want to track:
>>> * installation state of deb 'dnsmasq', better yet:
>>>   deb 'dnsmasq' = removed (not purged)
>>>   deb 'dnsmasq-base'= installed
>>> * better not use '/etc/dnsmasq.d/README' as flag for that as it could be 
>>> erased
>>>   by local admin for what ever reason (a README, is a README...)
>>>
>>> The attached patch has been successfully tested to meet this conditions.
>>> Additionally this patch fixes syntax highlighting of the init script in Vim.
> 
>> minor patch update. I added a reference to #819856 in the comments.
> [...]
>> -test -e /etc/dnsmasq.d/README || exit 0
>> +# The following test ensures the dnsmasq service is not started, when the
>> +# package 'dnsmasq' is removed but not purged:
>> +# https://bugs.debian.org/819856
>> +test -d /usr/share/doc/dnsmasq || exit 0
> [...]
> 
> Checking for /usr/share/doc/dnsmasq is the wrong fix, it violates
> policy 12.3.
> | Packages must not require the existence of any files in
> | `/usr/share/doc/' in order to function [1].
> | [...]
> | [1]  The system administrator should be able to delete files in
> |  `/usr/share/doc/' without causing any programs to break.


Thank you Andreas for the heads up. Obviously i have not been aware of this.

@Simon:
I tested this patch successfully to meet all currently known conditions:

-test -d /usr/share/doc/dnsmasq || exit 0
+test -e /usr/lib/resolvconf/dpkg-event.d/dnsmasq || exit 0


kind regards,

 Thilo



Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-05-29 Thread Andreas Metzler
Control: reopen -1
Control: severity -1 serious

On 2016-04-30 Thilo Six  wrote:
> --  --

> > Conditions we want to track:
> > * installation state of deb 'dnsmasq', better yet:
> >   deb 'dnsmasq' = removed (not purged)
> >   deb 'dnsmasq-base'= installed
> > * better not use '/etc/dnsmasq.d/README' as flag for that as it could be 
> > erased
> >   by local admin for what ever reason (a README, is a README...)
> > 
> > The attached patch has been successfully tested to meet this conditions.
> > Additionally this patch fixes syntax highlighting of the init script in Vim.

> minor patch update. I added a reference to #819856 in the comments.
[...]
> -test -e /etc/dnsmasq.d/README || exit 0
> +# The following test ensures the dnsmasq service is not started, when the
> +# package 'dnsmasq' is removed but not purged:
> +# https://bugs.debian.org/819856
> +test -d /usr/share/doc/dnsmasq || exit 0
[...]

Checking for /usr/share/doc/dnsmasq is the wrong fix, it violates
policy 12.3.
| Packages must not require the existence of any files in
| `/usr/share/doc/' in order to function [1].
| [...]
| [1]  The system administrator should be able to delete files in
|  `/usr/share/doc/' without causing any programs to break.

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'



Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-04-30 Thread Thilo Six
--  --

> Conditions we want to track:
> * installation state of deb 'dnsmasq', better yet:
>   deb 'dnsmasq'   = removed (not purged)
>   deb 'dnsmasq-base'  = installed
> * better not use '/etc/dnsmasq.d/README' as flag for that as it could be 
> erased
>   by local admin for what ever reason (a README, is a README...)
> 
> The attached patch has been successfully tested to meet this conditions.
> Additionally this patch fixes syntax highlighting of the init script in Vim.

minor patch update. I added a reference to #819856 in the comments.


kind regards,

 Thilo

--- etc-init.d-dnsmasq.orig	2016-04-30 15:36:51.189052127 +
+++ etc-init.d-dnsmasq	2016-04-30 15:48:22.261632156 +
@@ -7,9 +7,10 @@
 # Default-Stop:   0 1 6
 # Description:DHCP and DNS server
 ### END INIT INFO
 
-set +e   # Don't exit on error status
+# Don't exit on error status
+set +e
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/sbin/dnsmasq
 NAME=dnsmasq
@@ -28,13 +29,12 @@
 . /etc/default/locale
 export LANG
 fi
 
-# /etc/dnsmasq.d/README is a non-conffile installed by the dnsmasq package.
-# Should the dnsmasq package be removed, the following test ensures that
-# the daemon is no longer started, even if the dnsmasq-base package is
-# still in place.
-test -e /etc/dnsmasq.d/README || exit 0
+# The following test ensures the dnsmasq service is not started, when the
+# package 'dnsmasq' is removed but not purged:
+# https://bugs.debian.org/819856
+test -d /usr/share/doc/dnsmasq || exit 0
 
 test -x $DAEMON || exit 0
 
 # Provide skeleton LSB log functions for backports which don't have LSB functions.


Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-04-30 Thread Thilo Six
Thilo Six schrieb/wrote:

--  --

>>> for the purpose you described this line can be dropped completely IMHO.
>>> The following line in the init script already has:
>>>
>>> test -x $DAEMON || exit 0

--  --

>> The problem that this code is trying to solve is the case when both
>> packages are installed, then just dnsmasq is removed. At this point
>> dnsmasq should not be started at boot time, but the binary still exists
>> (since dnsmasq-base is still installed.)
>>
>> That explains why the code looks at /etc/dnsmasq.d/README since that's
>> installed by the dnsmasq package and isn't a conffile. SO when the
>> dnsmasq package is removed /etc/dnsmasq.d/README is removed.

Conditions we want to track:
* installation state of deb 'dnsmasq', better yet:
  deb 'dnsmasq' = removed (not purged)
  deb 'dnsmasq-base'= installed
* better not use '/etc/dnsmasq.d/README' as flag for that as it could be erased
  by local admin for what ever reason (a README, is a README...)

The attached patch has been successfully tested to meet this conditions.
Additionally this patch fixes syntax highlighting of the init script in Vim.


kind regards,

 Thilo
--- etc-init.d-dnsmasq.orig	2016-04-30 15:36:51.189052127 +
+++ etc-init.d-dnsmasq	2016-04-30 15:35:36.451688365 +
@@ -7,9 +7,10 @@
 # Default-Stop:   0 1 6
 # Description:DHCP and DNS server
 ### END INIT INFO
 
-set +e   # Don't exit on error status
+# Don't exit on error status
+set +e
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/sbin/dnsmasq
 NAME=dnsmasq
@@ -28,13 +29,11 @@
 . /etc/default/locale
 export LANG
 fi
 
-# /etc/dnsmasq.d/README is a non-conffile installed by the dnsmasq package.
-# Should the dnsmasq package be removed, the following test ensures that
-# the daemon is no longer started, even if the dnsmasq-base package is
-# still in place.
-test -e /etc/dnsmasq.d/README || exit 0
+# The following test ensures the dnsmasq service is not started, when the
+# package 'dnsmasq' is removed but not purged:
+test -d /usr/share/doc/dnsmasq || exit 0
 
 test -x $DAEMON || exit 0
 
 # Provide skeleton LSB log functions for backports which don't have LSB functions.


Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-04-25 Thread Thilo Six
Hello Simon,

Simon Kelley schrieb/wrote:
--  --
>> for the purpose you described this line can be dropped completely IMHO.
>> The following line in the init script already has:
>>
>> test -x $DAEMON || exit 0

--  --
> 
> It's not that simple, unfortunately. There are actually _two_ dnsmasq
> packages, dnsmasq, and dnsmasq-base. Dnsmasq-base provides the binary
> and documentation, and is depended on by various things like
> networkmanager. The dnsmasq package provides the system-started daemon.
> 
> The problem that this code is trying to solve is the case when both
> packages are installed, then just dnsmasq is removed. At this point
> dnsmasq should not be started at boot time, but the binary still exists
> (since dnsmasq-base is still installed.)
> 
> That explains why the code looks at /etc/dnsmasq.d/README since that's
> installed by the dnsmasq package and isn't a conffile. SO when the
> dnsmasq package is removed /etc/dnsmasq.d/README is removed.
> 
> Any suggestions for a cleaner approach gratefully accepted..

I see. This is more involved then i had anticipated.
I will look at that, not sure if i can up with s.th. better though.

Thanks for your reply.



kind regards,

 Thilo



Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-04-25 Thread Simon Kelley
On 04/04/16 17:13, Thilo Six wrote:
> Simon Kelley schrieb/wrote:
>>
>> The following code in /etc/init.d/dnsmasq is responsible for this
>> behaviour.
>>
>> # /etc/dnsmasq.d/README is a non-conffile installed by the dnsmasq
>> package.
>> # Should the dnsmasq package be removed, the following test ensures that
>> # the daemon is no longer started, even if the dnsmasq-base package is
>> # still in place.
>> test -e /etc/dnsmasq.d/README || exit 0
> 
> for the purpose you described this line can be dropped completely IMHO.
> The following line in the init script already has:
> 
> test -x $DAEMON || exit 0
> 
> so when the dnsmasq package is removed but not purged the init script already
> exits zero.
> 
> 
> 
> kind regards,
> 
>  Thilo
> 

It's not that simple, unfortunately. There are actually _two_ dnsmasq
packages, dnsmasq, and dnsmasq-base. Dnsmasq-base provides the binary
and documentation, and is depended on by various things like
networkmanager. The dnsmasq package provides the system-started daemon.

The problem that this code is trying to solve is the case when both
packages are installed, then just dnsmasq is removed. At this point
dnsmasq should not be started at boot time, but the binary still exists
(since dnsmasq-base is still installed.)

That explains why the code looks at /etc/dnsmasq.d/README since that's
installed by the dnsmasq package and isn't a conffile. SO when the
dnsmasq package is removed /etc/dnsmasq.d/README is removed.

Any suggestions for a cleaner approach gratefully accepted..



Cheers,

Simon.



0xE19135A2.asc
Description: application/pgp-keys


Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-04-04 Thread Thilo Six
Simon Kelley schrieb/wrote:
> 
> The following code in /etc/init.d/dnsmasq is responsible for this
> behaviour.
> 
> # /etc/dnsmasq.d/README is a non-conffile installed by the dnsmasq
> package.
> # Should the dnsmasq package be removed, the following test ensures that
> # the daemon is no longer started, even if the dnsmasq-base package is
> # still in place.
> test -e /etc/dnsmasq.d/README || exit 0

for the purpose you described this line can be dropped completely IMHO.
The following line in the init script already has:

test -x $DAEMON || exit 0

so when the dnsmasq package is removed but not purged the init script already
exits zero.



kind regards,

 Thilo



Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-04-04 Thread Simon Kelley
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256


The following code in /etc/init.d/dnsmasq is responsible for this
behaviour.

# /etc/dnsmasq.d/README is a non-conffile installed by the dnsmasq
package.
# Should the dnsmasq package be removed, the following test ensures that
# the daemon is no longer started, even if the dnsmasq-base package is
# still in place.
test -e /etc/dnsmasq.d/README || exit 0

The reason it's there is to stop the dnsmasq-base package from
automatically starting dnsmasq if it has been removed. The binary for
the daemon in in another package (dnsmasq-base) and
/etc/init.d/dnsmasq is a conffile so will not be removed when the
dnsmasq package is removed.

Maybe there should be a comment in the file to this effect, or even
another file should be used.


Cheers,

Simon.




On 03/04/16 07:22, Thilo Six wrote:
> Package: dnsmasq Version: 2.75-1 Severity: normal
> 
> Hello Simon,
> 
> by mistake i found that removing the file /etc/dnsmasq.d/README
> prevents dnsmasq from starting. systemd says rough vaguely: -<
> -< -< -< -< -< -< -< -< -< Job
> for dnsmasq.service failed because a configured resource limit was
> exceeded. See "systemctl status dnsmasq.service" and "journalctl
> -xe" for details. -< -< -< -< -< -< -<
> -< -< -<
> 
> touching /etc/dnsmasq.d/README then and all is fine again.
> 
> 
> 
> kind regards,
> 
> Thilo
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJXAolaAAoJEBXN2mrhkTWiKkYP/i9PuGtkQ5FIaxBG10f5U2dO
K+YGbLC8G23yZeve04MKpUx0g07Sn1+kNiEgpbIFw5ozmYywrrjF7bdM5YjQMlh4
YS5Zgkfj3yg7yj0bWh+UznPvHf8Xu3SzUrlpax3Sfd7GtmnT6ENNUegKsp5CE1nG
jRgdTf72ZVTq63W/ga3FnQPJHO0+KHbWKVvUf8X7S0peRfCsH3M+ODwRCcRvHAJx
qz6qUHuMYpySVS/A/0PJFMAtuQTYaNEcI3A1thMpPfLV6hmYmzQwIsnAP0xOpL2Z
sCtCQiv85QfroU2CJArpGLu6WfDd3ip4rn0/VIm4hbWWCNHbk0XtMbV/P3yRYIxW
fQfeohpNhtQznkcsF6jMPN+a1WUq6XwX7X0KW70UEybAPmmIR8uphWRyG1UtwfHI
Jf2Im6Nx5e8nRlUJ3NHOXhJId9U4nqTYzDUwYwm4e5IiH9WGTKlKSi7zNmjVjOQO
pslHAn6UYZB1iM7PlNyC6M8z5kK0Je77lnZoFpBJJ80WmsbYhq7vwFCFhg5V06R/
h2XK5XvO5N75d+zZ7AmEKpb13LVXhj+eonTRvDdXaY2Nsm85T5HH+/NY6K0oVNuA
tqjG4QkYJ8zqO9xo7djHajKCc08Wqy/aFDAf5YvfR5Kz33o1ZWydw/x8bC8IUOzG
+rwEo3c7Hn20gNkNhPj/
=7TPW
-END PGP SIGNATURE-



Bug#819856: dnsmasq: removing /etc/dnsmasq.d/README prevents dnsmasw from starting

2016-04-03 Thread Thilo Six
Package: dnsmasq
Version: 2.75-1
Severity: normal

Hello Simon,

by mistake i found that removing the file /etc/dnsmasq.d/README prevents dnsmasq
from starting. systemd says rough vaguely:
-< -< -< -< -< -< -< -< -< -<
Job for dnsmasq.service failed because a configured resource limit was exceeded.
See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
-< -< -< -< -< -< -< -< -< -<

touching /etc/dnsmasq.d/README then and all is fine again.



kind regards,

 Thilo


-- System Information:
Debian Release: stretch/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing-proposed-updates'), (500,
'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dnsmasq depends on:
ii  dnsmasq-base 2.75-1
ii  init-system-helpers  1.29
ii  netbase  5.3

dnsmasq recommends no packages.

Versions of packages dnsmasq suggests:
ii  resolvconf  1.78

-- Configuration Files:
/etc/default/dnsmasq changed [not included]

-- no debconf information

-- debsums errors found:
debsums: changed file /etc/dnsmasq.d/README (from dnsmasq package)