systemd: Update to 199

This incorporates some changes from
eb64a2f562.
This commit is contained in:
Eelco Dolstra 2013-03-27 13:58:31 +01:00
parent 7a69bd708e
commit 3300479c74
10 changed files with 68 additions and 83 deletions

View File

@ -1,7 +1,7 @@
From 0085f49cd0ba889e3db9102f328f6044ae3a2c18 Mon Sep 17 00:00:00 2001 From ebbb4bc256e1ed53c594fc54d9e1a9faf5a5f77a Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:44:33 +0100 Date: Tue, 8 Jan 2013 15:44:33 +0100
Subject: [PATCH 1/6] Make "systemctl daemon-reexec" do the right thing on Subject: [PATCH 1/8] Make "systemctl daemon-reexec" do the right thing on
NixOS NixOS
--- ---
@ -9,10 +9,10 @@ Subject: [PATCH 1/6] Make "systemctl daemon-reexec" do the right thing on
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/main.c b/src/core/main.c diff --git a/src/core/main.c b/src/core/main.c
index 1ee3c9c..1686f60 100644 index 25f55fc..c2e42b7 100644
--- a/src/core/main.c --- a/src/core/main.c
+++ b/src/core/main.c +++ b/src/core/main.c
@@ -1858,7 +1858,7 @@ finish: @@ -1887,7 +1887,7 @@ finish:
char_array_0(sfd); char_array_0(sfd);
i = 0; i = 0;
@ -22,5 +22,5 @@ index 1ee3c9c..1686f60 100644
args[i++] = "--switched-root"; args[i++] = "--switched-root";
args[i++] = arg_running_as == SYSTEMD_SYSTEM ? "--system" : "--user"; args[i++] = arg_running_as == SYSTEMD_SYSTEM ? "--system" : "--user";
-- --
1.8.0.1 1.8.1

View File

