[systemd-commits] 8 commits - .gitignore Makefile.am TODO man/kernel-command-line.xml src/core src/cryptsetup src/debug-generator src/fsck src/fstab-generator src/gpt-auto-generator src/quotacheck

Lennart Poettering lennart at kemper.freedesktop.org
Thu Jun 19 07:57:27 PDT 2014


 .gitignore                                  |   15 +--
 Makefile.am                                 |   11 ++
 TODO                                        |    4 
 man/kernel-command-line.xml                 |   63 ++++++++++--
 src/core/main.c                             |   40 --------
 src/cryptsetup/cryptsetup-generator.c       |    3 
 src/debug-generator/Makefile                |    1 
 src/debug-generator/debug-generator.c       |  137 ++++++++++++++++++++++++++++
 src/fsck/fsck.c                             |   11 +-
 src/fstab-generator/fstab-generator.c       |    2 
 src/gpt-auto-generator/gpt-auto-generator.c |    2 
 src/quotacheck/quotacheck.c                 |    6 -
 12 files changed, 220 insertions(+), 75 deletions(-)

New commits:
commit d34f1a4280d9a38813379199be436bc35973630e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 19 16:57:10 2014 +0200

    gitignore: hide dhcp6/icmp6-rs tests

diff --git a/.gitignore b/.gitignore
index 17aba99..c7c0793 100644
--- a/.gitignore
+++ b/.gitignore
@@ -144,6 +144,8 @@
 /test-dhcp-client
 /test-dhcp-option
 /test-dhcp-server
+/test-dhcp6-client
+/test-icmp6-rs
 /test-ellipsize
 /test-engine
 /test-env-replace

commit 8501384436b410cb9f5929ef6873c59fac6254be
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 19 16:55:20 2014 +0200

    stop complaining about unknown kernel cmdline options
    
    Also stop warning about unknown kernel cmdline options in the various
    tools, not just in PID 1

diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index dfdca1e..9530e44 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -291,8 +291,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 if (!arg_keyfile)
                         return log_oom();
 
-        } else if (startswith(key, "luks.") || startswith(key, "rd.luks."))
-                log_warning("Unknown kernel switch %s. Ignoring.", key);
+        }
 
         return 0;
 }
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index cb2f573..0b572e5 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -86,7 +86,8 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 else if (streq(value, "skip"))
                         arg_skip = true;
                 else
-                        log_warning("Invalid fsck.mode= parameter. Ignoring.");
+                        log_warning("Invalid fsck.mode= parameter '%s'. Ignoring.", value);
+
         } else if (streq(key, "fsck.repair") && value) {
 
                 if (streq(value, "preen"))
@@ -96,13 +97,14 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 else if (streq(value, "no"))
                         arg_repair = "-n";
                 else
-                        log_warning("Invalid fsck.repair= parameter. Ignoring.");
-        } else if (startswith(key, "fsck."))
-                log_warning("Invalid fsck parameter. Ignoring.");
+                        log_warning("Invalid fsck.repair= parameter '%s'. Ignoring.", value);
+        }
+
 #ifdef HAVE_SYSV_COMPAT
         else if (streq(key, "fastboot") && !value) {
                 log_warning("Please pass 'fsck.mode=skip' rather than 'fastboot' on the kernel command line.");
                 arg_skip = true;
+
         } else if (streq(key, "forcefsck") && !value) {
                 log_warning("Please pass 'fsck.mode=force' rather than 'forcefsck' on the kernel command line.");
                 arg_force = true;
@@ -113,6 +115,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
 }
 
 static void test_files(void) {
+
 #ifdef HAVE_SYSV_COMPAT
         if (access("/fastboot", F_OK) >= 0) {
                 log_error("Please pass 'fsck.mode=skip' on the kernel command line rather than creating /fastboot on the root file system.");
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index a9a5c02..63c36b5 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -486,8 +486,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 arg_root_rw = true;
         else if (streq(key, "ro") && !value)
                 arg_root_rw = false;
-        else if (startswith(key, "fstab.") || startswith(key, "rd.fstab."))
-                log_warning("Unknown kernel switch %s. Ignoring.", key);
 
         return 0;
 }
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 78643c9..7dcbbfe 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -695,8 +695,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 arg_root_rw = true;
         else if (streq(key, "ro") && !value)
                 arg_root_rw = false;
-        else if (startswith(key, "systemd.gpt-auto.") || startswith(key, "rd.systemd.gpt-auto."))
-                log_warning("Unknown kernel switch %s. Ignoring.", key);
 
         return 0;
 }
