mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-19 19:30:16 +00:00
Flush disk writes before reboot
This commit introduces a `sync` call before the install script exits. The writes that this script does during setup do not reach persistent storage until the kernel decides to flush them. The reboot sequence might drop those pending writes on the floor. To mitigate that possibility (but not fully eliminate it), the script now calls `sync`, which waits until the kernel has flushed its write cache.
This commit is contained in:
parent
2c82a83894
commit
1af5c26034
1 changed files with 4 additions and 0 deletions
|
@ -1371,6 +1371,10 @@ main() {
|
|||
$SUDO systemctl start openvpn.service
|
||||
;;
|
||||
esac
|
||||
|
||||
# Ensure that cached writes reach persistent storage
|
||||
echo "::: Flushing writes to disk..."
|
||||
sync
|
||||
|
||||
echo "::: done."
|
||||
|
||||
|
|
Loading…
Reference in a new issue