[systemd-commits] 3 commits - Makefile.am man/shutdown.xml src/main.c src/modprobe-setup.c src/modprobe-setup.h src/systemctl.c src/util.c src/util.h

Lennart Poettering lennart at kemper.freedesktop.org
Tue Aug 17 09:13:58 PDT 2010


 Makefile.am          |    1 -
 man/shutdown.xml     |   20 --------------------
 src/main.c           |   26 +++++++-------------------
 src/modprobe-setup.c |   36 ------------------------------------
 src/modprobe-setup.h |   29 -----------------------------
 src/systemctl.c      |   20 --------------------
 src/util.c           |   17 -----------------
 src/util.h           |    2 --
 8 files changed, 7 insertions(+), 144 deletions(-)

New commits:
commit 1cba2c90e837b8ccff736890e223628275d4183d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 17 18:10:46 2010 +0200

    modprobe: kill support for nomodules
    
    this should happen in the kernel itself, not be controlled from
    userspace, if at all. So let's kill this here.

diff --git a/Makefile.am b/Makefile.am
index f187b4b..27df084 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -312,7 +312,6 @@ libsystemd_core_la_SOURCES = \
 	src/hostname-setup.c \
 	src/loopback-setup.c \
 	src/kmod-setup.c \
-	src/modprobe-setup.c \
 	src/specifier.c \
 	src/unit-name.c \
 	src/fdset.c \
diff --git a/src/main.c b/src/main.c
index 43b469f..b0e1c22 100644
--- a/src/main.c
+++ b/src/main.c
@@ -38,7 +38,6 @@
 #include "hostname-setup.h"
 #include "loopback-setup.h"
 #include "kmod-setup.h"
-#include "modprobe-setup.h"
 #include "load-fragment.h"
 #include "fdset.h"
 #include "special.h"
@@ -63,7 +62,6 @@ static bool arg_dump_core = true;
 static bool arg_crash_shell = false;
 static int arg_crash_chvt = -1;
 static bool arg_confirm_spawn = false;
-static bool arg_nomodules = false;
 static bool arg_show_status = true;
 static bool arg_sysv_console = true;
 
@@ -335,10 +333,7 @@ static int parse_proc_cmdline_word(const char *word) {
                          "systemd.log_color=0|1                    Highlight important log messages\n"
                          "systemd.log_location=0|1                 Include code location in log messages\n");
 
