summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-03-10 16:08:34 +0100
committerMike Yuan <me@yhndnzj.com>2024-03-10 16:08:34 +0100
commit5926d6920068f90f8c581120d18864b7c7607c7e (patch)
treeeeea7bd60f983f961c81a9848e7fb2d6abbb94d6
parentunits: make quota services bind to corresponding mount units (diff)
downloadsystemd-5926d6920068f90f8c581120d18864b7c7607c7e.tar.xz
systemd-5926d6920068f90f8c581120d18864b7c7607c7e.zip
quotacheck: minor modernization
-rw-r--r--src/quotacheck/quotacheck.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/quotacheck/quotacheck.c b/src/quotacheck/quotacheck.c
index c77e0d6143..d049f5364b 100644
--- a/src/quotacheck/quotacheck.c
+++ b/src/quotacheck/quotacheck.c
@@ -31,12 +31,12 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
else if (streq(value, "skip"))
arg_skip = true;
else
- log_warning("Invalid quotacheck.mode= parameter '%s'. Ignoring.", value);
+ log_warning("Invalid quotacheck.mode= value, ignoring: %s", value);
}
#if HAVE_SYSV_COMPAT
else if (streq(key, "forcequotacheck") && !value) {
- log_warning("Please use 'quotacheck.mode=force' rather than 'forcequotacheck' on the kernel command line.");
+ log_warning("Please use 'quotacheck.mode=force' rather than 'forcequotacheck' on the kernel command line. Proceeding anyway.");
arg_force = true;
}
#endif
@@ -48,7 +48,7 @@ static void test_files(void) {
#if HAVE_SYSV_COMPAT
if (access("/forcequotacheck", F_OK) >= 0) {
- log_error("Please pass 'quotacheck.mode=force' on the kernel command line rather than creating /forcequotacheck on the root file system.");
+ log_error("Please pass 'quotacheck.mode=force' on the kernel command line rather than creating /forcequotacheck on the root file system. Proceeding anyway.");
arg_force = true;
}
#endif
@@ -77,8 +77,15 @@ static int run(int argc, char *argv[]) {
if (arg_skip)
return 0;
- if (access("/run/systemd/quotacheck", F_OK) < 0)
+ /* This is created by systemd-fsck when fsck detected and corrected errors. In normal
+ * operations quotacheck is not needed. */
+ if (access("/run/systemd/quotacheck", F_OK) < 0) {
+ if (errno != ENOENT)
+ log_warning_errno(errno,
+ "Failed to check whether /run/systemd/quotacheck exists, ignoring: %m");
+
return 0;
+ }
}
if (argc == 2) {