[systemd-commits] 5 commits - man/systemctl.xml man/systemd.mount.xml man/systemd.service.xml man/systemd.socket.xml man/systemd.swap.xml src/dbus-manager.c src/execute.c src/execute.h src/manager.c src/manager.h src/mount.c src/service.c src/service.h src/socket.c src/swap.c src/systemctl-bash-completion.sh src/unit.c TODO units/console-shell.service.m4 units/emergency.service units/getty at .service.m4 units/rescue.service.m4 units/serial-getty at .service.m4

Lennart Poettering lennart at kemper.freedesktop.org
Tue Mar 29 15:48:56 PDT 2011


 TODO                             |   12 ++----------
 man/systemctl.xml                |    8 +++-----
 man/systemd.mount.xml            |    1 -
 man/systemd.service.xml          |    5 -----
 man/systemd.socket.xml           |    1 -
 man/systemd.swap.xml             |    1 -
 src/dbus-manager.c               |    2 +-
 src/execute.c                    |    1 -
 src/execute.h                    |    1 -
 src/manager.c                    |    2 ++
 src/manager.h                    |    2 ++
 src/mount.c                      |    6 ++----
 src/service.c                    |   28 +++++++++++++++-------------
 src/service.h                    |    1 +
 src/socket.c                     |    6 ++----
 src/swap.c                       |    6 ++----
 src/systemctl-bash-completion.sh |    2 +-
 src/unit.c                       |    4 +++-
 units/console-shell.service.m4   |    2 +-
 units/emergency.service          |    2 +-
 units/getty at .service.m4          |    2 +-
 units/rescue.service.m4          |    2 +-
 units/serial-getty at .service.m4   |    2 +-
 23 files changed, 41 insertions(+), 58 deletions(-)

New commits:
commit 72bc8d005654ad30838edfe9373109a49cc29448
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Mar 30 00:47:50 2011 +0200

    manager: fix taint check for /usr

diff --git a/TODO b/TODO
index 4759fcd..59bd213 100644
--- a/TODO
+++ b/TODO
@@ -27,10 +27,10 @@ F15:
 
 * LOG_DAEMON/LOG_USER für kmsg messages schreiben
 
-* fix /usr taint
-
 * disable /dev/console status messages after plymouth went down
 
+* quotacheck pulled in too often
+
 Features:
 
 * when key file cannot be found, read it from kbd in cryptsetup
