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

Andreas Metzler <[email protected]> Wed, 6 Feb 2019 20:20:54 +0100
Newsgroups gmane.linux.debian.devel.lsb
Message-ID <20190206192044.GA8985__41658.2444378705$1549481064$gmane$org@argenau.bebt.de>
Package: lsb-base
Version: 10.2018112800
Severity: serious

Hello,

there is a logic error in /lib/lsb/init-functions's killproc:

base=${1##*/}
    if [ ! $pidfile ]; then
        name_param="--name $base --pidfile /var/run/$base.pid"
    else
        name_param="--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)

cu Andreas