On 2023-01-12 05:33, Robert Webb wrote:
On Wed, 11 Jan 2023 21:55:26 +0100 (CET), "Carlos E. R." <carlos.e.r@opensuse.org> wrote:
[...] I'm doing it via a script in "/etc/pm/sleep.d/07time":
+++······················· !/bin/bash
[...]
No hash ('#') character. Great that it works anyway. :-)
Oh, I wish that was the error... No, that was a mouse paste error, the original has the hash. This morning it did not work. And possibly other scripts in that directory are not working. Some seem to work. Telcontar:/etc/pm/sleep.d # ls -l total 52 -rwxr-xr-x 1 root root 1660 Nov 5 2019 04cosas yes -rwxr-xr-x 1 root root 628 Jul 14 2016 05inhibit -rwxr-xr-x 1 root root 776 Jul 14 2016 05nfscheck -rwxr-xr-x 1 root root 882 Jul 15 2016 05vmwarecheck -rwxr-xr-x 1 root root 1096 Jul 16 2016 06news no -rwxr-xr-x 1 root root 903 Apr 25 2014 06news~ -rwxr-xr-x 1 root root 439 Jan 11 22:08 07time no -rwxr-xr-x 1 root root 390 Jan 11 22:07 07time~ -rwxr-xr-x 1 root root 383 Jul 15 2016 20screensaver -rwxr-xr-x 1 root root 1495 Jul 15 2014 90clock ??? -rwxr-xr-x 1 root root 1679 Apr 27 2014 95cosas no -rw-r--r-- 1 root root 448 Aug 20 2012 99NOWAY -rw-r--r-- 1 root root 1608 Apr 27 2014 notas Telcontar:/etc/pm/sleep.d # The script "clock" attempted the same thing as "time", but is several years old, and doesn't run or work. Ah! 04cosas is not running. Instead something named "systemd-sleep" is running, just that it logs the same string. Telcontar:~ # l /usr/lib/systemd/system-sleep total 24 drwxr-xr-x 2 root root 4096 Dec 13 12:40 ./ drwxr-xr-x 22 root root 4096 Dec 29 21:05 ../ -rwxr-xr-x 1 root root 8073 Nov 15 10:26 grub2.sleep* -rwxr-xr-x 1 root root 1629 Mar 18 2020 mine-sleep* <=== -rwxr-xr-x 1 root root 662 May 18 2022 nut.sh* Telcontar:~ # Trying: /usr/lib/systemd/system-sleep/mine-time: #!/bin/bash . /usr/lib/pm-utils/functions . /root/ThingsNeededForBoot/MyScriptDefinitions DATE=`date --rfc-3339=seconds` case $1 in post) case $2 in thaw|resume) echo "$DATE Thawing/resuming." >> /var/log/ntp $LOGGER -t pm-utils -p daemon.notice "Restarting remote clock syncing after hibernating/suspend." systemctl restart ntpd.service ;; esac ;; esac No documentation. Telcontar:~ # apropos system-sleep system-sleep: nothing appropriate. Telcontar:~ # Ah. The directory is system-sleep, but the feature is systemd-sleep: Telcontar:~ # apropos systemd-sleep systemd-sleep (8) - System sleep state logic systemd-sleep.conf (5) - Suspend and hibernation configuration file Telcontar:~ # «Note that scripts or binaries dropped in /usr/lib/systemd/system-sleep/ are intended for local use only and should be considered hacks. If applications want to react to system suspend/hibernation and resume, they should rather use the Inhibitor interface[1].» So I do not see documentation for that directory. Will see how/if it works. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)