@ -1,30 +1,29 @@
From 2b0a9106d3aabb365af0cc34b595a1e697120f37 Mon Sep 17 00:00:00 2001 From 64c36ac79fca8f0214faed8b7aff19b379b1ac1b Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:45:01 +0100 Date: Tue, 8 Jan 2013 15:45:01 +0100
Subject: [PATCH 2/6] Ignore duplicate paths in "systemctl start" Subject: [PATCH 2/8] Ignore duplicate paths in "systemctl start"
--- ---
src/systemctl/systemctl.c | 7 +++++-- src/systemctl/systemctl.c | 6 ++++--
1 file changed, 5 insertions(+), 2 deletions(-) 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 2ebfff8..9f99df5 100644 index edd136a..86ce32a 100644
--- a/src/systemctl/systemctl.c --- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c
@@ -1591,8 +1591,11 @@ static int start_unit_one( @@ -1510,8 +1510,10 @@ static int start_unit_one(
r = set_put(s, p); r = set_put(s, p);
if (r < 0) { if (r < 0) {
free(p);
- log_error("Failed to add path to set."); - log_error("Failed to add path to set.");
- return r; - return r;
+ free(p);
+ if (r != -EEXIST) { + if (r != -EEXIST) {
+ log_error("Failed to add path %s to set.", p); + log_error("Failed to add path %s to set.", p);
+ return r; + return r;
+ } + }
} }
}
p = NULL;
-- --
1.8.0.1 1.8.1

View File

@ -1,7 +1,7 @@
From a013beb84f135cebf1c8c9363d5676c1c0a6be7a Mon Sep 17 00:00:00 2001 From 776093e73b86bcddfeb0971cb6267d13d07f0a81 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:46:30 +0100 Date: Tue, 8 Jan 2013 15:46:30 +0100
Subject: [PATCH 3/6] Start device units for uninitialised encrypted devices Subject: [PATCH 3/8] Start device units for uninitialised encrypted devices
This is necessary because the NixOS service that initialises the This is necessary because the NixOS service that initialises the
filesystem depends on the appearance of the device unit. Also, this filesystem depends on the appearance of the device unit. Also, this
@ -28,5 +28,5 @@ index d17bdd9..040b10e 100644
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0" SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0" SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
-- --
1.8.0.1 1.8.1

View File

@ -1,7 +1,7 @@
From b40d8783f94666035baae567882c0d4be82cda01 Mon Sep 17 00:00:00 2001 From 0bc7513439a8b77f62bc8ebcf220b77f83321b75 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:48:19 +0100 Date: Tue, 8 Jan 2013 15:48:19 +0100
Subject: [PATCH 4/6] Set switch-to-configuration hints for some units Subject: [PATCH 4/8] Set switch-to-configuration hints for some units
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit Content-Transfer-Encoding: 8bit
@ -24,22 +24,22 @@ to prevent all user sessions from being killed when this unit changes.
4 files changed, 12 insertions(+) 4 files changed, 12 insertions(+)
diff --git a/units/local-fs.target b/units/local-fs.target diff --git a/units/local-fs.target b/units/local-fs.target
index dd92b17..dfcbc7b 100644 index ee02e4e..63ae843 100644
--- a/units/local-fs.target --- a/units/local-fs.target
+++ b/units/local-fs.target +++ b/units/local-fs.target
@@ -10,3 +10,5 @@ Description=Local File Systems @@ -11,3 +11,5 @@ Documentation=man:systemd.special(7)
Documentation=man:systemd.special(7) After=local-fs-pre.target
OnFailure=emergency.target OnFailure=emergency.target
OnFailureIsolate=yes OnFailureIsolate=yes
+ +
+X-StopOnReconfiguration=yes +X-StopOnReconfiguration=yes
diff --git a/units/remote-fs.target b/units/remote-fs.target diff --git a/units/remote-fs.target b/units/remote-fs.target
index 9e68878..85a53d7 100644 index e867b8d..02462b4 100644
--- a/units/remote-fs.target --- a/units/remote-fs.target
+++ b/units/remote-fs.target +++ b/units/remote-fs.target
@@ -9,5 +9,7 @@ @@ -10,5 +10,7 @@ Description=Remote File Systems
Description=Remote File Systems
Documentation=man:systemd.special(7) Documentation=man:systemd.special(7)
After=remote-fs-pre.target remote-fs-setup.target
+X-StopOnReconfiguration=yes +X-StopOnReconfiguration=yes
+ +
@ -70,5 +70,5 @@ index 0869e73..b6ed958 100644
+# Restart kills all active sessions. +# Restart kills all active sessions.
+X-RestartIfChanged=no +X-RestartIfChanged=no
-- --
1.8.0.1 1.8.1

View File

@ -1,7 +1,7 @@
From c5c8ac3a0420fb42ba2f629368fd5bd6ea1e753b Mon Sep 17 00:00:00 2001 From 5337d8f5a555f83ba8731472a2f3b0d36ac607d9 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 15:56:03 +0100 Date: Tue, 8 Jan 2013 15:56:03 +0100
Subject: [PATCH 5/6] sysinit.target: Drop the dependency on local-fs.target Subject: [PATCH 5/8] sysinit.target: Drop the dependency on local-fs.target
and swap.target and swap.target
Having all services with DefaultDependencies=yes depend on Having all services with DefaultDependencies=yes depend on
@ -29,5 +29,5 @@ index 8f4fb8f..e0f0147 100644
+After=emergency.service emergency.target +After=emergency.service emergency.target
RefuseManualStart=yes RefuseManualStart=yes
-- --
1.8.0.1 1.8.1

View File

@ -1,7 +1,7 @@
From d3caa154098e215145679f38fa92a8bd482107be Mon Sep 17 00:00:00 2001 From b944fede26773167cb6a9f86888a9209dda4c35e Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 8 Jan 2013 18:36:28 +0100 Date: Tue, 8 Jan 2013 18:36:28 +0100
Subject: [PATCH 6/6] Don't call "plymouth quit" Subject: [PATCH 6/8] Don't call "plymouth quit"
NixOS doesn't use Plymouth (yet). NixOS doesn't use Plymouth (yet).
--- ---
@ -34,5 +34,5 @@ index 269797a..2c640f4 100644
ExecStart=-/sbin/sulogin ExecStart=-/sbin/sulogin
ExecStopPost=-@SYSTEMCTL@ --fail --no-block default ExecStopPost=-@SYSTEMCTL@ --fail --no-block default
-- --
1.8.0.1 1.8.1

View File

@ -1,4 +1,4 @@
From ab889004b8972258a87798133451f99dfce21823 Mon Sep 17 00:00:00 2001 From b9f175c7b3ea6ac34d148f5afba598f985c5b9fe Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com> From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Mon, 4 Feb 2013 12:41:14 +0100 Date: Mon, 4 Feb 2013 12:41:14 +0100
Subject: [PATCH 7/8] Ignore IPv6 link-local addresses Subject: [PATCH 7/8] Ignore IPv6 link-local addresses

View File

@ -1,42 +0,0 @@
From ef9b259ae24e7bf4ebec04b0b0a44964bc661bb5 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Mon, 4 Feb 2013 12:43:08 +0100
Subject: [PATCH 8/8] Fix a segfault in nscd when using nss-myhostname
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Nscd expects that an NSS module's gethostbyname4_r function returns
its first result in the pre-allocated gaih_addrtuple denoted by **pat.
(See nscd/aicache.c in the Glibc sources.) However, nss-myhostname
doesn't fill in **pat but allocates the first result in buffer, then
sets *pat. So nscd crashes (e.g. when running getent ahosts
my-machine).
Hard to tell if this is a bug in nscd, since there doesn't seem to be
a proper API spec for gethostbyname4_r. But in any case, this patch
fixes the crash by copying the first result to **pat.
---
src/nss-myhostname/nss-myhostname.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index 834a806..b0fb832 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -176,7 +176,11 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
/* Verify the size matches */
assert(idx == ms);
- *pat = r_tuple_prev;
+ /* Nscd expects us to store the first record in **pat. */
+ if (*pat)
+ **pat = *r_tuple_prev;
+ else
+ *pat = r_tuple_prev;
if (ttlp)
*ttlp = 0;
--
1.8.1

View File

@ -0,0 +1,28 @@
From dcfb048af5face4787ecdf29c00454898c52963d Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Wed, 27 Mar 2013 13:33:09 +0100
Subject: [PATCH 8/8] systemd-sysctl: Handle missing /etc/sysctl.conf properly
Since fabe5c0e5fce730aa66e10a9c4f9fdd443d7aeda, systemd-sysctl returns
a non-zero exit code if /etc/sysctl.conf does not exist, due to a
broken ENOENT check.
---
src/sysctl/sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 2d43660..79f3f77 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -125,7 +125,7 @@ static int parse_file(Hashmap *sysctl_options, const char *path, bool ignore_eno
r = search_and_fopen_nulstr(path, "re", conf_file_dirs, &f);
if (r < 0) {
- if (ignore_enoent && errno == -ENOENT)
+ if (ignore_enoent && r == -ENOENT)
return 0;
log_error("Failed to open file '%s', ignoring: %s", path, strerror(-r));
--
1.8.1

View File

@ -1,16 +1,16 @@
{ stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod { stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod
, xz, pam, acl, cryptsetup, libuuid, m4, utillinux , xz, pam, acl, cryptsetup, libuuid, m4, utillinux
, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools , glib, kbd, libxslt, coreutils, libgcrypt, sysvtools, docbook_xsl
}: }:
assert stdenv.gcc.libc or null != null; assert stdenv.gcc.libc or null != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "systemd-197"; name = "systemd-199";
src = fetchurl { src = fetchurl {
url = "http://www.freedesktop.org/software/systemd/${name}.tar.xz"; url = "http://www.freedesktop.org/software/systemd/${name}.tar.xz";
sha256 = "1dbljyyc3w4a1af99f15f3sqnfx7mfmc5x5hwxb70kg23ai7x1g6"; sha256 = "1vazjqi95pri5zx21gs4chyd7c8kg5lf1rc26w47zkry9yh64i4c";
}; };
patches = patches =
@ -21,12 +21,12 @@ stdenv.mkDerivation rec {
./0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch ./0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch
./0006-Don-t-call-plymouth-quit.patch ./0006-Don-t-call-plymouth-quit.patch
./0007-Ignore-IPv6-link-local-addresses.patch ./0007-Ignore-IPv6-link-local-addresses.patch
./0008-Fix-a-segfault-in-nscd-when-using-nss-myhostname.patch ./0008-systemd-sysctl-Handle-missing-etc-sysctl.conf-proper.patch
] ++ stdenv.lib.optional stdenv.isArm ./libc-bug-accept4-arm.patch; ] ++ stdenv.lib.optional stdenv.isArm ./libc-bug-accept4-arm.patch;
buildInputs = buildInputs =
[ pkgconfig intltool gperf libcap dbus kmod xz pam acl [ pkgconfig intltool gperf libcap dbus kmod xz pam acl
/* cryptsetup */ libuuid m4 glib libxslt libgcrypt /* cryptsetup */ libuuid m4 glib libxslt libgcrypt docbook_xsl
]; ];
configureFlags = configureFlags =
@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = NIX_CFLAGS_COMPILE =
[ # Can't say ${polkit}/bin/pkttyagent here because that would [ # Can't say ${polkit}/bin/pkttyagent here because that would
# lead to a cyclic dependency. # lead to a cyclic dependency.
"-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\"" "-UPOLKIT_AGENT_BINARY_PATH -DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\""
"-fno-stack-protector" "-fno-stack-protector"
# Work around our kernel headers being too old. FIXME: remove # Work around our kernel headers being too old. FIXME: remove
# this after the next stdenv update. # this after the next stdenv update.
@ -81,7 +81,7 @@ stdenv.mkDerivation rec {
# 1e1954f53386cb773e2a152748dd31c4d36aa2d8) because using /var is # 1e1954f53386cb773e2a152748dd31c4d36aa2d8) because using /var is
# forbidden in early boot, but in NixOS the initrd guarantees that # forbidden in early boot, but in NixOS the initrd guarantees that
# /var is mounted. # /var is mounted.
makeFlags = "CPPFLAGS=-I${stdenv.gcc.libc}/include hwdb_bin=/var/lib/udev/hwdb.bin"; makeFlags = "hwdb_bin=/var/lib/udev/hwdb.bin";
installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc sysvinitdir=$(TMPDIR)/etc/init.d"; installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc sysvinitdir=$(TMPDIR)/etc/init.d";