Re: [systemd-devel] [EXT] [systemd‑devel] no log information about why machine is sleeping

2021-08-13 Thread George Avrunin
On Fri, 13 Aug 2021 18:43:40 +0300, Andrei Borzenkov wrote:

> > I don't think any actual person was logged in, but gdm was running.
> > And apparently gdm starts gsd-power, the gnome-settings power demon.  I
> > haven't yet been able to find where gsd-power gets its settings, but
> > maybe it's that, together with treating network activity as "activity"
> > for the purposes of deciding when to sleep.  Does anyone here know?
> >   
> 
> https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/22

Thanks, that link is very helpful!



pgpLlOty3cJ6a.pgp
Description: OpenPGP digital signature


Re: [systemd-devel] [EXT] [systemd‑devel] no log information about why machine is sleeping

2021-08-13 Thread George Avrunin
On Fri, 13 Aug 2021 08:05:29 +0200, Ulrich Windl wrote:

> > I suppose that's possible, though I haven't been able to find anywhere
> > that's configured.  (I'll ask again on the Fedora list to be sure.)  In
> > the places where I know I've manually configured it (e.g., in the KDE
> > power settings), it's not supposed to sleep at all when it's on AC
> > power.   
> 
> Amazingly in my Leap 15 system it's GNOME that triggers it: If I'm not
> logged in, no suspend happens, but when I have a GNOME session suspend
> happens.

I don't think any actual person was logged in, but gdm was running.  And
apparently gdm starts gsd-power, the gnome-settings power demon.  I
haven't yet been able to find where gsd-power gets its settings, but maybe
it's that, together with treating network activity as "activity" for the
purposes of deciding when to sleep.  Does anyone here know?

If it was gsd-power that was putting the machine to sleep, it wasn't
putting anything in the log saying that.



pgpiIbpwaxibC.pgp
Description: OpenPGP digital signature


Re: [systemd-devel] no log information about why machine is sleeping

2021-08-12 Thread George Avrunin
On Thu, 12 Aug 2021 08:25:03 +0300, Andrei Borzenkov wrote:

> > Aug 06 17:47:32 ext.math.umass.edu kernel:
> > Lockdown: systemd-logind: hibernation is restricted; see man
> > kernel_lockdown.7 Aug 06 17:47:32 ext.math.umass.edu kernel: Lockdown:
> > systemd-logind: hibernation is restricted; see man kernel_lockdown.7
> > Aug 06 17:47:32 ext.math.umass.edu NetworkManager[2111]: 
> > [1628286452.1872] manager: sleep: sleep requested (sleeping: no
> > enabled: yes) Aug 06 17:47:32 ext.math.umass.edu NetworkManager[2111]:
> >   
> 
> Anything before these entries? In my case I see
> 
> авг 06 08:41:18 bor-Latitude-E5450 systemd-logind[1300]: Lid closed.
> авг 06 08:41:18 bor-Latitude-E5450 systemd-logind[1300]: Suspending...
> авг 06 08:41:18 bor-Latitude-E5450 kernel: Lockdown: systemd-logind:
> hibernation is restricted;
>  see man kernel_lockdown.7
> авг 06 08:41:18 bor-Latitude-E5450 NetworkManager[1277]: 
> [1628228478.4162] manager: sle
> ep: sleep requested (sleeping: no  enabled: yes)
> ...
> 
> So here I see the reason for suspend in logs.

No, nothing that looks relevant at all (to me or to Chris Murphy).  This is
a desktop and there don't seem to be any events in the logs that have
anything to do with it until the one about lockdown.

  George




pgpv1wTmDiMa0.pgp
Description: OpenPGP digital signature


Re: [systemd-devel] no log information about why machine is sleeping

2021-08-11 Thread George Avrunin
On Wed, 11 Aug 2021 15:24:25 -0700, Luis Chamberlain wrote:

> On Wed, Aug 11, 2021 at 05:11:21PM -0400, George Avrunin wrote:
> > Aug 07 14:09:22 ext.math.umass.edu kernel: ACPI: Preparing to enter
> > system sleep state S3  
> 
> That's suspend to ram. Depending on the distribution it may or not be a
> a default after a period of time of idle. The idea is that moving a
> mouse would resume it. For desktops this is stupid. Try:
> 
> systemctl mask sleep.target suspend.target hibernate.target
> hybrid-sleep.targe
> 
> To re-enable:
> 
> sudo systemctl unmask sleep.target suspend.target hibernate.target
> hybrid-sleep.target
> 
>   Luis

Thanks, masking the sleep, etc., targets will presumably stop it.  

