-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2023-01-12 at 12:08 +0100, Carlos E. R. wrote:
On 2023-01-12 05:33, Robert Webb wrote:
On Wed, 11 Jan 2023 21:55:26 +0100 (CET), "Carlos E. R." <> wrote:
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
...
Will see how/if it works.
Did not. It appears that "pre" is when hibernating or suspending, and "post" is recovery. Why have $1 and $2 with similar information I don't understand. I thought that "pre" meant early in the hibernation/recovery process (or previous), and "post" meant late or after. Not so. So now I have: !/bin/bash . /usr/lib/pm-utils/functions . /root/ThingsNeededForBoot/MyScriptDefinitions DATE=`date --rfc-3339=seconds` $LOGGER -t mine-sleep -p daemon.notice "Inside /usr/lib/systemd/system-sleep/mine-time. Params -$1--$2-." #<3.5> 2023-01-12T19:03:07.165222+01:00 Telcontar mine-sleep - - - Inside /usr/lib/systemd/system-sleep/mine-time. Params -pre--hibernate-. #<3.5> 2023-01-12T19:07:01.457919+01:00 Telcontar mine-sleep - - - Inside /usr/lib/systemd/system-sleep/mine-time. Params -post--hibernate-. # $1: "pre" is hibernating. "post" is recovering. case $1 in pre) echo "$DATE Thawing/resuming." >> /var/log/ntp $LOGGER -t mine-sleep -p daemon.notice "Restarting remote clock syncing after hibernating/suspend." systemctl restart ntpd.service ;; esac This does work, but is wrong, I should have "post". Mind fart. Correcting and testing: usr/lib/systemd/system-sleep/mine-time 789/789 100% #!/bin/bash . /usr/lib/pm-utils/functions . /root/ThingsNeededForBoot/MyScriptDefinitions DATE=`date --rfc-3339=seconds` $LOGGER -t mine-sleep -p daemon.notice "Inside /usr/lib/systemd/system-sleep/mine-time. Params -$1--$2-." #<3.5> 2023-01-12T19:03:07.165222+01:00 Telcontar mine-sleep - - - Inside /usr/lib/systemd/system-sleep/mine-time. Params -pre--hib #<3.5> 2023-01-12T19:07:01.457919+01:00 Telcontar mine-sleep - - - Inside /usr/lib/systemd/system-sleep/mine-time. Params -post--hi # $1: "pre" is hibernating. "post" is recovering. case $1 in post) echo "$DATE -- Thawing/resuming." >> /var/log/ntp $LOGGER -t mine-sleep -p daemon.notice "Restarting remote clock syncing after hibernating/suspend." systemctl restart ntpd.service ;; esac Produces this output: <3.6> 2023-01-12T19:27:22.411769+01:00 Telcontar systemd-sleep 10039 - - INFO: Running grub-once-restore .. <3.4> 2023-01-12T19:27:22.412871+01:00 Telcontar wickedd 1527 - - route ipv4 0.0.0.0/0 via 192.168.1.1 dev eth0#2 type unicast table main scope universe protocol boot covered by a ipv4:static lease <1.4> 2023-01-12T19:27:22.412945+01:00 Telcontar upowerd 4484 - - treating change event as add on /sys/devices/pci0000:00/0000:00:01.3/0000:03:00.0/usb1/1-13 <1.4> 2023-01-12T19:27:22.413017+01:00 Telcontar upowerd 4484 - - treating change event as add on /sys/devices/pci0000:00/0000:00:01.3/0000:03:00.2/0000:20:08.0/0000:26:00.0/usb3/3-2 <1.4> 2023-01-12T19:27:22.415837+01:00 Telcontar upowerd 4484 - - treating change event as add on /sys/devices/pci0000:00/0000:00:08.1/0000:29:00.3/usb5/5-4 <1.4> 2023-01-12T19:27:22.420137+01:00 Telcontar upowerd 4484 - - treating change event as add on /sys/devices/pci0000:00/0000:00:08.1/0000:29:00.3/usb5/5-4 <3.5> 2023-01-12T19:27:22.458427+01:00 Telcontar mine-sleep - - - Inside /usr/lib/systemd/system-sleep/mine-time. Params -post--hibernate-. <3.4> 2023-01-12T19:27:22.463514+01:00 Telcontar mine-sleep - - - Thawing the system now (post)... <3.5> 2023-01-12T19:27:22.486791+01:00 Telcontar mine-sleep - - - Restarting remote clock syncing after hibernating/suspend. <3.6> 2023-01-12T19:27:22.496076+01:00 Telcontar systemd-sleep 10072 - - service: no such service upsd.service <3.6> 2023-01-12T19:27:22.520020+01:00 Telcontar systemd 1 - - Stopping NTP Server Daemon... <3.6> 2023-01-12T19:27:22.520892+01:00 Telcontar systemd 1 - - ntpd.service: Deactivated successfully. <3.6> 2023-01-12T19:27:22.521121+01:00 Telcontar systemd 1 - - Stopped NTP Server Daemon. <3.6> 2023-01-12T19:27:22.523389+01:00 Telcontar systemd 1 - - Starting NTP Server Daemon... <0.6> 2023-01-12T19:27:22.586745+01:00 Telcontar kernel - - - [697862.017339][T10032] sdf: sdf1 <3.6> 2023-01-12T19:27:22.618560+01:00 Telcontar systemd-sleep 10039 - - INFO: Done. <3.3> 2023-01-12T19:27:22.619066+01:00 Telcontar (sd-executor) 10037 - - /usr/lib/systemd/system-sleep/nut.sh failed with exit status 1. <1.6> 2023-01-12T19:27:22.713861+01:00 Telcontar sntp 10309 - - sntp 4.2.8p15@1.3728-o Tue Jun 15 12:00:00 UTC 2021 (1) <1.6> 2023-01-12T19:27:24.439507+01:00 Telcontar sntp 10309 - - 2023-01-12 19:27:22.715411 (+0100) +1.723994 +/- 1.191494 Isengard.valinor 192.168.1.16 s3 no-leap <3.6> 2023-01-12T19:27:24.440059+01:00 Telcontar start-ntpd 10302 - - Time synchronized with Isengard.valinor <3.5> 2023-01-12T19:27:24.535597+01:00 Telcontar ntpd 10324 - - ntpd 4.2.8p15@1.3728-o Tue Jun 15 12:00:00 UTC 2021 (1): Starting <3.5> 2023-01-12T19:27:24.535725+01:00 Telcontar ntpd 10324 - - Command line: /usr/sbin/ntpd -p /var/run/ntp/ntpd.pid -g -u ntp:ntp -i /var/lib/ntp -c /etc/ntp.conf <3.5> 2023-01-12T19:27:24.535784+01:00 Telcontar ntpd 10324 - - ---------------------------------------------------- <3.5> 2023-01-12T19:27:24.535825+01:00 Telcontar ntpd 10324 - - ntp-4 is maintained by Network Time Foundation, <3.5> 2023-01-12T19:27:24.535863+01:00 Telcontar ntpd 10324 - - Inc. (NTF), a non-profit 501(c)(3) public-benefit <3.5> 2023-01-12T19:27:24.535902+01:00 Telcontar ntpd 10324 - - corporation. Support and training for ntp-4 are <3.5> 2023-01-12T19:27:24.535951+01:00 Telcontar ntpd 10324 - - available at https://www.nwtime.org/support <3.5> 2023-01-12T19:27:24.536011+01:00 Telcontar ntpd 10324 - - ---------------------------------------------------- <3.6> 2023-01-12T19:27:24.536946+01:00 Telcontar ntpd 10326 - - proto: precision = 0.090 usec (-23) <3.6> 2023-01-12T19:27:24.537120+01:00 Telcontar ntpd 10326 - - basedate set to 2021-06-03 <3.6> 2023-01-12T19:27:24.537200+01:00 Telcontar ntpd 10326 - - gps base set to 2021-06-06 (week 2161) <3.5> 2023-01-12T19:27:24.537335+01:00 Telcontar ntpd 10326 - - switching logging to file /var/log/ntp <3.6> 2023-01-12T19:27:24.539516+01:00 Telcontar start-ntpd 10221 - - Starting network time protocol daemon (NTPD) <3.6> 2023-01-12T19:27:24.539678+01:00 Telcontar systemd 1 - - Started NTP Server Daemon. <3.6> 2023-01-12T19:27:24.541844+01:00 Telcontar systemd 1 - - systemd-hibernate.service: Deactivated successfully. Now everything seems correct. Only cosmetic adjustments needed. - -- Cheers, Carlos E. R. (from openSUSE 15.4 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCY8BStRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVvksAnRhKE778NZRmE83eDTI2 35GGPPaVAJ9cCZpr9QEHcm7bOF/95z8yZF7Wdw== =edaS -----END PGP SIGNATURE-----