-        } else if (streq(word, "nomodules"))
-                arg_nomodules = true;
-
-        else if (streq(word, "quiet")) {
+        } if (streq(word, "quiet")) {
                 arg_show_status = false;
                 arg_sysv_console = false;
         } else {
@@ -979,7 +974,6 @@ int main(int argc, char *argv[]) {
                 if (arg_show_status)
                         status_welcome();
 
-                modprobe_setup(arg_nomodules);
                 kmod_setup();
                 hostname_setup();
                 loopback_setup();
diff --git a/src/modprobe-setup.c b/src/modprobe-setup.c
deleted file mode 100644
index 1de622d..0000000
--- a/src/modprobe-setup.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "modprobe-setup.h"
-
-#include "util.h"
-
-int modprobe_setup(bool nomodules) {
-        int r;
-
-        if (!nomodules)
-                return 0;
-
-        if ((r = write_one_line_file("/proc/sys/kernel/modprobe", "/bin/true")) < 0)
-                log_error("Failed to write /proc/sys/kernel/modprobe: %m");
-
-        return r;
-}
diff --git a/src/modprobe-setup.h b/src/modprobe-setup.h
deleted file mode 100644
index 0fd2314..0000000
--- a/src/modprobe-setup.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-#ifndef foomodprobesetuphfoo
-#define foomodprobesetuphfoo
-
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include <stdbool.h>
-
-int modprobe_setup(bool arg_nomodules);
-
-#endif
commit f276a41821fcd2b7e4968edef46ba3bd99706ecf
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 17 18:04:06 2010 +0200

    shutdown: drop -f/-F switches again, simply because we don't want to condone non-ro root dirs
    
    Instead of using /forcefsck and /fastboot people should just kernel
    command line options to achieve the same.

diff --git a/man/shutdown.xml b/man/shutdown.xml
index c48e141..d6bdad3 100644
--- a/man/shutdown.xml
+++ b/man/shutdown.xml
@@ -147,26 +147,6 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><option>-f</option></term>
-
-                                <listitem><para>Skip file system check
-                                on reboot. This is equivalent to
-                                creating the
-                                <filename>/fastboot</filename> file
-                                before going down.</para></listitem>
-                        </varlistentry>
-
-                        <varlistentry>
-                                <term><option>-F</option></term>
-
-                                <listitem><para>Force file system
-                                check on reboot. This is equivalent to
-                                creating the
-                                <filename>/forcefsck</filename> file
-                                before going down.</para></listitem>
-                        </varlistentry>
-
-                        <varlistentry>
                                 <term><option>-c</option></term>
 
                                 <listitem><para>Cancel a pending
diff --git a/src/systemctl.c b/src/systemctl.c
index 44b8848..a8a5e0c 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -70,8 +70,6 @@ static bool arg_force = false;
 static bool arg_defaults = false;
 static char **arg_wall = NULL;
 static usec_t arg_when = 0;
-static bool arg_skip_fsck = false;
-static bool arg_force_fsck = false;
 static enum action {
         ACTION_INVALID,
         ACTION_SYSTEMCTL,
@@ -3838,8 +3836,6 @@ static int shutdown_help(void) {
                "  -h             Equivalent to --poweroff, overriden by --halt\n"
                "  -k             Don't halt/power-off/reboot, just send warnings\n"
                "     --no-wall   Don't send wall message before halt/power-off/reboot\n"
-               "  -f             Skip fsck on reboot\n"
-               "  -F             Force fsck on reboot\n"
                "  -c             Cancel a pending shutdown\n",
                program_invocation_short_name);
 
@@ -4215,14 +4211,6 @@ static int shutdown_parse_argv(int argc, char *argv[]) {
                         /* Compatibility nops */
                         break;
 
-                case 'f':
-                        arg_skip_fsck = true;
-                        break;
-
-                case 'F':
-                        arg_force_fsck = true;
-                        break;
-
                 case 'c':
                         arg_action = ACTION_CANCEL_SHUTDOWN;
                         break;
@@ -4812,14 +4800,6 @@ static int halt_main(DBusConnection *bus) {
                 return -EPERM;
         }
 
-        if (arg_force_fsck) {
-                if ((r = touch("/forcefsck")) < 0)
-                        log_warning("Failed to create /forcefsck: %s", strerror(-r));
-        } else if (arg_skip_fsck) {
-                if ((r = touch("/fastboot")) < 0)
-                        log_warning("Failed to create /fastboot: %s", strerror(-r));
-        }
-
         if (arg_when > 0) {
                 char *m;
                 char date[FORMAT_TIMESTAMP_MAX];
commit 888c6216ca9239be260fd832f900b9fcd784f806
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 17 18:00:48 2010 +0200

    nss: don't disable nscd anymore, since it doesn't make sense to socket-activate nscd anyway

diff --git a/src/main.c b/src/main.c
index 51253c6..43b469f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -975,20 +975,14 @@ int main(int argc, char *argv[]) {
         log_full(arg_running_as == MANAGER_SYSTEM ? LOG_INFO : LOG_DEBUG,
                  PACKAGE_STRING " running in %s mode. (" SYSTEMD_FEATURES ")", manager_running_as_to_string(arg_running_as));
 
-        if (arg_running_as == MANAGER_SYSTEM) {
+        if (arg_running_as == MANAGER_SYSTEM && !serialization) {
+                if (arg_show_status)
+                        status_welcome();
 
-                /* Disable nscd, to avoid deadlocks when systemd uses
-                 * NSS and the nscd socket is maintained by us. */
-                nss_disable_nscd();
-
-                if (!serialization) {
-                        if (arg_show_status)
-                                status_welcome();
-                        modprobe_setup(arg_nomodules);
-                        kmod_setup();
-                        hostname_setup();
-                        loopback_setup();
-                }
+                modprobe_setup(arg_nomodules);
+                kmod_setup();
+                hostname_setup();
+                loopback_setup();
         }
 
         if ((r = manager_new(arg_running_as, &m)) < 0) {
diff --git a/src/util.c b/src/util.c
index 3bcce2f..0b0063e 100644
--- a/src/util.c
+++ b/src/util.c
@@ -2981,23 +2981,6 @@ char *ellipsize(const char *s, unsigned length, unsigned percent) {
         return r;
 }
 
-void nss_disable_nscd(void) {
-
-        void (*func)(void);
-
-        /* This is an internal glibc function call. We are not
-         * supposed to call this, because we are not nscd. However
-         * sometimes we feel really dangerous and do it
-         * nonetheless. Muahahah! But at least we protect this with a
-         * dlsym() just in case glibc takes this away from us. */
-
-        if ((func = dlsym(RTLD_DEFAULT, "__nss_disable_nscd"))) {
-                log_debug("Disabling nscd.");
-                func();
-        } else
-                log_debug("Cannot disable nscd.");
-}
-
 int touch(const char *path) {
         int fd;
 
diff --git a/src/util.h b/src/util.h
index 18dfa97..97e1b1b 100644
--- a/src/util.h
+++ b/src/util.h
@@ -336,8 +336,6 @@ int running_in_chroot(void);
 
 char *ellipsize(const char *s, unsigned length, unsigned percent);
 
-void nss_disable_nscd(void);
-
 int touch(const char *path);
 
 const char *ioprio_class_to_string(int i);


More information about the systemd-commits mailing list