diff options
author | Leah Neukirchen <leah@vuxu.org> | 2024-02-07 14:55:41 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2024-02-07 14:55:41 +0100 |
commit | 4646c0e8a83c00dd8e11c6bb0f30b1fbd32782ea (patch) | |
tree | fc1bc7730a3a09be8b45ec46667e5ed6ff077e3c | |
parent | a23c3252420fc9473c5e9a1f2bd6bb16d5494e43 (diff) | |
download | nitro-4646c0e8a83c00dd8e11c6bb0f30b1fbd32782ea.tar.gz nitro-4646c0e8a83c00dd8e11c6bb0f30b1fbd32782ea.tar.xz nitro-4646c0e8a83c00dd8e11c6bb0f30b1fbd32782ea.zip |
remount / read-only before shutting down
-rw-r--r-- | nitro.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nitro.c b/nitro.c index 1f99560..14587c9 100644 --- a/nitro.c +++ b/nitro.c @@ -1509,6 +1509,11 @@ main(int argc, char *argv[]) global_state == GLBL_WANT_REBOOT ? "reboot" : "halt"); sync(); + if (mount("/", "/", "", MS_REMOUNT | MS_RDONLY, "") < 0) + prn(2, "- nitro: could not remount / read-only: errno=%d\n", errno); + else + prn(2, "- nitro: remounted / read-only\n"); + sleep(1); if (global_state == GLBL_WANT_REBOOT) { |