[Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session
Steve Langasek
2015126 at bugs.launchpad.net
Fri Apr 21 18:09:32 UTC 2023
Ah, now, rechecking, it appears the gdm session is mostly dead:
$ systemctl status session-35.scope --no-pager -l | sed -e's/User .*/User foo/'
× session-35.scope - Session 35 of User foo
Loaded: loaded (/run/systemd/transient/session-35.scope; transient)
Transient: yes
Active: failed (Result: timeout) since Fri 2023-04-21 10:47:20 PDT; 18min ago
CPU: 2.916s
Apr 21 10:47:20 virgil /usr/libexec/gdm-x-session[15751]: (II) systemd-logind: releasing fd for 13:65
Apr 21 10:47:20 virgil /usr/libexec/gdm-x-session[15751]: (II) UnloadModule: "libinput"
Apr 21 10:47:20 virgil /usr/libexec/gdm-x-session[15751]: (II) systemd-logind: releasing fd for 13:74
Apr 21 10:47:20 virgil /usr/libexec/gdm-x-session[15751]: (II) UnloadModule: "libinput"
Apr 21 10:47:20 virgil /usr/libexec/gdm-x-session[15751]: (II) systemd-logind: releasing fd for 13:66
Apr 21 10:47:20 virgil /usr/libexec/gdm-x-session[15751]: (WW) xf86CloseConsole: KDSETMODE failed: Input/output error
Apr 21 10:47:20 virgil /usr/libexec/gdm-x-session[15751]: (WW) xf86CloseConsole: VT_GETMODE failed: Input/output error
Apr 21 10:47:20 virgil /usr/libexec/gdm-x-session[15751]: (II) Server terminated successfully (0). Closing log file.
Apr 21 10:47:20 virgil systemd[1]: session-35.scope: Failed with result 'timeout'.
Apr 21 10:47:20 virgil systemd[1]: session-35.scope: Consumed 2.916s CPU time.
$
But there are still some processes owned by the user lingering:
$ ps awxfu|grep ^x | cut -f2- -d' '
9185 0.0 0.0 18152 10956 ? Ss 09:40 0:04 /lib/systemd/systemd --user
9186 0.0 0.0 170764 4508 ? S 09:40 0:00 \_ (sd-pam)
9192 0.0 0.0 48216 6756 ? S<sl 09:40 0:00 \_ /usr/bin/pipewire
9193 0.0 0.0 32256 6428 ? Ssl 09:40 0:00 \_ /usr/bin/pipewire-media-session
17778 0.0 0.0 8436 4124 ? Ss 10:47 0:00 \_ /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
17779 0.0 0.0 471820 7440 ? Ssl 10:47 0:00 \_ /usr/libexec/xdg-document-portal
17782 0.0 0.0 244796 5416 ? Ssl 10:47 0:00 \_ /usr/libexec/xdg-permission-store
$
Seems like a bug in the session management of those processes? But the
actual gdm process is dead, as is gnome-shell.
Could it be an issue of the timer not triggering if the system is
suspended when the timeout is reached, and then resumed after?
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2015126
Title:
systemd doesn't successfully enforce RuntimeMaxSec for gnome session
Status in systemd package in Ubuntu:
Triaged
Status in systemd source package in Jammy:
Triaged
Status in systemd source package in Kinetic:
Triaged
Bug description:
On Jammy, I have configured systemd to set RuntimeMaxSec on certain
user sessions:
# cat /run/systemd/transient/session-43.scope
# This is a transient unit file, created programmatically via the systemd API. Do not edit.
[Scope]
Slice=user-1000.slice
[Unit]
Description=Session 43 of User xavier
Wants=user-runtime-dir at 1000.service
Wants=user at 1000.service
After=systemd-logind.service
After=systemd-user-sessions.service
After=user-runtime-dir at 1000.service
After=user at 1000.service
RequiresMountsFor=/home/xavier
[Scope]
SendSIGHUP=yes
TasksMax=infinity
RuntimeMaxSec=2h
#
I have verified that this does what's expected on an ssh session, and
kills the session when the runtime max has been reached.
But on a GNOME login session (using X), this apparently doesn't work:
the session is still running 17 hours after it should have been
terminated.
My guess is that systemd is ending the session by sending a signal
that is being ignored by the GNOME login session?
RuntimeMaxSec is not very useful if it's advisory...
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: systemd 249.11-0ubuntu3.7
ProcVersionSignature: Ubuntu 5.19.0-38.39~22.04.1-generic 5.19.17
Uname: Linux 5.19.0-38-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Mon Apr 3 12:20:22 2023
InstallationDate: Installed on 2023-01-22 (70 days ago)
InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809.1)
MachineType: LENOVO 2306CTO
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.19.0-38-generic root=UUID=c415e6a8-5cd2-4d08-913d-14c00b792374 ro quiet splash vt.handoff=7
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/25/2013
dmi.bios.release: 2.57
dmi.bios.vendor: LENOVO
dmi.bios.version: G2ET97WW (2.57 )
dmi.board.asset.tag: Not Available
dmi.board.name: 2306CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Defined
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.ec.firmware.release: 1.13
dmi.modalias: dmi:bvnLENOVO:bvrG2ET97WW(2.57):bd10/25/2013:br2.57:efr1.13:svnLENOVO:pn2306CTO:pvrThinkPadX230:rvnLENOVO:rn2306CTO:rvrNotDefined:cvnLENOVO:ct10:cvrNotAvailable:skuLENOVO_MT_2306:
dmi.product.family: ThinkPad X230
dmi.product.name: 2306CTO
dmi.product.sku: LENOVO_MT_2306
dmi.product.version: ThinkPad X230
dmi.sys.vendor: LENOVO
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2015126/+subscriptions
More information about the foundations-bugs
mailing list