systemd doesn't successfully enforce RuntimeMaxSec for gnome session
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Triaged
|
Low
|
Unassigned | ||
Jammy |
Triaged
|
Low
|
Unassigned | ||
Kinetic |
Won't Fix
|
Low
|
Unassigned |
Bug Description
On Jammy, I have configured systemd to set RuntimeMaxSec on certain user sessions:
# cat /run/systemd/
# This is a transient unit file, created programmatically via the systemd API. Do not edit.
[Scope]
Slice=user-
[Unit]
Description=Session 43 of User xavier
Wants=user-
Wants=user@
After=systemd-
After=systemd-
After=user-
After=user@
RequiresMountsF
[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
ProcVersionSign
Uname: Linux 5.19.0-38-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckR
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-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
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.
dmi.board.name: 2306CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Defined
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.
dmi.ec.
dmi.modalias: dmi:bvnLENOVO:
dmi.product.family: ThinkPad X230
dmi.product.name: 2306CTO
dmi.product.sku: LENOVO_MT_2306
dmi.product.
dmi.sys.vendor: LENOVO
For reference, populating RuntimeMaxSec is done via https:/ /github. com/vorlonofpor tland/pam_ session_ timelimit; there is no existing support for this in Ubuntu today.