Source: systemd
Version: 260.1-1
Usertags: pidof-without-procps

Dear maintainer(s) of systemd,

it appears that systemd uses `pidof` in its testsuite, or that
at least one of its binary packages uses `pidof` at runtime.
Historically, `pidof` was provided by the Essential package
`sysvinit-tools`, making an explicit dependency unnecessary. However
`pidof` will soon be moved to `procps` and will no longer be part of
the Essential set.

Please add an explicit dependency on `procps`:

* via the `Depends:` field of all binary packages of systemd
  that use `pidof` at runtime;
* via the `Build-Depends:` field of systemd, if `pidof` is
  used in tests run at build-time;
* via the `Depends:` field of `debian/control/tests`, if `pidof` is
  used in autopkgtests.

To prevent any disruption for users of systemd, please add
this dependency now, before `pidof` is moved from `sysvinit-utils` to
`procps`. Alternatively, you could remove all uses of `pidof`.

It is believed that systemd uses `pidof` due to the following
code snippets:

```
path: systemd_260~rc2-1/debian/tests/boot-and-services
    def test_cron(self):
        pid = subprocess.check_output(['pidof', 'cron'], 
universal_newlines=True).strip()
        out = subprocess.check_output(['ps', 'u', pid], universal_newlines=True)
        self.assertIn('root', out)


path: systemd_260~rc2-1/debian/tests/boot-and-services
                     'Forwarding to rsyslog is a Debian patch')
    def test_rsyslog(self):
        pid = subprocess.check_output(['pidof', 'rsyslogd'], 
universal_newlines=True).strip()
        out = subprocess.check_output(['ps', 'u', pid], universal_newlines=True)
        self.assertIn('bin/rsyslogd', out)


path: systemd_260~rc2-1/debian/tests/boot-smoke
    echo "checking that NetworkManager runs"
    pidof NetworkManager || fail "NetworkManager was not running"
fi


path: systemd_260~rc2-1/debian/tests/logind
    shutdown -c || true
    # logind should still be running
    P=$(pidof systemd-logind)
    [ "$P" = "$LOGINDPID" ] || { echo "logind crashed" >&2; exit 1; }


path: systemd_260~rc2-1/debian/tests/logind
    echo " * daemon is started"
    # should start at boot, not with D-BUS activation
    LOGINDPID=$(pidof systemd-logind)
    # loginctl should succeed


path: systemd_260~rc2-1/debian/tests/logind
    evemu-event $LID_DEV --sync --type 5 --code 0 --value 0
    P=$(pidof systemd-logind)
    [ "$P" = "$LOGINDPID" ] || { echo "logind crashed" >&2; exit 1; }
}


path: systemd_260~rc2-1/debian/tests/logind
    sleep 5
    shutdown -c --no-wall || true
    P=$(pidof systemd-logind)
    [ "$P" = "$LOGINDPID" ] || { echo "logind crashed" >&2; exit 1; }
}
```

Feel free to close this issue if this is a false positive (for example
if this code is in an unreachable code path).

Regards,

-- 
Gioele Barabucci

Reply via email to