Bug#921558: lsb-base: killproc does not pass name parameter to start-stop-daemon

Axel Beckert <[email protected]> Mon, 11 Mar 2019 21:51:18 +0100
Newsgroups gmane.linux.debian.devel.lsb
Organization The Debian Project
Message-ID <20190311205117.GX10429__13587.1429390804$1552337664$gmane$org@sym.noone.org>
--zhtSGe8h3+lMyY1M
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Control: tag -1 + patch

Hi Dmitry,

Dmitry Bogatov wrote:
> > base=3D${1##*/}
> >     if [ ! $pidfile ]; then
> >         name_param=3D"--name $base --pidfile /var/run/$base.pid"
> >     else
> >         name_param=3D"--pidfile $pidfile"
> >     fi
> >
> > The if clause checks for nonempty $pidfile instead of nonempty $base to
> > decide whether --name is used.
> >
> > Also --pidfile $pidfile is always used, even when $pidfile is empty.
> >
> > I am reportig this as serious since sid's start-stop-daemon requires a
> > name parameter in addition to --pidfile when the pidfile is not owned by
> > root, therefore this bug causes init script failures. (#921205)

#924312 was another one I filed earlier today. Just forcemerged it
into this.

> I believe it would be reasonable to add '--name $base' into `else'
> clause. Opinions?

Sounds sane, I just checked that with #924311 (miredo, uses
start-stop-daemon directly, edited the init script) as well as #924312
(stunnel4, by editing /lib/lsb/init-functions) and it worked in both
cases.

Here's the change I made to /lib/lsb/init-functions (as Dmitry already
suggested):

--- /lib/lsb/init-functions~    2018-11-28 20:21:37.000000000 +0100
+++ /lib/lsb/init-functions     2019-03-11 21:46:41.673767215 +0100
@@ -141,7 +141,7 @@
     if [ ! $pidfile ]; then
         name_param=3D"--name $base --pidfile /var/run/$base.pid"
     else
-        name_param=3D"--pidfile $pidfile"
+        name_param=3D"--name $base --pidfile $pidfile"
     fi
=20
     sig=3D$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/')

It though wouldn't hurt if e.g. Andreas could check if this change
would have fixed the issue in exim as well.

		Regards, Axel
--=20
 ,''`.  |  Axel Beckert <[email protected]>, https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE

--zhtSGe8h3+lMyY1M
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJchspFAAoJEGvmY8daNcl164UQAIQY01g24lR8UytzpdWaIw79
gUJYHSVq1Y2SpP0+grsZa7qEt0hjl0+Qgkvk/i9vyXdgTMf2bOOX5QflOcz3Nkn6
562XfSrqOH1cXeNpHWEzYkOjzWmyxa5Noi79JkAzhihE6Kz1f5eCYLiPAce3eDTz
69kJP4Td1Cgn89vS++O9qD6ndhrRdFZtBL7umgNbSxS2LSqWDcU3752ZZ3Pna1Yz
KNCvXKVz4KQfn7iJgX8rbEYQ8u8bVXEmzud6JOCHqXv8UBMDlrznveiL+B+jZbud
SpVGMc/TCl3hxr4l/j67XMq7Zk50lhFw1vHX+ovXlKfqvS1+HKKR9jpM5KUUhhwX
VACAaY9fgPQOoWLueotBEWl+Ygd+oha4iol1JJ6VWnU6SprbO7uOXBelBVvkau3H
ZBdslkeAVBgNLoWXlfEbkqCg0BhvzvaH2+vn+icMG5CN7ujX4L67hqSBTBC4Z3T5
BXV0j9zBn3lPTEeakuO6Kc6l5bzyaTrysZgWgfbd1WvaYoOTdn2LWgvGN2upiN3i
8eGxrFHuUbTLcW2PYBm5xByExzjcbNhvA/bIrmlBlu/O38pHSQBavhVvjAa6nvsT
qsx6kuBzEc+uSPtL/1qrYyBT6BzLHf3o9/mB0ZBUUMpTEjpDCMah388z5FZKE2Im
RZEbIf4lRCuM/kdSBsSV
=zDnc
-----END PGP SIGNATURE-----

--zhtSGe8h3+lMyY1M--