Devuan bug report logs - #499
Smokeping service unable to stop/restart

Package: smokeping; Reported by: ShadowM00n <shadowm00n@airmail.cc>; Keywords: debian; dated Mon, 27 Jul 2020 18:03:02 UTC; Maintainer for smokeping is (unknown).

Message received at 499@bugs.devuan.org:


Received: (at 499) by bugs.devuan.org; 28 Jul 2020 17:50:23 +0000
Return-Path: <shadowm00n@airmail.cc>
Delivered-To: devuanbugs@dyne.org
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Tue, 28 Jul 2020 17:50:23 +0000 (UTC)
Received: from mail.cock.li (mail.cock.li [37.120.193.124])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id DD292F608A2
	for <499@bugs.devuan.org>; Tue, 28 Jul 2020 19:45:08 +0200 (CEST)
Authentication-Results: vm6.ganeti.dyne.org;
	dkim=pass (2048-bit key; unprotected) header.d=airmail.cc header.i=@airmail.cc header.b="kysiRe4E";
	dkim-atps=neutral
Date: Tue, 28 Jul 2020 12:45:04 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=airmail.cc; s=mail;
	t=1595958307; bh=l04yuCcESOto6XjM9MK/wgaykejwG6s0fkM+kQ2uB7E=;
	h=Date:From:To:Subject:References:In-Reply-To:From;
	b=kysiRe4Ew7jtq7s45ES+O004BHBGgrk4p5OLFIkdg96tjfjJ8M8JpfjOSkxX7rD7Y
	 n0wCRhUSHJReonWYeBFKJe9gqyTJmUTnYf/XYkUc7WRZRgJi57fFk5tHBd3LPcruJ0
	 aoq3Q+UPktZMAFcSzblJoepcZ4viowWNlk67jGRlOyNgaRV5hh0YTe/AaMqaEOx7ZD
	 oS2ZJsDtylRh/Hgqg7WhbEpR9dgQ3CujJtMMjDIvDIbLEGfOSzec0KRk2V1Tes7My3
	 RULm3a4qCX/HpnTu5h+5N3JEjyxDcIVMtvm9JOTE7gVTUADZET31Qq1L8pKaih+vfq
	 RJpj4/kIKWzqg==
From: ShadowM00n <shadowm00n@airmail.cc>
To: Mark Hindley <mark@hindley.org.uk>, 499@bugs.devuan.org
Subject: Re: bug#499: Smokeping service unable to stop/restart
Message-ID: <20200728174504.GB4706@ascii>
References: <20200727174615.GA4706@ascii>
 <20200728100404.GZ3011@hindley.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20200728100404.GZ3011@hindley.org.uk>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,DKIM_VALID_EF,T_SPF_PERMERROR autolearn=disabled
	version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org

On 2020 Jul 28 11:04, Mark Hindley wrote:
> In Devuan this package is used directly from Debian without recompilation. In
> general for packages in that category, the bug reports should go to Debian's BTS
> to be fixed there as the bug will also be present in Debian.
> 
> Please could you report to submit@bugs.debian.org? Once you have we can add the
> forwarded bug number/URL here.

I was going to do so, but I don't think this actually affects Debian.

I wanted to be sure before filing a bug with them, so I set up two VMs, 
one with stock Buster and one with stock Beowulf, both installed from 
netinstall images and without a DE. I found that despite the init files 
being identical (confirmed with md5sum) and the versions of both 
packages being 2.7.3-2 (confirmed with dpkg -s smokeping | grep 
Version), the behaviour is not -- the service actually stops correctly 
on Debian and fails to stop on Beowulf. I took a side-by-side screenshot 
showcasing all of this for reference. I can include it if it's deemed 
useful, though I'm not sure it is beyond merely confirming what I just 
wrote.

I am now uncertain how accurate my earlier analysis was given that the 
Debian system worked without my fix. Any suggestions on what else should 
be looked at?

Acknowledgement sent to ShadowM00n <shadowm00n@airmail.cc>:
Extra info received and forwarded to list. Copy sent to devuan-dev@lists.dyne.org. Full text available.
Information forwarded to devuan-bugs@lists.dyne.org, devuan-dev@lists.dyne.org:
bug#499; Package smokeping. Full text available.
Added tag(s) debian. Request was from Mark Hindley <mark@hindley.org.uk> to 499-submit@bugs.devuan.org. Full text available.

Message received at 499@bugs.devuan.org:


Received: (at 499) by bugs.devuan.org; 28 Jul 2020 10:10:06 +0000
Return-Path: <mark@hindley.org.uk>
Delivered-To: devuanbugs@dyne.org
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Tue, 28 Jul 2020 10:10:06 +0000 (UTC)
Received: from mx.hindley.org.uk (mohindley.plus.com [81.174.245.179])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 8F775F60ACD
	for <499@bugs.devuan.org>; Tue, 28 Jul 2020 12:04:07 +0200 (CEST)
Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk)
	by mx.hindley.org.uk with smtp (Exim 4.84_2)
	(envelope-from <mark@hindley.org.uk>)
	id 1k0MSr-0002te-Ac; Tue, 28 Jul 2020 11:04:05 +0100
Received: (nullmailer pid 21383 invoked by uid 1000);
	Tue, 28 Jul 2020 10:04:04 -0000
