0001-update-done-Do-not-fail-with-read-only-etc-or-var.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. From e2a23672a1bbf4d3411dce0289051b5a72bd4a67 Mon Sep 17 00:00:00 2001
  2. From: Felix Riemann <felix.riemann@sma.de>
  3. Date: Mon, 19 Oct 2020 18:54:53 +0200
  4. Subject: [PATCH] update-done: Do not fail with read-only /etc or /var
  5. With the switch from log_debug() to log_debug_errno() in commit c413bb28df
  6. systemd-update-done would fail without any error message if /etc
  7. or /var were read-only. This restores the previous behaviour to
  8. silently ignore these directories again.
  9. [Romain: backport from 1eee15c3885fcc9f6a40df7e42347cb8fca71280]
  10. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  11. ---
  12. src/update-done/update-done.c | 4 ++--
  13. 1 file changed, 2 insertions(+), 2 deletions(-)
  14. diff --git a/src/update-done/update-done.c b/src/update-done/update-done.c
  15. index e9d589e0e5..92c348d83b 100644
  16. --- a/src/update-done/update-done.c
  17. +++ b/src/update-done/update-done.c
  18. @@ -31,8 +31,8 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
  19. r = write_string_file_atomic_label_ts(path, message, ts);
  20. if (r == -EROFS)
  21. - return log_debug_errno(r, "Cannot create \"%s\", file system is read-only.", path);
  22. - if (r < 0)
  23. + log_debug_errno(r, "Cannot create \"%s\", file system is read-only.", path);
  24. + else if (r < 0)
  25. return log_error_errno(r, "Failed to write \"%s\": %m", path);
  26. return 0;
  27. }
  28. --
  29. 2.25.4