init.d/swclock does not show errors during boot/shutdown when swclock_file is not readable/writable.
It may help users to know when swclock fails to sync. This error was difficult to track down without having access to openrc shutdown logs, and I simulated in a VM for TTY1 visibility.
Tests
master...anthumchris:__FORK__openrc:swclock
Using those changes above, I'm using swclock with a file on a mounted filesystem defined in /etc/fstab. I added tests that show errors if the files are not readable/writable.
When I login and restart the service, everything works because the filesystems have mounted:
# rc-service swclock restart
* WARNING: you are stopping a boot service
* WARNING: you are stopping a boot service
* Stopping busybox syslog ... [ ok ]
* [:: swclock ::] Saving - /mnt/sda2/swclock.state is writable? ... [ ok ]
* [:: swclock ::] Saving the shutdown time ... [ ok ]
* [:: swclock ::] Setting - /mnt/sda2/swclock.state is readable? ... [ ok ]
* [:: swclock ::] Setting the local clock based on last shutdown time ... [ ok ]
During boot/shutdown, the filesystems are not mounted, and swclock does not show errors for "Setting the local clock..." and "Saving the shutdown time"
Boot
Shutdown

init.d/swclockdoes not show errors during boot/shutdown whenswclock_fileis not readable/writable.It may help users to know when
swclockfails to sync. This error was difficult to track down without having access to openrc shutdown logs, and I simulated in a VM for TTY1 visibility.Tests
master...anthumchris:__FORK__openrc:swclock
Using those changes above, I'm using
swclockwith a file on a mounted filesystem defined in/etc/fstab. I added tests that show errors if the files are not readable/writable.When I login and restart the service, everything works because the filesystems have mounted:
During boot/shutdown, the filesystems are not mounted, and
swclockdoes not show errors for "Setting the local clock..." and "Saving the shutdown time"Boot
Shutdown