Skip to content

swclock does not show read/write errors #989

@anthumchris

Description

@anthumchris

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

Image

Shutdown

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions