I’ve noticed that rebooting the OSPi via the new OS gui causes minor filesystem corruption – for example, some logfiles in the RPi’s /var/log directory
have blocks of NULLs at the time of reboot. This appears to be caused by the lack of a manual sync() before calling the reboot command.
The raspbian reboot(2) manpage says:
> LINUX_REBOOT_CMD_RESTART
> (RB_AUTOBOOT, 0x1234567). The message “Restarting system.” is
> printed, and a default restart is performed immediately. If not
> preceded by a sync(2), data will be lost.
I’ve verified that calling sync() before reboot(RB_AUTOBOOT) appears to solve the problem.
A minor consequence is that the the reboot is delayed by a couple of seconds while the filesystem is synced.
I’ve no idea if this fix applies to the other OS hardware platforms or not.
Kim.