Use `os.fsync` in order to sync the reboot sentinel file to disk before reboot to avoid calling `sync` via shell.
Use
os.fsyncin order to sync the reboot sentinel file to disk before reboot to avoid callingsyncvia shell.