Skip to content

Commit

Permalink
systemd: Update to 199
Browse files Browse the repository at this point in the history
This incorporates some changes from
vcunat@eb64a2f.
  • Loading branch information
edolstra committed Mar 27, 2013
1 parent 7a69bd7 commit 3300479
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 83 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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>
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

---
src/core/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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
+++ b/src/core/main.c
@@ -1858,7 +1858,7 @@ finish:
@@ -1887,7 +1887,7 @@ finish:
char_array_0(sfd);

i = 0;
Expand All @@ -22,5 +22,5 @@ index 1ee3c9c..1686f60 100644
args[i++] = "--switched-root";
args[i++] = arg_running_as == SYSTEMD_SYSTEM ? "--system" : "--user";
--
1.8.0.1
1.8.1

Original file line number Diff line number Diff line change
@@ -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>
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 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
src/systemctl/systemctl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

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
+++ 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);
if (r < 0) {
free(p);
- log_error("Failed to add path to set.");
- return r;
+ free(p);
+ if (r != -EEXIST) {
+ log_error("Failed to add path %s to set.", p);
+ return r;
+ }
}
}

p = NULL;
--
1.8.0.1
1.8.1

Original file line number Diff line number Diff line change
@@ -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>
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
filesystem depends on the appearance of the device unit. Also, this
Expand All @@ -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*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
--
1.8.0.1
1.8.1

Original file line number Diff line number Diff line change
@@ -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>
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
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Expand All @@ -24,22 +24,22 @@ to prevent all user sessions from being killed when this unit changes.
4 files changed, 12 insertions(+)

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
+++ b/units/local-fs.target
@@ -10,3 +10,5 @@ Description=Local File Systems
Documentation=man:systemd.special(7)
@@ -11,3 +11,5 @@ Documentation=man:systemd.special(7)
After=local-fs-pre.target
OnFailure=emergency.target
OnFailureIsolate=yes
+
+X-StopOnReconfiguration=yes
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
+++ b/units/remote-fs.target
@@ -9,5 +9,7 @@
Description=Remote File Systems
@@ -10,5 +10,7 @@ Description=Remote File Systems
Documentation=man:systemd.special(7)
After=remote-fs-pre.target remote-fs-setup.target

+X-StopOnReconfiguration=yes
+
Expand Down Expand Up @@ -70,5 +70,5 @@ index 0869e73..b6ed958 100644
+# Restart kills all active sessions.
+X-RestartIfChanged=no
--
1.8.0.1
1.8.1

Original file line number Diff line number Diff line change
@@ -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>
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

Having all services with DefaultDependencies=yes depend on
Expand Down Expand Up @@ -29,5 +29,5 @@ index 8f4fb8f..e0f0147 100644
+After=emergency.service emergency.target
RefuseManualStart=yes
--
1.8.0.1
1.8.1

Original file line number Diff line number Diff line change
@@ -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>
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).
---
Expand Down Expand Up @@ -34,5 +34,5 @@ index 269797a..2c640f4 100644
ExecStart=-/sbin/sulogin
ExecStopPost=-@SYSTEMCTL@ --fail --no-block default
--
1.8.0.1
1.8.1

Original file line number Diff line number Diff line change
@@ -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>
Date: Mon, 4 Feb 2013 12:41:14 +0100
Subject: [PATCH 7/8] Ignore IPv6 link-local addresses
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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

14 changes: 7 additions & 7 deletions pkgs/os-specific/linux/systemd/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{ stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod
, 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;

stdenv.mkDerivation rec {
name = "systemd-197";
name = "systemd-199";

src = fetchurl {
url = "http://www.freedesktop.org/software/systemd/${name}.tar.xz";
sha256 = "1dbljyyc3w4a1af99f15f3sqnfx7mfmc5x5hwxb70kg23ai7x1g6";
sha256 = "1vazjqi95pri5zx21gs4chyd7c8kg5lf1rc26w47zkry9yh64i4c";
};

patches =
Expand All @@ -21,12 +21,12 @@ stdenv.mkDerivation rec {
./0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch
./0006-Don-t-call-plymouth-quit.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;

buildInputs =
[ pkgconfig intltool gperf libcap dbus kmod xz pam acl
/* cryptsetup */ libuuid m4 glib libxslt libgcrypt
/* cryptsetup */ libuuid m4 glib libxslt libgcrypt docbook_xsl
];

configureFlags =
Expand Down Expand Up @@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE =
[ # Can't say ${polkit}/bin/pkttyagent here because that would
# 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"
# Work around our kernel headers being too old. FIXME: remove
# this after the next stdenv update.
Expand All @@ -81,7 +81,7 @@ stdenv.mkDerivation rec {
# 1e1954f53386cb773e2a152748dd31c4d36aa2d8) because using /var is
# forbidden in early boot, but in NixOS the initrd guarantees that
# /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";

This comment has been minimized.

Copy link
@vcunat

vcunat Apr 18, 2015

Member

This make option seems unused. I can't find any reference to string hwdb_bin in systemd-217 sources or our patches. Is that fine?

This comment has been minimized.

Copy link
@vcunat

vcunat Apr 19, 2015

Member

Removed on the closure-size branch e3ac73a.


installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc sysvinitdir=$(TMPDIR)/etc/init.d";

Expand Down

0 comments on commit 3300479

Please sign in to comment.