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 Andrei Borzenkov
On 13.08.2021 15:13, George Avrunin wrote:
> 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?
> 

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/22

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



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-13 Thread Simon McVittie
On Fri, 13 Aug 2021 at 08:05:29 +0200, Ulrich Windl wrote:
> 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.

If this is not what you want, change the logged-in user's GNOME settings
(via gnome-control-center or the /org/gnome/settings-daemon/plugins/power
dconf tree). While a user is logged in, their per-user settings take effect,
unless systemd-logind is configured to forbid that.

The default in GNOME is to suspend after 20 minutes, to comply with
European and American energy-saving legislation.

smcv


[systemd-devel] Unreliable shutdown/reboot service on CentOS 8

2021-08-13 Thread Harryo
Hi,
This service sometimes works and sometimes it doesn't.
Does the service die if one of the commands throws an error?
Or does the system shutdown before the script is done?
I don't know what's going on and I have tried so many things.

[Unit]
Description = move the files on reboot or shutdown
RequiresMountsFor = / /location
Before = multi-user.target

[Service]
Type = oneshot
RemainAfterExit = true
ExecStart = /bin/true
ExecStop = /bin/bash /scripts/MoveFilesAndStuff.sh
StandardOutput = file:/location/movestufflog.log
StandardError = file:/location/movestufflog.log

[Install]
WantedBy = multi-user.target halt.target shutdown.target reboot.target


MoveFilesAndStuff.sh:
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
export DISPLAY=:0.0
#exec >/ location/scripttestlog.txt 2>&1


\cp -rpf /var /location
\cp -rpf /etc /location
\cp -rpf /run /location
\cp -rpf /root /location

mv /location/defaultnetcron.xml /location/defaultnet.xml
mv /location/vdsmnetcron.xml /location/vdsmnet.xml

{shutdown a vm command}


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

2021-08-13 Thread Ulrich Windl
>>> George Avrunin  schrieb am 12.08.2021 um 14:10 in
Nachricht <20210812081008.4ca3ce4c@g.localdomain>:
> On Thu, 12 Aug 2021 09:24:25 +0200, Ulrich Windl wrote:
> 
>> > 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  
>> 
>> I don't know, but caring about the earch climate my PC goes to STR
>> (suspend to RAM) when there is no activity for a longer time.
>> Maybe your PC uses a similar setting, and being constantly attacked
>> keeps it busy, so when there is no switch connection your PC becomes
>> actually idle ;‑)
> 
> 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.

> 
>> 
>> > 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.
>> 
>> Mine logs a lot when suspending or resuming, bu tOI dn't run Fedora
>> (Leap 15.3 instead).
> 
>   George