[systemd-commits] 3 commits - TODO man/systemd.unit.xml src/core src/login src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Mon May 21 06:28:17 PDT 2012


 TODO                                  |   14 ++++++++
 man/systemd.unit.xml                  |    2 +
 src/core/load-fragment-gperf.gperf.m4 |    1 
 src/login/logind-session.c            |    2 -
 src/shared/install.c                  |   57 +++++++++++++++++++++++++++++++---
 5 files changed, 70 insertions(+), 6 deletions(-)

New commits:
commit b86fa936ce36976cd6a96034cf14ea267695bcb2
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon May 21 15:28:07 2012 +0200

    update TODO

diff --git a/TODO b/TODO
index 64e6d0e..1f60911 100644
--- a/TODO
+++ b/TODO
@@ -23,6 +23,8 @@ Bugfixes:
 
 Features:
 
+* in rescue mode don't pull in sockets
+
 * Document boot options such as forcefsck
 
 * beef up links between systemctl output and man pages. i.e. add a new unit
@@ -33,6 +35,18 @@ Features:
         - implement .d/ auto includes for unit files
         - add syntax to reset ExecStart= lists (and similar)
 
+* properly detect mimo devices, the current VID/PID check is too broad
+
+* introduce upgrade.target for offline upgrades
+
+* manipulate CPU governor during boot, set it to performance
+
+* steal SBF management from the kernel
+
+* delay journal /var writeout to after boot if SBF is clean
+
+* move passno parsing to fstab generator
+
 * actually queue the new default unit after switch-root
 
 * remove old root in switch-root logic

commit 78d54bd42b87818f5d0ef862d247f9db4844fadd
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon May 21 15:27:26 2012 +0200

    unit: introduce RequiredBy= setting in [Install], to complement WantedBy=

diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index dbc5fed..c0da652 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -951,9 +951,11 @@
 
                         <varlistentry>
                                 <term><varname>WantedBy=</varname></term>
+                                <term><varname>RequiredBy=</varname></term>
 
                                 <listitem><para>Installs a symlink in
                                 the <filename>.wants/</filename>
+                                resp. <filename>.requires/</filename>
                                 subdirectory for a unit. This has the
                                 effect that when the listed unit name
                                 is activated the unit listing it is
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index f0e25c0..5be4dad 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -230,4 +230,5 @@ Path.DirectoryMode,              config_parse_mode,                  0,
 m4_dnl The [Install] section is ignored here.
 Install.Alias,                   NULL,                               0,                             0
 Install.WantedBy,                NULL,                               0,                             0
+Install.RequiredBy,              NULL,                               0,                             0
 Install.Also,                    NULL,                               0,                             0
diff --git a/src/shared/install.c b/src/shared/install.c
index 560bb24..d6644e5 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -43,6 +43,7 @@ typedef struct {
 
         char **aliases;
         char **wanted_by;
+        char **required_by;
 } InstallInfo;
 
 typedef struct {
@@ -883,6 +884,7 @@ static void install_info_free(InstallInfo *i) {
         free(i->path);
         strv_free(i->aliases);
         strv_free(i->wanted_by);
+        strv_free(i->required_by);
         free(i);
 }
 
@@ -1021,9 +1023,10 @@ static int unit_file_load(
                 bool allow_symlink) {
 
         const ConfigTableItem items[] = {
-                { "Install", "Alias",    config_parse_strv, 0, &info->aliases   },
-                { "Install", "WantedBy", config_parse_strv, 0, &info->wanted_by },
-                { "Install", "Also",     config_parse_also, 0, c                },
+                { "Install", "Alias",      config_parse_strv, 0, &info->aliases     },
+                { "Install", "WantedBy",   config_parse_strv, 0, &info->wanted_by   },
+                { "Install", "RequiredBy", config_parse_strv, 0, &info->required_by },
+                { "Install", "Also",       config_parse_also, 0, c                  },
                 { NULL, NULL, NULL, 0, NULL }
         };
 
@@ -1050,7 +1053,10 @@ static int unit_file_load(
         if (r < 0)
                 return r;
 
-        return strv_length(info->aliases) + strv_length(info->wanted_by);
+        return
+                strv_length(info->aliases) +
+                strv_length(info->wanted_by) +
+                strv_length(info->required_by);
 }
 
 static int unit_file_search(
@@ -1121,7 +1127,10 @@ static int unit_file_can_install(
         r = unit_file_search(&c, i, paths, root_dir, allow_symlink);
 
         if (r >= 0)
-                r = strv_length(i->aliases) + strv_length(i->wanted_by);
+                r =
+                        strv_length(i->aliases) +
+                        strv_length(i->wanted_by) +
+                        strv_length(i->required_by);
 
         install_context_done(&c);
 
@@ -1241,6 +1250,40 @@ static int install_info_symlink_wants(
         return r;
 }
 
+static int install_info_symlink_requires(
+                InstallInfo *i,
+                const char *config_path,
+                bool force,
+                UnitFileChange **changes,
+                unsigned *n_changes) {
+
+        char **s;
+        int r = 0, q;
+
+        assert(i);
+        assert(config_path);
+
+        STRV_FOREACH(s, i->required_by) {
+                char *path;
+
+                if (!unit_name_is_valid_no_type(*s, true)) {
+                        r = -EINVAL;
+                        continue;
+                }
+
+                if (asprintf(&path, "%s/%s.requires/%s", config_path, *s, i->name) < 0)
+                        return -ENOMEM;
+
+                q = create_symlink(i->path, path, force, changes, n_changes);
+                free(path);
+
+                if (r == 0)
+                        r = q;
+        }
+
+        return r;
+}
+
 static int install_info_symlink_link(
                 InstallInfo *i,
                 LookupPaths *paths,
@@ -1290,6 +1333,10 @@ static int install_info_apply(
         if (r == 0)
                 r = q;
 
+        q = install_info_symlink_requires(i, config_path, force, changes, n_changes);
+        if (r == 0)
+                r = q;
+
         q = install_info_symlink_link(i, paths, config_path, force, changes, n_changes);
         if (r == 0)
                 r = q;

commit 6ccf7562da826fd82a25aacfbe193691180649d0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon May 21 15:22:28 2012 +0200

    login: minor typo fix

diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 475ebca..1f3a7f3 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -382,7 +382,7 @@ static int session_link_x11_socket(Session *s) {
         c[k] = 0;
 
         if (access(f, F_OK) < 0) {
-                log_warning("Session %s has display %s with nonexisting socket %s.", s->id, s->display, f);
+                log_warning("Session %s has display %s with non-existing socket %s.", s->id, s->display, f);
                 free(f);
                 return -ENOENT;
         }



More information about the systemd-commits mailing list