diff --git a/src/quotacheck/quotacheck.c b/src/quotacheck/quotacheck.c
index efd6e18..ed95b48 100644
--- a/src/quotacheck/quotacheck.c
+++ b/src/quotacheck/quotacheck.c
@@ -42,10 +42,9 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 else if (streq(value, "skip"))
                         arg_skip = true;
                 else
-                        log_warning("Invalid quotacheck.mode= parameter. Ignoring.");
+                        log_warning("Invalid quotacheck.mode= parameter '%s'. Ignoring.", value);
+        }
 
-        } else if (startswith(key, "quotacheck."))
-                log_warning("Invalid quotacheck parameter. Ignoring.");
 #ifdef HAVE_SYSV_COMPAT
         else if (streq(key, "forcequotacheck") && !value) {
                 log_warning("Please use 'quotacheck.mode=force' rather than 'forcequotacheck' on the kernel command line.");
@@ -57,6 +56,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
 }
 
 static void test_files(void) {
+
 #ifdef 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.");

commit 52c611b776c6d17b7aeffb5d9b1b555260b5011b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 19 16:54:40 2014 +0200

    man: add new kernel command line switches to kernel-command-line(7)

diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml
index a276b71..d2767e5 100644
--- a/man/kernel-command-line.xml
+++ b/man/kernel-command-line.xml
@@ -99,6 +99,19 @@
                         </varlistentry>
 
                         <varlistentry>
+                                <term><varname>systemd.mask=</varname></term>
+                                <term><varname>systemd.debug-shell</varname></term>
+                                <listitem>
+                                        <para>Additional parameters
+                                        understood by
+                                        <citerefentry><refentrytitle>systemd-debug-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+                                        to mask specific units at
+                                        boot, or invoke a debug shell
+                                        on tty9.</para>
+                                </listitem>
+                        </varlistentry>
+
+                        <varlistentry>
                                 <term><varname>systemd.restore_state=</varname></term>
                                 <listitem>
                                         <para>This parameter is understood by
@@ -183,20 +196,10 @@
 
                         <varlistentry>
                                 <term><varname>fsck.mode=</varname></term>
-
-                                <listitem>
-                                        <para>Parameter understood by
-                                        the file system checker
-                                        services. For details, see
-                                        <citerefentry><refentrytitle>systemd-fsck at .service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
-                                </listitem>
-                        </varlistentry>
-
-                        <varlistentry>
                                 <term><varname>fsck.repair=</varname></term>
 
                                 <listitem>
-                                        <para>Parameter understood by
+                                        <para>Parameters understood by
                                         the file system checker
                                         services. For details, see
                                         <citerefentry><refentrytitle>systemd-fsck at .service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
@@ -304,6 +307,38 @@
                         </varlistentry>
 
                         <varlistentry>
+                                <term><varname>root=</varname></term>
+                                <term><varname>rootfstype=</varname></term>
+                                <term><varname>rootfsflags=</varname></term>
+                                <term><varname>ro</varname></term>
+                                <term><varname>rw</varname></term>
+
+                                <listitem>
+                                        <para>Configures the root file
+                                        system and its file system
+                                        type and mount options, as
+                                        well as whether it shall be
+                                        mounted read-only or
+                                        read-writable initially. For
+                                        details, see
+                                        <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+                                </listitem>
+                        </varlistentry>
+
+                        <varlistentry>
+                                <term><varname>systemd.gpt_auto=</varname></term>
+                                <term><varname>rd.systemd.gpt_auto=</varname></term>
+
+                                <listitem>
+                                        <para>Configures whether GPT
+                                        based partition auto-discovery
+                                        shall be attempted. For
+                                        details, see
+                                        <citerefentry><refentrytitle>systemd-gpt-auto-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+                                </listitem>
+                        </varlistentry>
+
+                        <varlistentry>
                                 <term><varname>modules-load=</varname></term>
                                 <term><varname>rd.modules-load=</varname></term>
 
@@ -325,6 +360,7 @@
                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
                           <citerefentry><refentrytitle>bootparam</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
                           <citerefentry><refentrytitle>dracut.cmdline</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
+                          <citerefentry><refentrytitle>systemd-debug-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
                           <citerefentry><refentrytitle>systemd-fsck at .service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
                           <citerefentry><refentrytitle>systemd-quotacheck.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
                           <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
@@ -333,8 +369,9 @@
                           <citerefentry><refentrytitle>plymouth</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
                           <citerefentry><refentrytitle>systemd-cryptsetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
                           <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-                          <citerefentry><refentrytitle>systemd-modules-load.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
-                          <citerefentry><refentrytitle>systemd-backlight at .service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+                          <citerefentry><refentrytitle>systemd-gpt-auto-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+                          <citerefentry><refentrytitle>systemd-modules-load.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+                          <citerefentry><refentrytitle>systemd-backlight at .service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
                           <citerefentry><refentrytitle>systemd-rfkill at .service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
                   </para>
         </refsect1>

commit d2f42e3a9b6cc38c8a35376e551ce71ca7701da1
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 19 16:30:07 2014 +0200

    update TODO

diff --git a/TODO b/TODO
index 17f0476..ff065bf 100644
--- a/TODO
+++ b/TODO
@@ -52,8 +52,6 @@ Features:
 
 * figure out a nice way how we can let the admin know what child/sibling unit causes cgroup membership for a specific unit
 
-* add a kernel command line option to enable the debug shell
-
 * journalctl: add the ability to look for the most recent process of a binary. journalctl /usr/bin/X11 --pid=-1 or so...
 
 * set NOTIFY_SOCKET also for control processes
@@ -574,8 +572,6 @@ Features:
 
 * allow port=0 in .socket units
 
-* support systemd.mask= on the kernel command line.
-
 * recreate systemd's D-Bus private socket file on SIGUSR2
 
 * Support --test based on current system state

commit 9e01adfa90ab48e24b55a507d68768fc12e951f3
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 19 16:15:01 2014 +0200

    main: don't show help text anymore when we detect an unknown kernel cmdline value starting with "systemd."
    
    As generators and other components started to maintain their own kernel
    command line options this help text needed more and more exceptions and
    wasn't complete anyway. Fixing that would leak more information about
    specific generators into PID 1, which we should avoid.
    
    Given that kernel cmdline handling traditionally doesn't generate errors
    or show help texts, let's just remove the logic for it for systemd too.

diff --git a/src/core/main.c b/src/core/main.c
index b3ee1b9..863ba52 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -375,43 +375,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                 } else
                         log_warning("Environment variable name '%s' is not valid. Ignoring.", value);
 