But I don't think it was a default setting to suspend after a period of
being idle, at least not once the machine was back on AC power (unless
something got reset somehow). This machine is used as a mail and web
server, as well as for some computations that my students and postdoc run
remotely, and it's never done this before when there was no activity at
the console. (And during the pandemic, there's been very little activity
at the console--we've all mostly been working from home.) 

So I'd still like to understand what caused it to start the suspend
operation. If there's an easy way to get just a little bit more logging
about that, it would help me and probably others.

  George




pgpgqbcOjbGAO.pgp
Description: OpenPGP digital signature


[systemd-devel] no log information about why machine is sleeping

2021-08-11 Thread George Avrunin
Hello,

As a result of a major power outage and consequent issues with some
switches, my office workstation, a Dell Precision T1700 running
fully-updated Fedora 34, was off the network for most of last weekend.  As
our department IT staff detected and fixed the switch issues, they noticed
that my workstation was putting itself to sleep when it couldn't connect
to the switch for my floor.  Right now, everything is back up and working,
but they will probably have to replace the switch.

However, I haven't been able to figure out why the machine puts itself to
sleep when it can't reach the switch.  I asked about this on the Fedora
users list (and included the log entries shown below), and Chris Murphy
noted that systemd doesn't normally insert the sleep request in the log,
so it's not possible to determine what caused the sleep request.  He
suggested that I start a thread here to ask if at least a single line of
information about how the sleep is being initiated could be dumped into
the log by default.  

I will experiment with rebooting with systemd.log_level=debug when I know
the switch will be shut down for replacement.  But it would be good to get
more information about what's initiating sleep by default.

Thanks,

  George Avrunin


Here are the relevant log entries from one of the times the machine put
itself to sleep, apparently because it couldn't connect to the network.
If there's more information I can supply, please let me know.

(This starts after power was restored to the building and the machine had
been manually rebooted just to be sure it would go online.)

Aug 06 17:47:32 ext.math.umass.edu kernel:
Lockdown: systemd-logind: hibernation is restricted; see man
kernel_lockdown.7 Aug 06 17:47:32 ext.math.umass.edu kernel: Lockdown:
systemd-logind: hibernation is restricted; see man kernel_lockdown.7
Aug 06 17:47:32 ext.math.umass.edu NetworkManager[2111]: 
[1628286452.1872] manager: sleep: sleep requested (sleeping: no  enabled:
yes) Aug 06 17:47:32 ext.math.umass.edu NetworkManager[2111]: 
[1628286452.1876] manager: NetworkManager state is now ASLEEP
Aug 06 17:47:32 ext.math.umass.edu ModemManager[1954]: 
[sleep-monitor] system is about to suspend
Aug 06 17:47:32 ext.math.umass.edu gnome-shell[4292]: Screen lock is
locked down, not locking
Aug 06 17:47:32 ext.math.umass.edu systemd[1]: Reached target Sleep.
Aug 06 17:47:32 ext.math.umass.edu systemd[1]: Starting System Suspend...
Aug 06 17:47:32 ext.math.umass.edu systemd-sleep[40504]: Suspending
system...
Aug 06 17:47:32 ext.math.umass.edu kernel: PM: suspend entry (deep)
Aug 07 14:09:22 ext.math.umass.edu kernel: Filesystems sync: 0.379 seconds
Aug 07 14:09:22 ext.math.umass.edu kernel: Freezing user space processes
... (elapsed 0.002 seconds) done.
Aug 07 14:09:22 ext.math.umass.edu kernel: OOM killer disabled.
Aug 07 14:09:22 ext.math.umass.edu kernel: Freezing remaining freezable
tasks ... (elapsed 0.001 seconds) done.
Aug 07 14:09:22 ext.math.umass.edu kernel: printk: Suspending console(s)
(use no_console_suspend to debug)
Aug 07 14:09:22 ext.math.umass.edu kernel: serial 00:06: disabled
Aug 07 14:09:22 ext.math.umass.edu kernel: e1000e: EEE TX LPI TIMER:
0011
Aug 07 14:09:22 ext.math.umass.edu kernel: sd 0:0:0:0: [sda] Synchronizing
SCSI cache
Aug 07 14:09:22 ext.math.umass.edu kernel: sd 1:0:0:0: [sdb] Synchronizing
SCSI cache
Aug 07 14:09:22 ext.math.umass.edu kernel: sd 1:0:0:0: [sdb] Stopping disk
Aug 07 14:09:22 ext.math.umass.edu kernel: sd 0:0:0:0: [sda] Stopping disk
Aug 07 14:09:22 ext.math.umass.edu kernel: PM: suspend devices took 1.031
seconds
Aug 07 14:09:22 ext.math.umass.edu kernel: ACPI: Preparing to enter system
sleep state S3
Aug 07 14:09:22 ext.math.umass.edu kernel: PM: Saving platform NVS memory
Aug 07 14:09:22 ext.math.umass.edu kernel: Disabling non-boot CPUs ...
lines 835-871
etc.


pgpxrv8sRWHHG.pgp
Description: OpenPGP digital signature