[systemd-commits] stable Branch 'v214-stable' - 11 commits - man/crypttab.xml man/systemd-resolved.service.xml src/core src/cryptsetup src/sysv-generator src/vconsole

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Wed Jun 25 23:08:49 PDT 2014


 man/crypttab.xml                      |    2 -
 man/systemd-resolved.service.xml      |    2 -
 src/core/dbus-execute.c               |    2 -
 src/core/mount-setup.c                |    4 +--
 src/core/snapshot.c                   |   19 +++++++++-----
 src/core/transaction.c                |   45 +++++++++++++++++++++-------------
 src/cryptsetup/cryptsetup-generator.c |   20 +++++++++------
 src/sysv-generator/sysv-generator.c   |   14 ++++++++--
 src/vconsole/vconsole-setup.c         |   24 ++++++++++++++++++
 9 files changed, 93 insertions(+), 39 deletions(-)

New commits:
commit af67487dbe254648f9a9c2b836017d348b72435f
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Thu Jun 26 00:36:43 2014 +0200

    sysv-generator: fix incorect ordering of Wants
    
    (cherry picked from commit 260ad50f5b4a9795032e3119c64f838a2d03370d)

diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index 9778fbc..5206279 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -78,6 +78,7 @@ typedef struct SysvStub {
         char **before;
         char **after;
         char **wants;
+        char **wanted_by;
         char **conflicts;
         bool has_lsb;
         bool reload;
@@ -118,6 +119,7 @@ static int generate_unit_file(SysvStub *s) {
         _cleanup_fclose_ FILE *f = NULL;
         _cleanup_free_ char *before = NULL;
         _cleanup_free_ char *after = NULL;
+        _cleanup_free_ char *wants = NULL;
         _cleanup_free_ char *conflicts = NULL;
         int r;
 
@@ -129,6 +131,10 @@ static int generate_unit_file(SysvStub *s) {
         if (!after)
                 return log_oom();
 
+        wants = strv_join(s->wants, " ");
+        if (!wants)
+                return log_oom();
+
         conflicts = strv_join(s->conflicts, " ");
         if (!conflicts)
                 return log_oom();
@@ -154,6 +160,8 @@ static int generate_unit_file(SysvStub *s) {
                 fprintf(f, "Before=%s\n", before);
         if (!isempty(after))
                 fprintf(f, "After=%s\n", after);
+        if (!isempty(wants))
+                fprintf(f, "Wants=%s\n", wants);
         if (!isempty(conflicts))
                 fprintf(f, "Conflicts=%s\n", conflicts);
 
@@ -182,7 +190,7 @@ static int generate_unit_file(SysvStub *s) {
         if (s->reload)
                 fprintf(f, "ExecReload=%s reload\n", s->path);
 
-        STRV_FOREACH(p, s->wants) {
+        STRV_FOREACH(p, s->wanted_by) {
                 r = add_symlink(s->name, *p);
                 if (r < 0)
                         log_error_unit(s->name, "Failed to create 'Wants' symlink to %s: %s", *p, strerror(-r));
@@ -832,7 +840,7 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
                         r = strv_extend(&service->before, rcnd_table[i].target);
                         if (r < 0)
                                 return log_oom();
-                        r = strv_extend(&service->wants, rcnd_table[i].target);
+                        r = strv_extend(&service->wanted_by, rcnd_table[i].target);
                         if (r < 0)
                                 return log_oom();
                 }

commit 6b6202305bc934d36cf782c039a6c1a89c7480a0
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Tue Jun 24 23:07:48 2014 +0200

    sysv-generator: rename PidFile to PIDFile
    
    Spotted by Alexey Shabalin
    
    (cherry picked from commit d171ed1c50ba64928b7fb30ee2ae729fdfe0826b)

diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index 18dae5c..9778fbc 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -172,7 +172,7 @@ static int generate_unit_file(SysvStub *s) {
                 fprintf(f, "SysVStartPriority=%d\n", s->sysv_start_priority);
 
         if (s->pid_file)
-                fprintf(f, "PidFile=%s\n", s->pid_file);
+                fprintf(f, "PIDFile=%s\n", s->pid_file);
 
         fprintf(f,
                 "ExecStart=%s start\n"

commit e63577bbbb07163abbd1a8967cfd4e539ebf7c14
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Jun 23 23:07:53 2014 -0400

    man: fix path in crypttab(5)
    
    https://bugs.freedesktop.org/show_bug.cgi?id=75816
    (cherry picked from commit 9fcdf32294e66f91d2a177f73a77049832768311)

diff --git a/man/crypttab.xml b/man/crypttab.xml
index 668e51d..9030015 100644
--- a/man/crypttab.xml
+++ b/man/crypttab.xml
@@ -369,7 +369,7 @@
                         <programlisting>luks       UUID=2505567a-9e27-4efe-a4d5-15ad146c258b
 swap       /dev/sda7       /dev/urandom             swap
 truecrypt  /dev/sda2       /etc/container_password  tcrypt
-hidden     /mnt/tc_hidden  /null                    tcrypt-hidden,tcrypt-keyfile=/etc/keyfile</programlisting>
+hidden     /mnt/tc_hidden  /dev/null                tcrypt-hidden,tcrypt-keyfile=/etc/keyfile</programlisting>
                 </example>
         </refsect1>
 

commit 2acc158f96a5ac62acd8d57eb5acf55f7d6a988c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 23 19:18:44 2014 +0200

    cryptsetup: don't add unit dependency on /dev/null devices when it is listed as password file
    
    As special magic, don't create device dependencies for /dev/null. Of
    course, there might be similar devices we might want to include, but
    given that none of them really make sense to specify as password source
    there's really no point in checking for anything else here.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=75816
    (cherry picked from commit bde29068aa3815c88190a91e9867605a0aeaf9c4)

diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index dfdca1e..62fc620 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -29,6 +29,7 @@
 #include "mkdir.h"
 #include "strv.h"
 #include "fileio.h"
+#include "path-util.h"
 
 static const char *arg_dest = "/tmp";
 static bool arg_enabled = true;
@@ -144,16 +145,19 @@ static int create_disk(
                         if (!uu)
                                 return log_oom();
 
-                        if (is_device_path(uu)) {
-                                _cleanup_free_ char *dd;
+                        if (!path_equal(uu, "/dev/null")) {
 
-                                dd = unit_name_from_path(uu, ".device");
-                                if (!dd)
-                                        return log_oom();
+                                if (is_device_path(uu)) {
+                                        _cleanup_free_ char *dd;
 
-                                fprintf(f, "After=%1$s\nRequires=%1$s\n", dd);
-                        } else
-                                fprintf(f, "RequiresMountsFor=%s\n", password);
+                                        dd = unit_name_from_path(uu, ".device");
+                                        if (!dd)
+                                                return log_oom();
+
+                                        fprintf(f, "After=%1$s\nRequires=%1$s\n", dd);
+                                } else
+                                        fprintf(f, "RequiresMountsFor=%s\n", password);
+                        }
                 }
         }
 

commit d94362708df9a520d2bd8f494003baf186833bdd
Author: Ronan Le Martret <ronan at fridu.net>
Date:   Tue Apr 22 10:33:25 2014 +0200

    core: You can not put the cached result of use_smack fct, as we are not sure the "/sys" is mounted. So we should mount "sys" before "/proc"
    
    https://bugs.freedesktop.org/show_bug.cgi?id=77646
    (cherry picked from commit d1d8e5d49f3149d03ceb94d1d2f6c14e7abccb6f)

diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index ae8447c..991bfdf 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -67,10 +67,10 @@ typedef struct MountPoint {
 #define N_EARLY_MOUNT 5
 
 static const MountPoint mount_table[] = {
-        { "proc",       "/proc",                     "proc",       NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
-          NULL,       MNT_FATAL|MNT_IN_CONTAINER },
         { "sysfs",      "/sys",                      "sysfs",      NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
           NULL,       MNT_FATAL|MNT_IN_CONTAINER },
+        { "proc",       "/proc",                     "proc",       NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+          NULL,       MNT_FATAL|MNT_IN_CONTAINER },
         { "devtmpfs",   "/dev",                      "devtmpfs",   "mode=755", MS_NOSUID|MS_STRICTATIME,
           NULL,       MNT_FATAL|MNT_IN_CONTAINER },
         { "securityfs", "/sys/kernel/security",      "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,

commit 4af1100591133339a3fcaf21f3aacf2aed3593c3
Author: Hristo Venev <mustrumr97 at gmail.com>
Date:   Mon Jun 23 18:53:04 2014 +0200

    core: make sure Environment fields passed in for transient units are properly written to unit files
    
    https://bugs.freedesktop.org/show_bug.cgi?id=76744
    (cherry picked from commit cdd7b7dfd44649b204c43e907f03d4294de4f28a)

diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index cb9a077..ecbadd7 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -848,7 +848,7 @@ int bus_exec_context_set_transient_property(
                         strv_free(c->environment);
                         c->environment = e;
 
-                        joined = strv_join(c->environment, " ");
+                        joined = strv_join_quoted(c->environment);
                         if (!joined)
                                 return -ENOMEM;
 

commit 41d83615beba984cc40b141373fa61f9fd1273e4
Author: Carl Schaefer <schaefer at trilug.org>
Date:   Mon Jun 23 18:23:48 2014 +0200

    vconsole: also copy character maps (not just fonts) from vt1 to vt2, vt3, ...
    
    https://bugs.freedesktop.org/show_bug.cgi?id=78796
    (cherry picked from commit ff452e76e2c0f89a32542b7179bb2fd538335933)

diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index 0f2b706..e0c4050 100644
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -180,6 +180,10 @@ static int font_load(const char *vc, const char *font, const char *map, const ch
  */
 static void font_copy_to_all_vcs(int fd) {
         struct vt_stat vcs = {};
+        unsigned char map8[E_TABSZ];
+        unsigned short map16[E_TABSZ];
+        struct unimapdesc unimapd;
+        struct unipair unipairs[USHRT_MAX];
         int i, r;
 
         /* get active, and 16 bit mask of used VT numbers */
@@ -209,6 +213,26 @@ static void font_copy_to_all_vcs(int fd) {
                 cfo.op = KD_FONT_OP_COPY;
                 cfo.height = vcs.v_active-1; /* tty1 == index 0 */
                 ioctl(vcfd, KDFONTOP, &cfo);
+
+                /* copy map of 8bit chars */
+                if (ioctl(fd, GIO_SCRNMAP, map8) >= 0)
+                    ioctl(vcfd, PIO_SCRNMAP, map8);
+
+                /* copy map of 8bit chars -> 16bit Unicode values */
+                if (ioctl(fd, GIO_UNISCRNMAP, map16) >= 0)
+                    ioctl(vcfd, PIO_UNISCRNMAP, map16);
+
+                /* copy unicode translation table */
+                /* unimapd is a ushort count and a pointer to an
+                   array of struct unipair { ushort, ushort } */
+                unimapd.entries  = unipairs;
+                unimapd.entry_ct = USHRT_MAX;
+                if (ioctl(fd, GIO_UNIMAP, &unimapd) >= 0) {
+                        struct unimapinit adv = { 0, 0, 0 };
+
+                        ioctl(vcfd, PIO_UNIMAPCLR, &adv);
+                        ioctl(vcfd, PIO_UNIMAP, &unimapd);
+                }
         }
 }
 

commit e7c2e475beb1b7d30320e7b2ec42630c6431db4f
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 14:20:08 2014 -0400

    core/snapshot: log info when snapshots are created and removed
    
    Snapshot mechanism is not used very much, but snapshot creation/destruction
    should be at least as verbose as normal unit starting/stopping.
    
    (cherry picked from commit 6f8bd5c94ebc19c9afdb17684945526dddc2ec23)
    
    Conflicts:
    	TODO

diff --git a/src/core/snapshot.c b/src/core/snapshot.c
index d914af2..5eed615 100644
--- a/src/core/snapshot.c
+++ b/src/core/snapshot.c
@@ -51,10 +51,11 @@ static void snapshot_set_state(Snapshot *s, SnapshotState state) {
         s->state = state;
 
         if (state != old_state)
-                log_debug("%s changed %s -> %s",
-                          UNIT(s)->id,
-                          snapshot_state_to_string(old_state),
-                          snapshot_state_to_string(state));
+                log_debug_unit(UNIT(s)->id,
+                               "%s changed %s -> %s",
+                               UNIT(s)->id,
+                               snapshot_state_to_string(old_state),
+                               snapshot_state_to_string(state));
 
         unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], true);
 }
@@ -154,7 +155,7 @@ static int snapshot_deserialize_item(Unit *u, const char *key, const char *value
 
                 state = snapshot_state_from_string(value);
                 if (state < 0)
-                        log_debug("Failed to parse state value %s", value);
+                        log_debug_unit(u->id, "Failed to parse state value %s", value);
                 else
                         s->deserialized_state = state;
 
@@ -162,7 +163,7 @@ static int snapshot_deserialize_item(Unit *u, const char *key, const char *value
 
                 r = parse_boolean(value);
                 if (r < 0)
-                        log_debug("Failed to parse cleanup value %s", value);
+                        log_debug_unit(u->id, "Failed to parse cleanup value %s", value);
                 else
                         s->cleanup = r;
 
@@ -172,7 +173,7 @@ static int snapshot_deserialize_item(Unit *u, const char *key, const char *value
                 if (r < 0)
                         return r;
         } else
-                log_debug("Unknown serialization key '%s'", key);
+                log_debug_unit(u->id, "Unknown serialization key '%s'", key);
 
         return 0;
 }
@@ -257,6 +258,8 @@ int snapshot_create(Manager *m, const char *name, bool cleanup, sd_bus_error *e,
         SNAPSHOT(u)->cleanup = cleanup;
         *_s = SNAPSHOT(u);
 
+        log_info_unit(u->id, "Created snapshot %s.", u->id);
+
         return 0;
 
 fail:
@@ -269,6 +272,8 @@ fail:
 void snapshot_remove(Snapshot *s) {
         assert(s);
 
+        log_info_unit(UNIT(s)->id, "Removing snapshot %s.", UNIT(s)->id);
+
         unit_add_to_cleanup_queue(UNIT(s));
 }
 

commit 54791e4aa363e1cc5ada075035beeaf9f9ea689b
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 14:04:23 2014 -0400

    core/transaction: avoid misleading error message when unit not found
    
    There's no point in telling the user to look at the logs when
    an attempt to load the unit file failed with ENOENT.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=996133
    (cherry picked from commit 04ef5b03f64d3824a51a2a903548af029a006744)
    
    Conflicts:
    	TODO

diff --git a/src/core/transaction.c b/src/core/transaction.c
index 9fb6101..d23a45c 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -870,12 +870,18 @@ int transaction_add_job_and_dependencies(
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_ERROR) {
-                sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
-                                  "Unit %s failed to load: %s. "
-                                  "See system logs and 'systemctl status %s' for details.",
-                                  unit->id,
-                                  strerror(-unit->load_error),
-                                  unit->id);
+                if (unit->load_error == -ENOENT)
+                        sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
+                                          "Unit %s failed to load: %s.",
+                                          unit->id,
+                                          strerror(-unit->load_error));
+                else
+                        sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
+                                          "Unit %s failed to load: %s. "
+                                          "See system logs and 'systemctl status %s' for details.",
+                                          unit->id,
+                                          strerror(-unit->load_error),
+                                          unit->id);
                 return -EINVAL;
         }
 

commit 51b5c543f4aaf7e1a75d6f97187e52313e7983b0
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 14:00:36 2014 -0400

    core/transaction: reindent and split very long lines
    
    (cherry picked from commit 9ba6c18532b4da96ae6916865c3db44054c2af6b)

diff --git a/src/core/transaction.c b/src/core/transaction.c
index d00f427..9fb6101 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -264,9 +264,12 @@ static int transaction_merge_jobs(Transaction *tr, sd_bus_error *e) {
                                 return -EAGAIN;
 
                         /* We couldn't merge anything. Failure */
-                        sd_bus_error_setf(
-                                        e, BUS_ERROR_TRANSACTION_JOBS_CONFLICTING, "Transaction contains conflicting jobs '%s' and '%s' for %s. Probably contradicting requirement dependencies configured.",
-                                        job_type_to_string(t), job_type_to_string(k->type), k->unit->id);
+                        sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_JOBS_CONFLICTING,
+                                          "Transaction contains conflicting jobs '%s' and '%s' for %s. "
+                                          "Probably contradicting requirement dependencies configured.",
+                                          job_type_to_string(t),
+                                          job_type_to_string(k->type),
+                                          k->unit->id);
                         return r;
                 }
         }
@@ -512,7 +515,8 @@ static int transaction_is_destructive(Transaction *tr, JobMode mode, sd_bus_erro
                 if (j->unit->job && (mode == JOB_FAIL || j->unit->job->irreversible) &&
                     !job_type_is_superset(j->type, j->unit->job->type)) {
 
-                        sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, "Transaction is destructive.");
+                        sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE,
+                                          "Transaction is destructive.");
                         return -EEXIST;
                 }
         }
@@ -860,35 +864,38 @@ int transaction_add_job_and_dependencies(
             unit->load_state != UNIT_ERROR &&
             unit->load_state != UNIT_NOT_FOUND &&
             unit->load_state != UNIT_MASKED) {
-                sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED, "Unit %s is not loaded properly.", unit->id);
+                sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
+                                  "Unit %s is not loaded properly.", unit->id);
                 return -EINVAL;
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_ERROR) {
                 sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
-                               "Unit %s failed to load: %s. "
-                               "See system logs and 'systemctl status %s' for details.",
-                               unit->id,
-                               strerror(-unit->load_error),
-                               unit->id);
+                                  "Unit %s failed to load: %s. "
+                                  "See system logs and 'systemctl status %s' for details.",
+                                  unit->id,
+                                  strerror(-unit->load_error),
+                                  unit->id);
                 return -EINVAL;
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_NOT_FOUND) {
                 sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
-                               "Unit %s failed to load: %s.",
-                               unit->id,
-                               strerror(-unit->load_error));
+                                  "Unit %s failed to load: %s.",
+                                  unit->id, strerror(-unit->load_error));
                 return -EINVAL;
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_MASKED) {
-                sd_bus_error_setf(e, BUS_ERROR_UNIT_MASKED, "Unit %s is masked.", unit->id);
+                sd_bus_error_setf(e, BUS_ERROR_UNIT_MASKED,
+                                  "Unit %s is masked.", unit->id);
                 return -EADDRNOTAVAIL;
         }
 
         if (!unit_job_is_applicable(unit, type)) {
-                sd_bus_error_setf(e, BUS_ERROR_JOB_TYPE_NOT_APPLICABLE, "Job type %s is not applicable for unit %s.", job_type_to_string(type), unit->id);
+                sd_bus_error_setf(e, BUS_ERROR_JOB_TYPE_NOT_APPLICABLE,
+                                  "Job type %s is not applicable for unit %s.",
+                                  job_type_to_string(type), unit->id);
                 return -EBADR;
         }
 

commit b1804488239462b84214c0343864b1aea4759691
Author: Jonathan Boulle <jonathanboulle at gmail.com>
Date:   Fri Jun 20 14:46:18 2014 -0700

    fix systemd-resolved reference in man page
    
    Guess this was missed in the copy-paste :-)
    
    (cherry picked from commit 40ef48600f2c82c2eb41f6c71f35a8d172a530ad)

diff --git a/man/systemd-resolved.service.xml b/man/systemd-resolved.service.xml
index ed1f5a2..517e08e 100644
--- a/man/systemd-resolved.service.xml
+++ b/man/systemd-resolved.service.xml
@@ -56,7 +56,7 @@
         <refsect1>
                 <title>Description</title>
 
-                <para><command>systemd-networkd</command> is a system
+                <para><command>systemd-resolved</command> is a system
                 service that manages network name resolution. It does so by
 		generating <filename>/run/systemd/resolve/resolv.conf</filename>,
 		which may be symlinked from <filename>/etc/resolv.conf</filename>.



More information about the systemd-commits mailing list