-        } else if (!streq(key, "systemd.restore_state") &&
-                   !streq(key, "systemd.gpt_auto") &&
-                   (startswith(key, "systemd.") || startswith(key, "rd.systemd."))) {
-
-                const char *c;
-
-                /* Ignore systemd.journald.xyz and friends */
-                c = key;
-                if (startswith(c, "rd."))
-                        c += 3;
-                if (startswith(c, "systemd."))
-                        c += 8;
-                if (c[strcspn(c, ".=")] != '.')  {
-
-                        log_warning("Unknown kernel switch %s. Ignoring.", key);
-
-                        log_info("Supported kernel switches:\n"
-                                 "systemd.unit=UNIT                        Default unit to start\n"
-                                 "rd.systemd.unit=UNIT                     Default unit to start when run in initrd\n"
-                                 "systemd.dump_core=0|1                    Dump core on crash\n"
-                                 "systemd.crash_shell=0|1                  Run shell on crash\n"
-                                 "systemd.crash_chvt=N                     Change to VT #N on crash\n"
-                                 "systemd.confirm_spawn=0|1                Confirm every process spawn\n"
-                                 "systemd.show_status=0|1|auto             Show status updates on the console during bootup\n"
-                                 "systemd.log_target=console|kmsg|journal|journal-or-kmsg|syslog|syslog-or-kmsg|null\n"
-                                 "                                         Log target\n"
-                                 "systemd.log_level=LEVEL                  Log level\n"
-                                 "systemd.log_color=0|1                    Highlight important log messages\n"
-                                 "systemd.log_location=0|1                 Include code location in log messages\n"
-                                 "systemd.default_standard_output=null|tty|syslog|syslog+console|kmsg|kmsg+console|journal|journal+console\n"
-                                 "                                         Set default log output for services\n"
-                                 "systemd.default_standard_error=null|tty|syslog|syslog+console|kmsg|kmsg+console|journal|journal+console\n"
-                                 "                                         Set default log error output for services\n"
-                                 "systemd.setenv=ASSIGNMENT                Set an environment variable for all spawned processes\n"
-                                 "systemd.restore_state=0|1                Restore backlight/rfkill state at boot\n");
-                }
-
         } else if (streq(key, "quiet") && !value) {
 
                 log_set_max_level(LOG_NOTICE);

commit ca05941b9a6d7855bda2a7cb2cc16bbd3911acdd
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 19 16:14:56 2014 +0200

    main: honour rd.systemd.unit= only in the initrd, not the host

diff --git a/src/core/main.c b/src/core/main.c
index c4dfe8c..b3ee1b9 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -286,7 +286,8 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
 
         } else if (streq(key, "rd.systemd.unit") && value) {
 
-                return set_default_unit(value);
+                if (in_initrd())
+                        return set_default_unit(value);
 
         } else if (streq(key, "systemd.log_target") && value) {
 

commit e34eee2c4f482078c2d6d257d3595e00df4d874e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 19 16:13:36 2014 +0200

    gitignore: sort properly

diff --git a/.gitignore b/.gitignore
index fb4c209..17aba99 100644
--- a/.gitignore
+++ b/.gitignore
@@ -72,14 +72,14 @@
 /systemd-hostnamed
 /systemd-inhibit
 /systemd-initctl
+/systemd-journald
 /systemd-journal-gatewayd
 /systemd-journal-remote
-/systemd-journald
 /systemd-kmsg-syslogd
 /systemd-localed
 /systemd-logind
-/systemd-machine-id-setup
 /systemd-machined
+/systemd-machine-id-setup
 /systemd-modules-load
 /systemd-multi-seat-x
 /systemd-networkd
@@ -118,10 +118,10 @@
 /test-architecture
 /test-boot-timestamp
 /test-bus-chat
+/test-bus-cleanup
 /test-bus-creds
 /test-bus-error
 /test-bus-gvariant
-/test-bus-cleanup
 /test-bus-introspect
 /test-bus-kernel
 /test-bus-kernel-benchmark
@@ -142,9 +142,8 @@
 /test-date
 /test-device-nodes
 /test-dhcp-client
-/test-dhcp-server
 /test-dhcp-option
-/test-resolve
+/test-dhcp-server
 /test-ellipsize
 /test-engine
 /test-env-replace
@@ -187,8 +186,10 @@
 /test-path-util
 /test-prioq
 /test-replace-var
+/test-resolve
 /test-ring
 /test-rtnl
+/test-rtnl-manual
 /test-sched-prio
 /test-sleep
 /test-socket-util
@@ -198,7 +199,6 @@
 /test-strv
 /test-strxcpyx
 /test-tables
-/test-rtnl-manual
 /test-time
 /test-tmpfiles
 /test-udev

commit 326bb68c40ff2a7119c344b9ab7a7473f9fcdf3c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 19 16:10:55 2014 +0200

    debug-generator: add new generator
    
    debug-generator can mask specific units if they are specified on the
    kernel command line with systemd.mask=.
    
    debug-generator can pull in debug-shell.service is systemd.debug-shell
    is passed on the kernel command line.

diff --git a/.gitignore b/.gitignore
index 66fa09d..fb4c209 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,6 +60,7 @@
 /systemd-cryptsetup
 /systemd-cryptsetup-generator
 /systemd-dbus1-generator
+/systemd-debug-generator
 /systemd-delta
 /systemd-detect-virt
 /systemd-efi-boot-generator
diff --git a/Makefile.am b/Makefile.am
index bafb80e..06105bd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -371,7 +371,8 @@ rootlibexec_PROGRAMS = \
 systemgenerator_PROGRAMS = \
 	systemd-getty-generator \
 	systemd-fstab-generator \
-	systemd-system-update-generator
+	systemd-system-update-generator \
+	systemd-debug-generator
 
 dist_bashcompletion_DATA = \
 	shell-completion/bash/busctl \
@@ -1892,6 +1893,14 @@ systemd_getty_generator_LDADD = \
 	libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
+systemd_debug_generator_SOURCES = \
+	src/debug-generator/debug-generator.c
+
+systemd_debug_generator_LDADD = \
+	libsystemd-label.la \
+	libsystemd-shared.la
+
+# ------------------------------------------------------------------------------
 systemd_fstab_generator_SOURCES = \
 	src/fstab-generator/fstab-generator.c \
 	src/core/mount-setup.c
diff --git a/src/debug-generator/Makefile b/src/debug-generator/Makefile
new file mode 120000
index 0000000..d0b0e8e
--- /dev/null
+++ b/src/debug-generator/Makefile
@@ -0,0 +1 @@
+../Makefile
\ No newline at end of file
diff --git a/src/debug-generator/debug-generator.c b/src/debug-generator/debug-generator.c
new file mode 100644
index 0000000..cefac89
--- /dev/null
+++ b/src/debug-generator/debug-generator.c
@@ -0,0 +1,137 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+  This file is part of systemd.
+
+  Copyright 2014 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 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
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include "util.h"
+#include "strv.h"
+#include "unit-name.h"
+#include "mkdir.h"
+
+static const char *arg_dest = "/tmp";
+static char **arg_mask = NULL;
+static bool arg_debug_shell = false;
+
+static int parse_proc_cmdline_item(const char *key, const char *value) {
+        int r;
+
+        if (streq(key, "systemd.mask")) {
+
+                if (!value)
+                        log_error("Missing argument for systemd.mask= kernel command line parameter.");
+                else {
+                        char *n;
+
+                        n = strdup(value);
+                        if (!n)
+                                return log_oom();
+
+                        r = strv_consume(&arg_mask, n);
+                        if (r < 0)
+                                return log_oom();
+                }
+        } else if (streq(key, "systemd.debug-shell")) {
+
+                if (value) {
+                        r = parse_boolean(value);
+                        if (r < 0)
+                                log_error("Failed to parse systemd.debug-shell= argument '%s', ignoring.", value);
+                        else
+                                arg_debug_shell = r;
+                } else
+                        arg_debug_shell = true;
+        }
+
+        return 0;
+}
+
+static int generate_mask_symlinks(void) {
+        char **u;
+        int r = 0;
+
+        if (strv_isempty(arg_mask))
+                return 0;
+
+        STRV_FOREACH(u, arg_mask) {
+                _cleanup_free_ char *m = NULL, *p = NULL;
+
+                m = unit_name_mangle(*u, MANGLE_NOGLOB);
+                if (!m)
+                        return log_oom();
+
+                p = strjoin(arg_dest, "/", m, NULL);
+                if (!p)
+                        return log_oom();
+
+                if (symlink("/dev/null", p) < 0) {
+                        log_error("Failed to create mask symlink %s: %m", p);
+                        r = -errno;
+                }
+        }
+
+        return r;
+}
+
+static int generate_debug_shell_symlink(void) {
+        const char *p;
+
+        if (!arg_debug_shell)
+                return 0;
+
+        p = strappenda(arg_dest, "/default.target.wants/debug-shell.service");
+
+        mkdir_parents_label(p, 0755);
+
+        if (symlink(SYSTEM_DATA_UNIT_PATH "/debug-shell.service", p) < 0) {
+                log_error("Failed to create %s symlink: %m", p);
+                return -errno;
+        }
+
+        return 0;
+}
+
+int main(int argc, char *argv[]) {
+        int r, q;
+
+        if (argc > 1 && argc != 4) {
+                log_error("This program takes three or no arguments.");
+                return EXIT_FAILURE;
+        }
+
+        if (argc > 1)
+                arg_dest = argv[2];
+
+        log_set_target(LOG_TARGET_SAFE);
+        log_parse_environment();
+        log_open();
+
+        umask(0022);
+
+        if (parse_proc_cmdline(parse_proc_cmdline_item) < 0)
+                return EXIT_FAILURE;
+
+        r = generate_mask_symlinks();
+
+        q = generate_debug_shell_symlink();
+        if (q < 0)
+                r = q;
+
+        return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+
+}



More information about the systemd-commits mailing list