SHA256
1
0
forked from pool/systemd
systemd/fstab-generator-error-message-on-duplicates.patch

51 lines
2.0 KiB
Diff
Raw Normal View History

Accepting request 149704 from Base:System - Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly (bnc#798620). - Update crypt-loop-file.patch to correctly detect crypto loop files (bnc#799514). - Add journalctl-remove-leftover-message.patch: remove debug message in systemctl. - Add job-avoid-recursion-when-cancelling.patch: prevent potential recursion when cancelling a service. - Add sysctl-parse-all-keys.patch: ensure sysctl file is fully parsed. - Add journal-fix-cutoff-max-date.patch: fix computation of cutoff max date for journal. - Add reword-rescue-mode-hints.patch: reword rescue prompt. - Add improve-overflow-checks.patch: improve time overflow checks. - Add fix-swap-behaviour-with-symlinks.patch: fix swap behaviour with symlinks. - Add hostnamectl-fix-set-hostname-with-no-argument.patch: ensure hostnamectl requires an argument when called with set-hostname option. - Add agetty-overrides-term.patch: pass correctly terminal type to agetty. - Add check-for-empty-strings-in-strto-conversions.patch: better check for empty strings in strto* conversions. - Add strv-cleanup-error-path-loops.patch: cleanup strv on error path. - Add cryptsetup-handle-plain.patch: correctly handle "plain" option in cryptsetup. - Add fstab-generator-improve-error-message.patch: improve error message in fstab-generator. - Add delta-accept-t-option.patch: accept -t option in (forwarded request 149703 from fcrozat) OBS-URL: https://build.opensuse.org/request/show/149704 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=122
2013-01-24 10:41:58 +01:00
From 67ab5f761f9b854d8ce85f9ee47b298e497f8bd9 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Tue, 27 Nov 2012 01:09:28 +0100
Subject: [PATCH] fstab-generator: make error more helpful in case of
duplicates in fstab
Traditional sysvinit systems would not complain about duplicates in
fstab. Rather it (through monut -a) would mount one fs on top of another,
in effect the last entry taking precedent.
In systemd, the first entry takes precedent, all subsequent ones are
ignored and an error is printed.
The change of behavior and the source of this error message was causing
some confusion, so give a hint what migt be wrong.
---
src/fstab-generator/fstab-generator.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 7b3bf11..ba55f2c 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -111,7 +111,10 @@ static int add_swap(const char *what, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file %s: %m", unit);
+ if (errno == EEXIST)
+ log_error("Failed to create swap unit file %s, as it already exists. Duplicate entry in /etc/fstab?", unit);
+ else
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
@@ -254,7 +257,10 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file %s: %m", unit);
+ if (errno == EEXIST)
+ log_error("Failed to create mount unit file %s, as it already exists. Duplicate entry in /etc/fstab?", unit);
+ else
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
--
1.7.10.4