[systemd-commits] 5 commits - TODO src/login src/machine src/nspawn system-preset/90-systemd.preset

Lennart Poettering lennart at kemper.freedesktop.org
Mon Dec 29 11:18:42 PST 2014


 TODO                            |    4 ----
 src/login/logind-dbus.c         |    5 +++--
 src/machine/machine.c           |   10 ++++------
 src/machine/machine.h           |    1 -
 src/machine/machined-dbus.c     |    4 ++--
 src/nspawn/nspawn.c             |   10 +++++-----
 system-preset/90-systemd.preset |    2 ++
 7 files changed, 16 insertions(+), 20 deletions(-)

New commits:
commit e624676ddef0a7d6996c5acdb7d84155b23001a7
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Dec 29 20:18:04 2014 +0100

    update TODO

diff --git a/TODO b/TODO
index 6c0b05a..5845031 100644
--- a/TODO
+++ b/TODO
@@ -47,8 +47,6 @@ Features:
 
 * "machinectl status" should show 10 most recent log lines of both the host logs of the unit of the machine, plus the logs generated in the machine
 
-* machinectl terminate doesn't work
-
 * add transparent btrfs pool in a loopback file in /var if btrfs operations (such as systemd-import pull-dkr) are used and /var is not a btrfs file system
 
 * systemd-nspawn -x should support ephemeral instances of gpt images
@@ -582,8 +580,6 @@ Features:
 * nspawn:
   - bind mount read-only the cgroup tree higher than nspawn
   - refuses to boot containers without /etc/machine-id (OK?), and with empty /etc/machine-id (not OK).
-  - systemd-nspawn at .service should fail if some nspawn arg is invalid, with Type=notify
-  - PID 1 doesn't apply nspawns devices cgroup policy
 
 * cryptsetup:
   - cryptsetup-generator: allow specification of passwords in crypttab itself

commit c00a4c8f55e51be98274e86beba14117e25dab9c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Dec 29 20:00:01 2014 +0100

    Revert "machined: don't force terminate registered machines"
    
    This reverts commit 206e7a5f7b55ac61188efd895e65ab26e478cbb2.
    
    We actually want to allow shutting down containers that use
    RegisterMachine() rather than CreateMachine() to register their own
    unit. It should be safe to do so, since the primary usecase for
    RegisterMachine() are container managers that run only a single
    container within their own unit, such as systemd-nspawn.

diff --git a/src/machine/machine.c b/src/machine/machine.c
index 8dec716..b283118 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -406,12 +406,10 @@ static int machine_stop_scope(Machine *m) {
         if (!m->unit)
                 return 0;
 
-        if (!m->registered) {
-                r = manager_stop_unit(m->manager, m->unit, &error, &job);
-                if (r < 0) {
-                        log_error("Failed to stop machine scope: %s", bus_error_message(&error, r));
-                        return r;
-                }
+        r = manager_stop_unit(m->manager, m->unit, &error, &job);
+        if (r < 0) {
+                log_error("Failed to stop machine scope: %s", bus_error_message(&error, r));
+                return r;
         }
 
         free(m->scope_job);
diff --git a/src/machine/machine.h b/src/machine/machine.h
index 64accda..4827ba3 100644
--- a/src/machine/machine.h
+++ b/src/machine/machine.h
@@ -72,7 +72,6 @@ struct Machine {
 
         bool in_gc_queue:1;
         bool started:1;
-        bool registered:1;
 
         sd_bus_message *create_message;
 
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index b894e0b..233c6e8 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -354,8 +354,6 @@ static int method_register_machine_internal(sd_bus *bus, sd_bus_message *message
                 goto fail;
         }
 
-        m->registered = true;
-
         r = machine_start(m, NULL, error);
         if (r < 0)
                 goto fail;

commit e5f5b5b9c92d59ef3cb5169982cb6f436c9206fa
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Dec 29 19:08:50 2014 +0100

    machined: ignore spurious error

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 26ce8fe..bbb4ae2 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2111,9 +2111,10 @@ int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdat
                 return 0;
 
         r = unit_name_from_dbus_path(path, &unit);
+        if (r == -EINVAL) /* not a unit */
+                return 0;
         if (r < 0)
-                /* quietly ignore non-units paths */
-                return r == -EINVAL ? 0 : r;
+                return r;
 
         session = hashmap_get(m->session_units, unit);
         if (session)
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 94dd128..b894e0b 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -738,6 +738,8 @@ int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdat
                 return 0;
 
         r = unit_name_from_dbus_path(path, &unit);
+        if (r == -EINVAL) /* not for a unit */
+                return 0;
         if (r < 0)
                 return r;
 

commit 814a3fdfdc8cd94797eff5f3e1d9a3cc032d880a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Dec 29 17:54:04 2014 +0100

    nspawn: report back to systemd only very late whether we are OK
    
    That way, systemd can actually figure out if everything is OK with
    nspawn.

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index f255e57..6aaceac 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -3132,10 +3132,6 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        sd_notify(false,
-                  "READY=1\n"
-                  "STATUS=Container running.");
-
         assert_se(sigemptyset(&mask) == 0);
         sigset_add_many(&mask, SIGCHLD, SIGWINCH, SIGTERM, SIGINT, -1);
         assert_se(sigprocmask(SIG_BLOCK, &mask, NULL) == 0);
@@ -3517,7 +3513,11 @@ int main(int argc, char *argv[]) {
                         /* Notify the child that the parent is ready with all
                          * its setup, and that the child can now hand over
                          * control to the code to run inside the container. */
-                        (void)barrier_place(&barrier);
+                        (void) barrier_place(&barrier);
+
+                        sd_notify(false,
+                                  "READY=1\n"
+                                  "STATUS=Container running.");
 
                         r = sd_event_new(&event);
                         if (r < 0) {

commit f252d3fb2b5e51b047619e819e05ec61924d3a8c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Dec 29 17:36:57 2014 +0100

    preset: enable machines.target by default

diff --git a/system-preset/90-systemd.preset b/system-preset/90-systemd.preset
index ada9dbb..ee1b864 100644
--- a/system-preset/90-systemd.preset
+++ b/system-preset/90-systemd.preset
@@ -9,6 +9,8 @@
 # generally follow a default-off policy.
 
 enable remote-fs.target
+enable machines.target
+
 enable getty at .service
 enable systemd-timesyncd.service
 enable systemd-networkd.service



More information about the systemd-commits mailing list