Bug#916122: pbuilder: misleading warning about missing cgroups

2026-08-07 Thread Thorsten Glaser
Package: pbuilder
Version: 0.231.1
Followup-For: Bug #916122
X-Debbugs-Cc: [email protected]

Same here, I got a new fat yellow warning about cgroups not being
available which REALLY stands out…

… after I went through considerable pain to make cgroups available
so podman+crun can work.

My suggestion for this is:

1. in /usr/share/pbuilder/pbuilderrc change
-USECGROUP=yes
+USECGROUP=default

2. in /usr/lib/pbuilder/pbuilder-checkparams, before line…

391 if [ "$USECGROUP" = "yes" ]; then

… add this:

if [ "$USECGROUP" = "default" ]; then
if test -d /run/systemd/system && \
command -v systemctl >/dev/null 2>&1; then
USECGROUP=yes
else
# cgroups currently are only supported in
# pbuilder for systemd so quietly disable
USECGROUP=no
fi
fi

… and further below, change…

else
log.w "cgroups are not available on the host, not using them."
USECGROUP=not-available
fi

… to this (for when someone does not set =default):

elif test -d /run/systemd/system && \
command -v systemctl >/dev/null 2>&1; then
log.w "cgroups are not available on the host, not using them."
USECGROUP=not-available
else
log.i "cgroups currently only supported with systemd, 
disabling."
USECGROUP=not-available
fi

(note, untested)



-- System Information:
Debian Release: 13.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.100+deb13-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages pbuilder depends on:
ii  debconf [debconf-2.0]  1.5.91
ii  debootstrap1.0.141
ii  dpkg-dev   1.22.22
ii  mount  2.41-5

Versions of packages pbuilder recommends:
ii  devscripts  2.25.15+deb13u1
ii  eatmydata   131-2
ii  fakeroot1.37.1.1-1
ii  iproute26.15.0-1
ii  net-tools   2.10-1.3
ii  sudo1.9.16p2-3+deb13u2

Versions of packages pbuilder suggests:
ii  cowdancer   0.90
pn  gdebi-core  

-- Configuration Files:
/etc/pbuilder/buildd-config.sh [file not found]

-- debconf information:
* pbuilder/nomirror:
* pbuilder/mirrorsite: nein
  pbuilder/rewrite: false


Bug#916122: pbuilder: misleading warning about missing cgroups

2024-01-10 Thread Jürgen Kuri
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  
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,
 >

Bug#916122: pbuilder: misleading warning about missing cgroups

2019-01-07 Thread Yves-Alexis Perez
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

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
SUBDESCRIPTION   
● mnt-scapa\x2dbackup.mount loaded failed failed /mnt/scapa-backup   

(this is my external backup drive). Thanks for the tip anyway.

Regards,
- -- 
Yves-Alexis
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE8vi34Qgfo83x35gF3rYcyPpXRFsFAlwzhc0ACgkQ3rYcyPpX
RFuiyAgA1uNqzXQbZPhU0vA3hQXX5FuwzspFloppHfvFq4JB35Z0ZnXmpb94uUZs
z8ikmMaz8cZRbq2cC/F4bLILrvSYev7mcWEb/N7FoiHfZL3r+Rp/lLwytbKQfqk4
WOY3qorpMaHewUHVLFAA/AsleMHbkkXNeqnQRCU3u1W0LclDDqgvRufTWtC9NiSt
NfT2aNROyjpob9Cnkdl+kAURkC9IaeDn8bJKmreAmHWHMsfNvOm02XpB2As/jQPz
r9SVBtdiM33MZ33R/3EZ300rJQ694FZ3QaDtmw0cLsCCSA62EVhWOGJFxMedpjG1
qXpTjvtGXhDepI9R2Kp8LcEild4ssw==
=LTmk
-END PGP SIGNATURE-



Bug#916122: pbuilder: misleading warning about missing cgroups

2019-01-07 Thread Mattia Rizzolo
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`.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#916122: pbuilder: misleading warning about missing cgroups

2019-01-06 Thread Yves-Alexis Perez
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Mon, 10 Dec 2018 12:22:09 +0100 Reiner Herrmann  wrote:
> Source: pbuilder
> Version: 0.230.1
> Severity: minor
> 
> Dear maintainer,
> 
> I noticed that pbuilder prints a warning at the beginning of each build
> that cgroups are not available:
> 
> > W: cgroups are not available on the host, not using them.
> 
> But they actually are available on my system:
> 
> # grep cgroup /proc/mounts
> cgroup /sys/fs/cgroup cgroup
rw,relatime,cpuset,cpu,cpuacct,blkio,memory,devices,freezer,net_cls,perf_event
,net_prio,pids 0 0
> 
> pbuilder assumes that cgroup support is only available on systems with
systemd.
> But they can also be used with some basic file system operations in the
cgroup
> mount point.
> 
> Please change the warning message to something like:
> "W: cgroup support is currenly only implemented for hosts running systemd"
> 
> (Or instead add cgroup support independent of systemd (and change
> severity to wishlist) ;) )

Also, I also have the message while I *am* using systemd as init system.

Regards.
- -- 
Yves-Alexis
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE8vi34Qgfo83x35gF3rYcyPpXRFsFAlwx3KcACgkQ3rYcyPpX
RFv5AggAzy7e0sAhQDiw7RH07HxJNPvA9btl5aQPE2klt/t77n367jMRgwHa2dfS
5MDlSqA+MKc9Ahfk+qUopxEDlGLv5XTabgKtcXXgMAWxkCBeDIjSd34c0wJPcYWu
EYKjvDczLx4hzfi3U5wPy28wcZEyLdUeYkShvrUtb55ZIEgdIqSubGpxFzhnACG+
gjuDwgpOCHDFH7+pl7UHFIzRG2tnli9EMZUCmMCz+UgDOuhaX65EgQD3wztJSswC
xl1GlDceTcbCR6K2qJrJUo9jJ7rUHpDgvpvdUV5i2ZeGMFxDutH895rSzb3X/1DT
TErSSjvFnneEcYa/dXDSkZ9oppwFvw==
=WpOg
-END PGP SIGNATURE-



Bug#916122: pbuilder: misleading warning about missing cgroups

2018-12-10 Thread Reiner Herrmann
Source: pbuilder
Version: 0.230.1
Severity: minor

Dear maintainer,

I noticed that pbuilder prints a warning at the beginning of each build
that cgroups are not available:

> W: cgroups are not available on the host, not using them.

But they actually are available on my system:

# grep cgroup /proc/mounts
cgroup /sys/fs/cgroup cgroup 
rw,relatime,cpuset,cpu,cpuacct,blkio,memory,devices,freezer,net_cls,perf_event,net_prio,pids
 0 0

pbuilder assumes that cgroup support is only available on systems with systemd.
But they can also be used with some basic file system operations in the cgroup
mount point.

Please change the warning message to something like:
"W: cgroup support is currenly only implemented for hosts running systemd"

(Or instead add cgroup support independent of systemd (and change
severity to wishlist) ;) )

Kind regards,
  Reiner


signature.asc
Description: PGP signature