diff options
author | Christian Breunig <christian@breunig.cc> | 2023-02-05 07:54:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-05 07:54:02 +0100 |
commit | 3eb77660f6bb188187856d0ea74c338031fdad26 (patch) | |
tree | 9400de90e2c7b2f8fd978a33eb03a0c5dfb45cad | |
parent | b9ba0a67da3f10755780e13b3c15d8c2042ae70d (diff) | |
parent | f8108e3d713928b8f232535261022047f9c84c66 (diff) | |
download | vyos-1x-3eb77660f6bb188187856d0ea74c338031fdad26.tar.gz vyos-1x-3eb77660f6bb188187856d0ea74c338031fdad26.zip |
Merge pull request #1798 from c-po/t4975-equuleus
T4975: always sync() filesystem after commit (equuleus)
-rw-r--r-- | debian/vyos-1x.install | 1 | ||||
-rwxr-xr-x | src/conf_mode/system-login.py | 3 | ||||
-rwxr-xr-x | src/etc/commit/post-hooks.d/00vyos-sync | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/debian/vyos-1x.install b/debian/vyos-1x.install index 96c3f2008..82f3f73fc 100644 --- a/debian/vyos-1x.install +++ b/debian/vyos-1x.install @@ -1,3 +1,4 @@ +etc/commit etc/dhcp etc/netplug etc/ppp diff --git a/src/conf_mode/system-login.py b/src/conf_mode/system-login.py index ceca0a14b..aba10689d 100755 --- a/src/conf_mode/system-login.py +++ b/src/conf_mode/system-login.py @@ -311,9 +311,6 @@ def apply(login): except Exception as e: raise ConfigError(f'RADIUS configuration failed: {e}') - # sync user data files to disk - os.sync() - return None diff --git a/src/etc/commit/post-hooks.d/00vyos-sync b/src/etc/commit/post-hooks.d/00vyos-sync new file mode 100755 index 000000000..e3bde3abb --- /dev/null +++ b/src/etc/commit/post-hooks.d/00vyos-sync @@ -0,0 +1,7 @@ +#!/bin/sh +# When power is lost right after a commit modified files, the +# system can be corrupted and e.g. login is no longer possible. +# Always sync files to the backend storage after a commit. +# https://phabricator.vyos.net/T4975 +sync + |