diff --git a/src/dbus-manager.c b/src/dbus-manager.c
index c21cb5f..a2a25b7 100644
--- a/src/dbus-manager.c
+++ b/src/dbus-manager.c
@@ -223,7 +223,7 @@ static int bus_manager_append_tainted(Manager *m, DBusMessageIter *i, const char
         assert(i);
         assert(property);
 
-        if (dir_is_empty("/usr") > 0)
+        if (m->taint_usr)
                 e = stpcpy(e, "usr-separate-fs");
 
         if (readlink_malloc("/etc/mtab", &p) < 0) {
diff --git a/src/manager.c b/src/manager.c
index 69d231a..faf30dc 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -278,6 +278,8 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) {
                 log_error("Failed to connect to audit log: %m");
 #endif
 
+        m->taint_usr = dir_is_empty("/usr") > 0;
+
         *_m = m;
         return 0;
 
diff --git a/src/manager.h b/src/manager.h
index c183e10..4b405d6 100644
--- a/src/manager.h
+++ b/src/manager.h
@@ -211,6 +211,8 @@ struct Manager {
         bool dispatching_run_queue:1;
         bool dispatching_dbus_queue:1;
 
+        bool taint_usr:1;
+
         bool show_status;
         bool confirm_spawn;
 #ifdef HAVE_SYSV_COMPAT

commit ea87ca5a9ee9c82b456a54747d442c715ff26bee
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Mar 30 00:43:16 2011 +0200

    unit: never apply /etc/rcN.d/ priority to native services

diff --git a/TODO b/TODO
index 4302eee..4759fcd 100644
--- a/TODO
+++ b/TODO
@@ -2,8 +2,6 @@ F15:
 
 * swap units that are activated by one name but shown in the kernel under another are semi-broken
 
-* dep cycle basic → udev-retry → auditd → iptables → basic
-
 * isolate multi-user.target doesn't start a getty at tty1 if we run it from graphical.target
 
 * NFS, networkmanager ordering issue (PENDING)
diff --git a/src/service.c b/src/service.c
index fd3a9c9..c74e8a0 100644
--- a/src/service.c
+++ b/src/service.c
@@ -115,6 +115,7 @@ static void service_init(Unit *u) {
         s->timer_watch.type = WATCH_INVALID;
 #ifdef HAVE_SYSV_COMPAT
         s->sysv_start_priority = -1;
+        s->sysv_start_priority_from_rcnd = -1;
 #endif
         s->socket_fd = -1;
         s->guess_main_pid = true;
@@ -537,7 +538,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
                                  * data from the LSB header. */
                                 if (start_priority < 0 || start_priority > 99)
                                         log_warning("[%s:%u] Start priority out of range. Ignoring.", path, line);
-                                else if (s->sysv_start_priority < 0)
+                                else
                                         s->sysv_start_priority = start_priority;
 
                                 char_array_0(runlevels);
@@ -853,6 +854,12 @@ static int service_load_sysv_path(Service *s, const char *path) {
                 u->meta.description = d;
         }
 
+        /* The priority that has been set in /etc/rcN.d/ hierarchies
+         * takes precedence over what is stored as default in the LSB
+         * header */
+        if (s->sysv_start_priority_from_rcnd >= 0)
+                s->sysv_start_priority = s->sysv_start_priority_from_rcnd;
+
         u->meta.load_state = UNIT_LOADED;
         r = 0;
 
@@ -3009,8 +3016,8 @@ static int service_enumerate(Manager *m) {
                                 if (de->d_name[0] == 'S')  {
 
                                         if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) {
-                                                SERVICE(service)->sysv_start_priority =
-                                                        MAX(a*10 + b, SERVICE(service)->sysv_start_priority);
+                                                SERVICE(service)->sysv_start_priority_from_rcnd =
+                                                        MAX(a*10 + b, SERVICE(service)->sysv_start_priority_from_rcnd);
 
                                                 SERVICE(service)->sysv_enabled = true;
                                         }
diff --git a/src/service.h b/src/service.h
index 627b356..e3cb431 100644
--- a/src/service.h
+++ b/src/service.h
@@ -138,6 +138,7 @@ struct Service {
 #ifdef HAVE_SYSV_COMPAT
         bool sysv_has_lsb:1;
         bool sysv_enabled:1;
+        int sysv_start_priority_from_rcnd;
         int sysv_start_priority;
 
         char *sysv_path;

commit efbac6d29c374696fba8f501b6f080e79584cc94
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Mar 29 23:32:31 2011 +0200

    unit: fix parsing of condition-result

diff --git a/src/unit.c b/src/unit.c
index 40aae75..a2953a6 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -2180,6 +2180,8 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
                                 log_debug("Failed to parse condition result value %s", v);
                         else
                                 u->meta.condition_result = b;
+
+                        continue;
                 }
 
                 if ((r = UNIT_VTABLE(u)->deserialize_item(u, l, v, fds)) < 0)

commit d325ef27a7d482a57a1ce3d8c85e2c91be398c9a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Mar 29 23:32:10 2011 +0200

    unit: don't complain about failed units when deserializing

diff --git a/src/unit.c b/src/unit.c
index 68eba69..40aae75 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -1211,7 +1211,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
                         retroactively_stop_dependencies(u);
         }
 
-        if (ns != os && ns == UNIT_FAILED) {
+        if (ns != os && ns == UNIT_FAILED && u->meta.manager->n_deserializing <= 0) {
                 log_notice("Unit %s entered failed state.", u->meta.id);
                 unit_trigger_on_failure(u);
         }

commit cd25cce98f5cc930202212c3c9c13605c09698b4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Mar 29 23:31:38 2011 +0200

    exec: drop process group kill mode since it has little use and confuses the user

diff --git a/TODO b/TODO
index eeb6c07..4302eee 100644
--- a/TODO
+++ b/TODO
@@ -12,8 +12,6 @@ F15:
 
 * hook emergency.target into local-fs.target in some way as OnFailure with isolate
 
-* drop SIGHUP handling from rsyslog.service upstream (PENDING)
-
 * teach dbus to activate all services it finds in /etc/systemd/services/org-*.service
 
 * save/restore tool for SysV as requested by FPC (PENDING)
@@ -27,8 +25,6 @@ F15:
 
 * document default dependencies
 
-* remove KillMode=process-group
-
 * kernel patch wegen kmsg prio nach f15
 
 * LOG_DAEMON/LOG_USER für kmsg messages schreiben
@@ -41,8 +37,6 @@ Features:
 
 * when key file cannot be found, read it from kbd in cryptsetup
 
-* hide passwords on TAB
-
 * get rid of random file name in generator directory?
     /run/systemd/generator-IH1vFu
 
diff --git a/man/systemctl.xml b/man/systemctl.xml
index 535f9bd..922fd2d 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -304,13 +304,11 @@
                                 <command>kill</command>, choose the
                                 mode how to kill the selected
                                 processes. Must be one of
-                                <option>control-group</option>,
-                                <option>process-group</option> or
+                                <option>control-group</option> or
                                 <option>process</option> to select
                                 whether to kill the entire control
-                                group, the process group or only the
-                                selected process itself. If omitted
-                                defaults to
+                                group or only the selected process
+                                itself. If omitted defaults to
                                 <option>control-group</option> if
                                 <option>--kill-who=all</option> is
                                 set, or <option>process</option>
diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml
index c7045e8..dd66d2a 100644
--- a/man/systemd.mount.xml
+++ b/man/systemd.mount.xml
@@ -221,7 +221,6 @@
                                 processes of this mount shall be
                                 killed. One of
                                 <option>control-group</option>,
-                                <option>process-group</option>,
                                 <option>process</option>,
                                 <option>none</option>.</para>
 
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index e444efe..7458720 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -558,7 +558,6 @@
                                 processes of this service shall be
                                 killed. One of
                                 <option>control-group</option>,
-                                <option>process-group</option>,
                                 <option>process</option>,
                                 <option>none</option>.</para>
 
@@ -570,10 +569,6 @@
                                 stop command (as configured with
                                 <varname>ExecStop=</varname>) is
                                 executed. If set to
-                                <option>process-group</option> only
-                                the members of the process group of
-                                the main service process are
-                                killed. If set to
                                 <option>process</option> only the main
                                 process itself is killed. If set to
                                 <option>none</option> no process is
diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml
index 3b7581c..8cbb512 100644
--- a/man/systemd.socket.xml
+++ b/man/systemd.socket.xml
@@ -519,7 +519,6 @@
                                 processes of this socket unit shall be
                                 killed. One of
                                 <option>control-group</option>,
-                                <option>process-group</option>,
                                 <option>process</option>,
                                 <option>none</option>.</para>
 
diff --git a/man/systemd.swap.xml b/man/systemd.swap.xml
index d95e39e..3277ddb 100644
--- a/man/systemd.swap.xml
+++ b/man/systemd.swap.xml
@@ -175,7 +175,6 @@
                                 processes of this swap shall be
                                 killed. One of
                                 <option>control-group</option>,
-                                <option>process-group</option>,
                                 <option>process</option>,
                                 <option>none</option>.</para>
 
diff --git a/src/execute.c b/src/execute.c
index a467411..cd44640 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -1933,7 +1933,6 @@ DEFINE_STRING_TABLE_LOOKUP(exec_output, ExecOutput);
 
 static const char* const kill_mode_table[_KILL_MODE_MAX] = {
         [KILL_CONTROL_GROUP] = "control-group",
-        [KILL_PROCESS_GROUP] = "process-group",
         [KILL_PROCESS] = "process",
         [KILL_NONE] = "none"
 };
diff --git a/src/execute.h b/src/execute.h
index 44856d1..208fe4a 100644
--- a/src/execute.h
+++ b/src/execute.h
@@ -43,7 +43,6 @@ struct CGroupBonding;
 
 typedef enum KillMode {
         KILL_CONTROL_GROUP = 0,
-        KILL_PROCESS_GROUP,
         KILL_PROCESS,
         KILL_NONE,
         _KILL_MODE_MAX,
diff --git a/src/mount.c b/src/mount.c
index cc49b19..8528d17 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -747,9 +747,7 @@ static void mount_enter_signal(Mount *m, MountState state, bool success) {
                            state == MOUNT_REMOUNTING_SIGTERM) ? m->exec_context.kill_signal : SIGKILL;
 
                 if (m->control_pid > 0) {
-                        if (kill_and_sigcont(m->exec_context.kill_mode == KILL_PROCESS_GROUP ?
-                                             -m->control_pid :
-                                             m->control_pid, sig) < 0 && errno != ESRCH)
+                        if (kill_and_sigcont(m->control_pid, sig) < 0 && errno != ESRCH)
 
                                 log_warning("Failed to kill control process %li: %m", (long) m->control_pid);
                         else
@@ -1684,7 +1682,7 @@ static int mount_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError
         }
 
         if (m->control_pid > 0)
-                if (kill(mode == KILL_PROCESS_GROUP ? -m->control_pid : m->control_pid, signo) < 0)
+                if (kill(m->control_pid, signo) < 0)
                         r = -errno;
 
         if (mode == KILL_CONTROL_GROUP) {
diff --git a/src/service.c b/src/service.c
index 1735a96..fd3a9c9 100644
--- a/src/service.c
+++ b/src/service.c
@@ -828,7 +828,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
         s->exec_context.std_output =
                 (s->meta.manager->sysv_console || s->exec_context.std_input == EXEC_INPUT_TTY)
                 ? EXEC_OUTPUT_TTY : s->meta.manager->default_std_output;
-        s->exec_context.kill_mode = KILL_PROCESS_GROUP;
+        s->exec_context.kill_mode = KILL_PROCESS;
 
         /* We use the long description only if
          * no short description is set. */
@@ -1838,19 +1838,14 @@ static void service_enter_signal(Service *s, ServiceState state, bool success) {
                 int sig = (state == SERVICE_STOP_SIGTERM || state == SERVICE_FINAL_SIGTERM) ? s->exec_context.kill_signal : SIGKILL;
 
                 if (s->main_pid > 0) {
-                        if (kill_and_sigcont(s->exec_context.kill_mode == KILL_PROCESS_GROUP ?
-                                             -s->main_pid :
-                                             s->main_pid, sig) < 0 && errno != ESRCH)
-
+                        if (kill_and_sigcont(s->main_pid, sig) < 0 && errno != ESRCH)
                                 log_warning("Failed to kill main process %li: %m", (long) s->main_pid);
                         else
                                 wait_for_exit = true;
                 }
 
                 if (s->control_pid > 0) {
-                        if (kill_and_sigcont(s->exec_context.kill_mode == KILL_PROCESS_GROUP ?
-                                             -s->control_pid :
-                                             s->control_pid, sig) < 0 && errno != ESRCH)
+                        if (kill_and_sigcont(s->control_pid, sig) < 0 && errno != ESRCH)
 
                                 log_warning("Failed to kill control process %li: %m", (long) s->control_pid);
                         else
@@ -3212,11 +3207,11 @@ static int service_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusErro
         }
 
         if (s->control_pid > 0)
-                if (kill(mode == KILL_PROCESS_GROUP ? -s->control_pid : s->control_pid, signo) < 0)
+                if (kill(s->control_pid, signo) < 0)
                         r = -errno;
 
         if (s->main_pid > 0)
-                if (kill(mode == KILL_PROCESS_GROUP ? -s->main_pid : s->main_pid, signo) < 0)
+                if (kill(s->main_pid, signo) < 0)
                         r = -errno;
 
         if (mode == KILL_CONTROL_GROUP) {
diff --git a/src/socket.c b/src/socket.c
index 9045a2f..72be0e2 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -1040,9 +1040,7 @@ static void socket_enter_signal(Socket *s, SocketState state, bool success) {
                 int sig = (state == SOCKET_STOP_PRE_SIGTERM || state == SOCKET_FINAL_SIGTERM) ? s->exec_context.kill_signal : SIGKILL;
 
                 if (s->control_pid > 0) {
-                        if (kill_and_sigcont(s->exec_context.kill_mode == KILL_PROCESS_GROUP ?
-                                             -s->control_pid :
-                                             s->control_pid, sig) < 0 && errno != ESRCH)
+                        if (kill_and_sigcont(s->control_pid, sig) < 0 && errno != ESRCH)
 
                                 log_warning("Failed to kill control process %li: %m", (long) s->control_pid);
                         else
@@ -1837,7 +1835,7 @@ static int socket_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError
         }
 
         if (s->control_pid > 0)
-                if (kill(mode == KILL_PROCESS_GROUP ? -s->control_pid : s->control_pid, signo) < 0)
+                if (kill(s->control_pid, signo) < 0)
                         r = -errno;
 
         if (mode == KILL_CONTROL_GROUP) {
diff --git a/src/swap.c b/src/swap.c
index 035efba..66bf5c2 100644
--- a/src/swap.c
+++ b/src/swap.c
@@ -661,9 +661,7 @@ static void swap_enter_signal(Swap *s, SwapState state, bool success) {
                            state == SWAP_DEACTIVATING_SIGTERM) ? s->exec_context.kill_signal : SIGKILL;
 
                 if (s->control_pid > 0) {
-                        if (kill_and_sigcont(s->exec_context.kill_mode == KILL_PROCESS_GROUP ?
-                                             -s->control_pid :
-                                             s->control_pid, sig) < 0 && errno != ESRCH)
+                        if (kill_and_sigcont(s->control_pid, sig) < 0 && errno != ESRCH)
 
                                 log_warning("Failed to kill control process %li: %m", (long) s->control_pid);
                         else
@@ -1286,7 +1284,7 @@ static int swap_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError *
         }
 
         if (s->control_pid > 0)
-                if (kill(mode == KILL_PROCESS_GROUP ? -s->control_pid : s->control_pid, signo) < 0)
+                if (kill(s->control_pid, signo) < 0)
                         r = -errno;
 
         if (mode == KILL_CONTROL_GROUP) {
diff --git a/src/systemctl-bash-completion.sh b/src/systemctl-bash-completion.sh
index f342021..ae0ecb7 100644
--- a/src/systemctl-bash-completion.sh
+++ b/src/systemctl-bash-completion.sh
@@ -60,7 +60,7 @@ _systemctl () {
                                 comps='all control main'
                         ;;
                         --kill-mode)
-                                comps='control-group process process-group'
+                                comps='control-group process'
                         ;;
                         --property|-p)
                                 comps=''
diff --git a/units/console-shell.service.m4 b/units/console-shell.service.m4
index c98a08f..cce2d5a 100644
--- a/units/console-shell.service.m4
+++ b/units/console-shell.service.m4
@@ -31,7 +31,7 @@ WorkingDirectory=/root
 ExecStart=-/sbin/sulogin
 ExecStopPost=-/bin/systemctl poweroff
 StandardInput=tty-force
-KillMode=process-group
+KillMode=process
 
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
diff --git a/units/emergency.service b/units/emergency.service
index cb28a78..a97ec5e 100644
--- a/units/emergency.service
+++ b/units/emergency.service
@@ -21,7 +21,7 @@ ExecStartPre=-/bin/echo 'Welcome to emergency mode. Use "systemctl default" or ^
 ExecStart=-/sbin/sulogin
 ExecStopPost=/bin/systemctl --fail default
 StandardInput=tty-force
-KillMode=process-group
+KillMode=process
 
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
index 1a8a6a0..a9733a6 100644
--- a/units/getty at .service.m4
+++ b/units/getty at .service.m4
@@ -36,7 +36,7 @@ ExecStart=-/sbin/agetty %I 38400
 Restart=always
 RestartSec=0
 UtmpIdentifier=%I
-KillMode=process-group
+KillMode=process
 
 # Unset locale for the console getty since the console has problems
 # displaying some internationalized messages.
diff --git a/units/rescue.service.m4 b/units/rescue.service.m4
index 969ac47..241c750 100644
--- a/units/rescue.service.m4
+++ b/units/rescue.service.m4
@@ -28,7 +28,7 @@ ExecStart=-/bin/bash -c "exec ${SINGLE}"',
 `ExecStart=-/sbin/sulogin'))
 ExecStopPost=-/bin/systemctl --fail default
 StandardInput=tty-force
-KillMode=process-group
+KillMode=process
 
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
diff --git a/units/serial-getty at .service.m4 b/units/serial-getty at .service.m4
index d42330a..8b4f0fb 100644
--- a/units/serial-getty at .service.m4
+++ b/units/serial-getty at .service.m4
@@ -36,7 +36,7 @@ ExecStart=-/sbin/agetty -s %I 115200,38400,9600
 Restart=always
 RestartSec=0
 UtmpIdentifier=%I
-KillMode=process-group
+KillMode=process
 
 # Some login implementations ignore SIGTERM, so we send SIGHUP
 # instead, to ensure that login terminates cleanly.



More information about the systemd-commits mailing list