Package: pbuilder
Version: 0.230.1
Severity: normal

The current approach that pbuilder takes to check if it is running on a
machine with systemd as the init system is not fully reliable.

Consider this:

rrs@chutzpah:~/Trans/foo$ systemctl is-system-running
degraded
19:22 ♒♒♒    ☹  => 1  
rrs@chutzpah:~/Trans/foo$ systemctl --failed
  UNIT                     LOAD   ACTIVE SUB    DESCRIPTION                     
                                                                 
● systemd-networkd.service loaded failed failed Network Service                 
                                                                 
● virtualbox.service       loaded failed failed LSB: VirtualBox Linux kernel 
module                                                              
● systemd-networkd.socket  loaded failed failed Network Service Netlink Socket  
                                                                 

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.      
                                                                 
SUB    = The low-level unit activation state, values depend on unit type.       
                                                                 

3 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
19:23 ♒♒♒   ☺    
rrs@chutzpah:~/Trans/foo$


So, ideally, the machine shouldn't be in degraded mode. But as far as
pbuilder's cgroup support is concerned, I don't see systemd's this degraded
mode (like this case, for example) is going to affect it.

Since, pbuilder is only needing to check if it is running on a machine
with systemd enabled and effective, maybe a different approach could be
used ?

I haven't checked lately, but for laptop-mode-tools, I have been using
the following:

if [ -d /run/systemd/system ] && [ x$1 = xauto ]; then
        [ -z $LMT_DEBUG ] || echo "systemd is $PPID $$ $@" > $LMT_DEBUG
        exec systemctl --no-block reload-or-restart laptop-mode
else
        # Under sysvinit/upstart, we need to fork as we start the long-running
        # /usr/sbin/laptop_mode process.
        #
        # Also, if this happens during boot, we may want to wait until /usr is 
available
        #
        # On newer systemd/udev (232-3 over here), the behavior has changed in 
my tests.
        # Now, it'll immediately and quietly kill the process that is 
backgrounded
        # systemd is nice, but I hate when it tries to become a magician
        #
        # This stanza will also be called for device plug/unplug events

        exec > /dev/null 2>/dev/null
        non_systemd_way "$@"
        [ -z $LMT_DEBUG ] || echo "regulard is $PPID $$ $@" > $LMT_DEBUG
fi

You can find the full file here:
https://sources.debian.org/src/laptop-mode-tools/1.72-3/etc/rules/lmt-udev/#L40



-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages pbuilder depends on:
ii  debconf [debconf-2.0]  1.5.69
ii  debootstrap            1.0.111
ii  dpkg-dev               1.19.2

Versions of packages pbuilder recommends:
ii  devscripts  2.18.10
ii  eatmydata   105-7
ii  fakeroot    1.23-1
ii  iproute2    4.18.0-2
ii  net-tools   1.60+git20180626.aebd88e-1
ii  sudo        1.8.26-2

Versions of packages pbuilder suggests:
pn  cowdancer   <none>
ii  gdebi-core  0.9.5.7+nmu2

-- debconf information:
  pbuilder/rewrite: false
  pbuilder/mirrorsite: http://security.debian.org/debian-security
  pbuilder/nomirror:

Reply via email to