[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-21 Thread Nick Rosbrook
Okay, so internally systemd is using CLOCK_MONOTONIC for the event source that counts up to RuntimeMaxSec, and CLOCK_MONOTONIC does not count the time when the system is suspended. Your use case wants CLOCK_BOOTTIME, which does count time when the system is suspended. I will work on a fix for

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-21 Thread Nick Rosbrook
Thanks, that is very helpful. I tested this for service units too, and got the same result: $ systemd-run -u test-1.service -p RuntimeMaxSec=1m /usr/bin/bash -c 'while true; do sleep 1; done' $ systemctl suspend # Waited a bit... After resume: $ systemctl status test-1.service ● test-1.service

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-21 Thread Steve Langasek
The session did eventually exit: Active: failed (Result: timeout) since Fri 2023-04-21 11:24:31 PDT; 2min 48s ago However, the time while the system was suspended didn't count towards the session limit. This kind of makes sense, but is also at odds with my goal of also using pam_time to

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-21 Thread Steve Langasek
ok, reproduced the failure - if the system is suspended at the session expiry, the session apparently is never closed. Active: active (running) since Fri 2023-04-21 11:13:02 PDT; 7min ago RuntimeMaxUSec=5min -- You received this bug notification because you are a member of Ubuntu Touch

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-21 Thread Steve Langasek
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

Re: [Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-21 Thread Steve Langasek
On Fri, Apr 21, 2023 at 03:57:58PM -, Nick Rosbrook wrote: > Also, to check the active runtime, can you use `systemctl show > --property=ActiveEnterTimestamp session-X.scope`? Or just show the full > output of systemctl status session-X.scope. It should inform us if it is > counting up to

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-21 Thread Nick Rosbrook
Also, to check the active runtime, can you use `systemctl show --property=ActiveEnterTimestamp session-X.scope`? Or just show the full output of systemctl status session-X.scope. It should inform us if it is counting up to RuntimeMaxSec. -- You received this bug notification because you are a

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-21 Thread Nick Rosbrook
Okay. I'm curious what the output is when RuntimeMaxSec does not seem to be enforced. Does this fail consistently again or is it irregular? -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu.

Re: [Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-20 Thread Steve Langasek
On Mon, Apr 17, 2023 at 01:30:11PM -, Nick Rosbrook wrote: > Odd. Does `systemctl show --propoerty=RuntimeMaxUSec session-2.scope` > show the same thing, or something different? For a current session, which is session-93.scope, I see in the file: RuntimeMaxSec=1h 38min 56s And from

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-17 Thread Nick Rosbrook
Odd. Does `systemctl show --propoerty=RuntimeMaxUSec session-2.scope` show the same thing, or something different? -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu. https://bugs.launchpad.net/bugs/2015126

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-15 Thread Steve Langasek
Although this was working with the ppa package, enforcement is failing again. # apt policy systemd systemd: Installed: 249.11-0ubuntu3.10~debug1 Candidate: 249.11-0ubuntu3.10~debug1 Version table: *** 249.11-0ubuntu3.10~debug1 500 500

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-10 Thread Nick Rosbrook
Thanks for testing! ** Also affects: systemd (Ubuntu Jammy) Importance: Undecided Status: New ** Also affects: systemd (Ubuntu Kinetic) Importance: Undecided Status: New ** Changed in: systemd (Ubuntu Jammy) Status: New => Triaged ** Changed in: systemd (Ubuntu

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-08 Thread Steve Langasek
Thanks, I've confirmed the fix on jammy here. -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu. https://bugs.launchpad.net/bugs/2015126 Title: systemd doesn't successfully enforce RuntimeMaxSec for gnome

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-05 Thread Nick Rosbrook
Jammy version with my fix is in ppa:enr0n/systemd-249. ** Changed in: systemd (Ubuntu) Status: New => Triaged -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu. https://bugs.launchpad.net/bugs/2015126

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-05 Thread Nick Rosbrook
Er, I built and tested on kinetic, but I can build the fix for jammy too. -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu. https://bugs.launchpad.net/bugs/2015126 Title: systemd doesn't successfully

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-05 Thread Nick Rosbrook
I was able to re-produce this in a different way, but I'm pretty sure it's the same bug that affects you. For scope units in particular, the RuntimeMaxSec property is not applied correctly when systemd is reloaded. E.g., if I run: $ systemd-run --scope -u foo-1.scope /usr/bin/foo $ mkdir -p

[Touch-packages] [Bug 2015126] Re: systemd doesn't successfully enforce RuntimeMaxSec for gnome session

2023-04-03 Thread Steve Langasek
For reference, populating RuntimeMaxSec is done via https://github.com/vorlonofportland/pam_session_timelimit; there is no existing support for this in Ubuntu today. -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in