Date: Tue, 28 Jul 2020 11:04:04 +0100
From: Mark Hindley <mark@hindley.org.uk>
To: ShadowM00n <shadowm00n@airmail.cc>, 499@bugs.devuan.org
Subject: Re: bug#499: Smokeping service unable to stop/restart
Message-ID: <20200728100404.GZ3011@hindley.org.uk>
References: <20200727174615.GA4706@ascii>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20200727174615.GA4706@ascii>
X-Debbugs-No-Ack: No Thanks
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_PASS autolearn=disabled
	version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org

Control: tags -1 debian

On Mon, Jul 27, 2020 at 12:46:15PM -0500, ShadowM00n wrote:
> Package: smokeping
> Version: 2.7.3-2
> 
> First-time submitter, so please excuse and correct me on any procedural 
> errors on my part.

Thanks for taking the time to report this.

> Basically, the current version of smokeping's init service quietly fails 
> to stop smokeping, and then subsequently fails to restart it because the 
> process is still running.
> 
> My understanding is that between ASCII and Beowulf the service was 
> altered in an attempt to improve security. In ASCII, it checked only 
> that a process with a saved PID existed; in Beowulf it also tries to 
> compare the invocation string to the program string in the process list. 

Your analysis seems resonable.

In Devuan this package is used directly from Debian without recompilation. In
general for packages in that category, the bug reports should go to Debian's BTS
to be fixed there as the bug will also be present in Debian.

Please could you report to submit@bugs.debian.org? Once you have we can add the
forwarded bug number/URL here.

Thanks.

Mark


Information forwarded to devuan-bugs@lists.dyne.org, devuan-dev@lists.dyne.org:
bug#499; Package smokeping. Full text available.

Message received at submit@bugs.devuan.org:


Received: (at submit) by bugs.devuan.org; 27 Jul 2020 17:50:18 +0000
Return-Path: <shadowm00n@airmail.cc>
Delivered-To: devuanbugs@dyne.org
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Mon, 27 Jul 2020 17:50:18 +0000 (UTC)
Received: from mail.cock.li (mail.cock.li [37.120.193.124])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 5FA7EF608B8
	for <submit@bugs.devuan.org>; Mon, 27 Jul 2020 19:46:20 +0200 (CEST)
Authentication-Results: vm6.ganeti.dyne.org;
	dkim=pass (2048-bit key; unprotected) header.d=airmail.cc header.i=@airmail.cc header.b="KIx6btfe";
	dkim-atps=neutral
Date: Mon, 27 Jul 2020 12:46:15 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=airmail.cc; s=mail;
	t=1595871979; bh=/l9h17mopLlsaou9ThJoHJf7d1uMRncnU/SqL+KEzck=;
	h=Date:From:To:Subject:From;
	b=KIx6btfe+Rj+VSNJWdgRyazoKyLMcyjYqhGHK96d1CF7pXHfLzlgzxh1PK0i6of2S
	 2AyeXizettEDAJ5jrEJRF1yxatW+eVQSLX9QqGm48HXGfmX9al6nyWDDG3iAaXR0XU
	 WE2Ypbsf7wElUeaFBcUtalZDsvdXP4XmBP0U9UR1eEf7hdUb0HrfG4ouasIfhvH9eK
	 haS/ps5cWEHtAbFMTGdCUEAY71f6S7w6MvL7Vy5nHKPAVJ9iTR09eE1NPcnCiN9tD/
	 cHyjE4zxhGO4Vq16yA4Q1PdqqHbO8wdj3A2ecSwuXMw31CzbAut9D12+RzU9N0qj4/
	 qmMRey2z0QXXg==
From: ShadowM00n <shadowm00n@airmail.cc>
To: submit@bugs.devuan.org
Subject: Smokeping service unable to stop/restart
Message-ID: <20200727174615.GA4706@ascii>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,DKIM_VALID_EF,T_SPF_PERMERROR autolearn=disabled
	version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org

Package: smokeping
Version: 2.7.3-2

First-time submitter, so please excuse and correct me on any procedural 
errors on my part.

Basically, the current version of smokeping's init service quietly fails 
to stop smokeping, and then subsequently fails to restart it because the 
process is still running.

My understanding is that between ASCII and Beowulf the service was 
altered in an attempt to improve security. In ASCII, it checked only 
that a process with a saved PID existed; in Beowulf it also tries to 
compare the invocation string to the program string in the process list. 

While this seems a reasonable idea for most daemons, smokeping seems to 
be a bit of an exception -- it runs under an interpreter (perl), and as 
such the stored PID refers to the perl process launching it; naturally, 
the process string differs from the invocation, being e.g.
"/usr/bin/perl /usr/sbin/smokeping --config=/etc/smokeping/config" while 
being launched as "/usr/sbin/smokeping --config=/etc/smokeping/config".

Given this complication, my current personal setup, and my suggestion, 
is to instead check the owner of the process against the $DAEMON_USER 
when stopping, as this is configured to be a package-specific user 
called "smokeping":

< start-stop-daemon --oknodo --stop --retry 3 --quiet --pidfile $PIDFILE --exec $DAEMON --signal 15
> start-stop-daemon --oknodo --stop --retry 3 --quiet --pidfile $PIDFILE --user $DAEMON_USER --signal 15

This seems to work well for me, though I would certainly not be opposed 
to any other working method if this is less than ideal for some reason.

Acknowledgement sent to ShadowM00n <shadowm00n@airmail.cc>:
New bug report received and forwarded. Copy sent to devuan-dev@lists.dyne.org. Full text available.
Report forwarded to devuan-bugs@lists.dyne.org, devuan-dev@lists.dyne.org:
bug#499; Package smokeping. Full text available.

Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Thu, 19 May 2022 10:39:02 UTC