[systemd-commits] 2 commits - TODO src/fsck src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jun 25 01:04:44 PDT 2014


 TODO                   |    4 +++-
 src/fsck/fsck.c        |   14 +++++---------
 src/shared/generator.c |    9 ++++++---
 src/shared/path-util.c |   21 +++++++++++++++++++--
 4 files changed, 33 insertions(+), 15 deletions(-)

New commits:
commit 571d0134bd464444567cf4eb0d2ed8df40045f36
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 24 19:37:22 2014 +0200

    fsck: consider a fsck implementation linked to /bin/true non-existant

diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index 0b572e5..e8596d9 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -302,15 +302,11 @@ int main(int argc, char *argv[]) {
         type = udev_device_get_property_value(udev_device, "ID_FS_TYPE");
         if (type) {
                 r = fsck_exists(type);
-                if (r < 0) {
-                        if (r == -ENOENT) {
-                                log_info("fsck.%s doesn't exist, not checking file system on %s",
-                                         type, device);
-                                return EXIT_SUCCESS;
-                        } else
-                                log_warning("fsck.%s cannot be used for %s: %s",
-                                            type, device, strerror(-r));
-                }
+                if (r == -ENOENT) {
+                        log_info("fsck.%s doesn't exist, not checking file system on %s", type, device);
+                        return EXIT_SUCCESS;
+                } else if (r < 0)
+                        log_warning("fsck.%s cannot be used for %s: %s", type, device, strerror(-r));
         }
 
         if (arg_show_progress)
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 5ac7b5f..dcfddaa 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -49,10 +49,13 @@ int generator_write_fsck_deps(
         if (!isempty(fstype) && !streq(fstype, "auto")) {
                 int r;
                 r = fsck_exists(fstype);
-                if (r < 0) {
-                        log_warning("Checking was requested for %s, but fsck.%s cannot be used: %s", what, fstype, strerror(-r));
+                if (r == -ENOENT) {
                         /* treat missing check as essentially OK */
-                        return r == -ENOENT ? 0 : r;
+                        log_debug("Checking was requested for %s, but fsck.%s does not exist: %s", what, fstype, strerror(-r));
+                        return 0;
+                } else if (r < 0) {
+                        log_warning("Checking was requested for %s, but fsck.%s cannot be used: %s", what, fstype, strerror(-r));
+                        return r;
                 }
         }
 
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index fd35e0c..e68d367 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -541,7 +541,7 @@ int path_is_os_tree(const char *path) {
 int find_binary(const char *name, char **filename) {
         assert(name);
 
-        if (strchr(name, '/')) {
+        if (is_path(name)) {
                 if (access(name, X_OK) < 0)
                         return -errno;
 
@@ -626,8 +626,25 @@ bool paths_check_timestamp(const char* const* paths, usec_t *timestamp, bool upd
 }
 
 int fsck_exists(const char *fstype) {
+        _cleanup_free_ char *p = NULL, *d = NULL;
         const char *checker;
+        int r;
 
         checker = strappenda("fsck.", fstype);
-        return find_binary(checker, NULL);
+
+        r = find_binary(checker, &p);
+        if (r < 0)
+                return r;
+
+        /* An fsck that is linked to /bin/true is a non-existant
+         * fsck */
+
+        r = readlink_malloc(p, &d);
+        if (r >= 0 &&
+            (path_equal(d, "/bin/true") ||
+             path_equal(d, "/usr/bin/true") ||
+             path_equal(d, "/dev/null")))
+                return -ENOENT;
+
+        return 0;
 }

commit fbe1a1a94f19112d7e5d60c40d87487ad24e2ce4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 24 19:34:27 2014 +0200

    update TODO

diff --git a/TODO b/TODO
index 96477c3..777f632 100644
--- a/TODO
+++ b/TODO
@@ -24,8 +24,10 @@ External:
 * Fedora: move kernel image to /usr/lib/modules/, kernel-install will take care of populating /boot
 
 Features:
+
+* coredump: add a size-based cleanup logic to coredump helper, so that we don't flood /var/lib/systemd/coredump unrestricted
+
 * support empty /etc boots nicely:
-  - tmpfiles: add nice way to copy files /usr/share/factory/etc → /etc
   - nspawn/gpt-generator: introduce new gpt partition type for /usr
 
 * generator that automatically discovers btrfs subvolumes, identifies their purpose based on some xattr on them.



More information about the systemd-commits mailing list