We still have pbuilder version 0.231 for current Debian OS 12 (Bookworm)
and warning message about not using cgroups is still shown.
It is in shell script file "/usr/lib/pbuilder/pbuilder-checkparams":
1) The check in line 398 "systemctl is-system-running --quiet >/dev/null
2>&1" returns with shell exit code 1 which must 0 and if-condition using
cgroups is never fulfilled.
2) Semantically, the if-condition in line 398 and 394 does not work
anymore for newer bash releases
391 if [ "$USECGROUP" = "yes" ]; then
392 # v215 is required for systemd-escape
393 if systemctl is-system-running --quiet >/dev/null 2>&1 && \
394 dpkg --compare-versions "$(dpkg-query -W
--showformat='${Version}' systemd)" gt 215; then
395 # --description uses that no-spaces string because the
quoting sucks
396 # right now, and it would end up trying to execute
$PBUILDER_OPERATION…
397 # long-term solution is to turn $CHROOTEXEC into a
command and properly
398 # use arrays instead of plain strings.
399
SYSTEMD_SLICE="system-pbuilder-${PBUILDER_OPERATION}${1:+-"$(systemd-escape "$(basename "$1" .dsc)")"}-$$.slice"
400 systemctl_run=(
401 systemd-run
402 --quiet
403 --scope
404
--description="pbuilder_${PBUILDER_OPERATION}${1:+_"$(basename "$1")"}"
405 --slice="$SYSTEMD_SLICE"
406 )
407 CHROOTEXEC="${systemctl_run[*]} $CHROOTEXEC"
408 else
409 log.w "cgroups are not available on the host, not using
them."
410 USECGROUP=not-available
411 fi
I changed the code in this way from line 393 until 395:
391 if [ "$USECGROUP" = "yes" ]; then
392 # v215 is required for systemd-escape
393 _systemd_ver=$(systemd --version | grep 'systemd' | sed -r
's/(^systemd[[:blank:]]+)([0-9]{3})(.*$)/\2/')
394
395 if [[ ${_systemd_ver} -gt 215 ]] ; then
396 # --description uses that no-spaces string because the
quoting sucks
397 # right now, and it would end up trying to execute
$PBUILDER_OPERATION…
398 # long-term solution is to turn $CHROOTEXEC into a
command and properly
399 # use arrays instead of plain strings.
400
SYSTEMD_SLICE="system-pbuilder-${PBUILDER_OPERATION}${1:+-"$(systemd-escape "$(basename "$1" .dsc)")"}-$$.slice"
401 systemctl_run=(
402 systemd-run
403 --quiet
404 --scope
405
--description="pbuilder_${PBUILDER_OPERATION}${1:+_"$(basename "$1")"}"
406 --slice="$SYSTEMD_SLICE"
407 )
408 CHROOTEXEC="${systemctl_run[*]} $CHROOTEXEC"
409 else
410 log.w "cgroups are not available on the host, not using
them."
411 USECGROUP=not-available
412 fi
1) Problematic check if systemd is running was eliminated, it was
introduced with Debian 8, long time ago. So systemd is status quo!
2) The evaluation of the systemd version is done in line 393 using the
"systemd --version" command
3) Line 395, simplified expression in if-clause, executing shell
commands in clause will/may not work anymore like in my case
On Mon, 07 Jan 2019 18:01:01 +0100 Yves-Alexis Perez <cor...@debian.org>
wrote:
On Mon, 2019-01-07 at 16:03 +0100, Mattia Rizzolo wrote:
> On Sun, Jan 06, 2019 at 11:47:03AM +0100, Yves-Alexis Perez wrote:
> > Also, I also have the message while I *am* using systemd as init
system.
> Most likely that's a different issue, filed as #917354
> Check your system with `systemctl list-units --failed`.
Indeed, my system is basically half the time in degraded mode:
root@scapa:~# systemctl is-system-running
degraded
root@scapa:~# echo $?
1
root@scapa:~# systemctl --failed
UNIT LOAD ACTIVE
SUB DESCRIPTION
● mnt-scapa\x2dbackup.mount loaded failed failed /mnt/scapa-backup
(this is my external backup drive). Thanks for the tip anyway.
Regards,
>