Compare commits
59 Commits
Author | SHA1 | Date |
---|---|---|
Michal Sekletar | b564b7c601 | |
Zbigniew Jędrzejewski-Szmek | dd3834a439 | |
Zbigniew Jędrzejewski-Szmek | ab0e7723dd | |
Zbigniew Jędrzejewski-Szmek | 7448b389cb | |
Zbigniew Jędrzejewski-Szmek | e1b51b70d5 | |
Harald Hoyer | 5d90d92882 | |
Zbigniew Jędrzejewski-Szmek | 3d6cf39015 | |
Zbigniew Jędrzejewski-Szmek | 4190e62c26 | |
Zbigniew Jędrzejewski-Szmek | d13db9a58f | |
Zbigniew Jędrzejewski-Szmek | 3f5470f4eb | |
Zbigniew Jędrzejewski-Szmek | a118d76df9 | |
Jan Synacek | e34b455b7b | |
Jan Synacek | 282d355552 | |
Zbigniew Jędrzejewski-Szmek | e1b4cbef8a | |
Zbigniew Jędrzejewski-Szmek | 9767024b5b | |
Zbigniew Jędrzejewski-Szmek | 9ecd5b8477 | |
Jan Synacek | ed5fc99b3c | |
Jan Synacek | 24c34f6d68 | |
Jan Synacek | 572940a9b3 | |
Zbigniew Jędrzejewski-Szmek | 0ea5bee27b | |
Jan Synacek | 4a51a6ee3d | |
Jan Synacek | 672d548216 | |
Zbigniew Jędrzejewski-Szmek | 1b4539694b | |
Jan Synacek | d79509b588 | |
Zbigniew Jędrzejewski-Szmek | f9f30188c5 | |
Zbigniew Jędrzejewski-Szmek | 668bffb7a0 | |
Zbigniew Jędrzejewski-Szmek | a0817f62a4 | |
Zbigniew Jędrzejewski-Szmek | 6b6353bc81 | |
Zbigniew Jędrzejewski-Szmek | 74c288b6b9 | |
Zbigniew Jędrzejewski-Szmek | 405356f7e1 | |
Zbigniew Jędrzejewski-Szmek | 47313b1c32 | |
Zbigniew Jędrzejewski-Szmek | b397f2acfb | |
Zbigniew Jędrzejewski-Szmek | 0ca6977a38 | |
Zbigniew Jędrzejewski-Szmek | 6f078f2594 | |
Zbigniew Jędrzejewski-Szmek | d75ecfb5f0 | |
Zbigniew Jędrzejewski-Szmek | 51ba67c89a | |
Zbigniew Jędrzejewski-Szmek | ccd31f53d6 | |
Zbigniew Jędrzejewski-Szmek | 79dacd0e70 | |
Zbigniew Jędrzejewski-Szmek | ed92d0ce5a | |
Zbigniew Jędrzejewski-Szmek | 0f2f0b41bf | |
Zbigniew Jędrzejewski-Szmek | 9d1b393670 | |
Zbigniew Jędrzejewski-Szmek | 35c34eda22 | |
Zbigniew Jędrzejewski-Szmek | 8bc40de82f | |
Zbigniew Jędrzejewski-Szmek | 708deb95da | |
Lennart Poettering | 0e1d85613a | |
Michal Sekletar | 6544f6a8d6 | |
Kay Sievers | fe3a44877c | |
Lukas Nykryn | 8bfd0a62fe | |
Zbigniew Jędrzejewski-Szmek | 6871be4b5e | |
Michal Schmidt | 5a725fc56f | |
Michal Schmidt | a562db4b47 | |
Michal Schmidt | 85c06859cf | |
Michal Schmidt | bcf90854cb | |
Harald Hoyer | e139c527b2 | |
Peter Robinson | e8e6a0c6f5 | |
Peter Robinson | 07c508db74 | |
Dan Horák | 5d51ffbe8a | |
Harald Hoyer | 513946b859 | |
Tom Callaway | 2fa2640dd5 |
File diff suppressed because it is too large
Load Diff
|
@ -1,35 +0,0 @@
|
|||
From ff14f3b995bfa85af05eb3108c96568eadf9d99c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Mon, 30 Jun 2014 20:10:16 -0400
|
||||
Subject: [PATCH] man: add link to Open Group Base Specifications
|
||||
|
||||
(cherry picked from commit 9c5dcb68b058b6bde056fc1ece768ba74a120091)
|
||||
---
|
||||
man/file-hierarchy.xml | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/man/file-hierarchy.xml b/man/file-hierarchy.xml
|
||||
index ed6e0e9a05..408042ee6e 100644
|
||||
--- a/man/file-hierarchy.xml
|
||||
+++ b/man/file-hierarchy.xml
|
||||
@@ -190,7 +190,9 @@
|
||||
should prefer using the directory
|
||||
specified in it over directly
|
||||
referencing
|
||||
- <filename>/tmp</filename> (see <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for details).</para></listitem>
|
||||
+ <filename>/tmp</filename> (see <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry>
|
||||
+ and
|
||||
+ <ulink url="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03">IEEE Std 1003.1</ulink> for details).</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
@@ -461,7 +463,8 @@
|
||||
set they should prefer using the
|
||||
directory specified in it over
|
||||
directly referencing
|
||||
- <filename>/var/tmp</filename> (see <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for details).
|
||||
+ <filename>/var/tmp</filename> (see <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry>
|
||||
+ for details).
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
From 7824f773110be8a0cecb89f650e13db03b58d1e1 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Mon, 7 Jul 2014 08:27:43 -0400
|
||||
Subject: [PATCH] resolved: Move symlink creation from tmpfiles to daemon
|
||||
runtime
|
||||
|
||||
At least Fedora right now doesn't by default use resolved; the service
|
||||
is disabled by default in the 90-default.preset file.
|
||||
|
||||
The change to unconditionally create the resolv.conf symlink broke
|
||||
Anaconda and related tools (lorax) which expect it to be a regular
|
||||
file. In particular, Anaconda expects to be able to persist
|
||||
networking state from the installation environment to the target
|
||||
system.
|
||||
|
||||
A simple fix is to just have resolved itself create it at runtime.
|
||||
---
|
||||
src/resolve/resolved-manager.c | 12 +++++++++++-
|
||||
tmpfiles.d/etc.conf | 1 -
|
||||
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
|
||||
index 3ed0603..1a6b3ac 100644
|
||||
--- a/src/resolve/resolved-manager.c
|
||||
+++ b/src/resolve/resolved-manager.c
|
||||
@@ -192,9 +192,11 @@ static void append_dns(FILE *f, void *dns, unsigned char family, unsigned *count
|
||||
|
||||
int manager_update_resolv_conf(Manager *m) {
|
||||
const char *path = "/run/systemd/resolve/resolv.conf";
|
||||
+ const char *etcresolv_path = "/etc/resolv.conf";
|
||||
_cleanup_free_ char *temp_path = NULL;
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
- _cleanup_free_ unsigned *indices = NULL;
|
||||
+ _cleanup_free_ unsigned *indices = NULL;
|
||||
+ struct stat st;
|
||||
Address *address;
|
||||
unsigned count = 0;
|
||||
int n, r, i;
|
||||
@@ -270,6 +272,14 @@ int manager_update_resolv_conf(Manager *m) {
|
||||
return r;
|
||||
}
|
||||
|
||||
+ /* Create /etc/resolv.conf as a link only if it doesn't exist */
|
||||
+ if (lstat(etcresolv_path, &st) < 0) {
|
||||
+ r = symlink(path, etcresolv_path);
|
||||
+ if (r < 0 && errno != EEXIST) {
|
||||
+ return r;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/tmpfiles.d/etc.conf b/tmpfiles.d/etc.conf
|
||||
index e809dff..4937719 100644
|
||||
--- a/tmpfiles.d/etc.conf
|
||||
+++ b/tmpfiles.d/etc.conf
|
||||
@@ -10,4 +10,3 @@
|
||||
L /etc/os-release - - - - ../usr/lib/os-release
|
||||
L /etc/localtime - - - - ../usr/share/zoneinfo/UTC
|
||||
L+ /etc/mtab - - - - ../proc/self/mounts
|
||||
-L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf
|
||||
--
|
||||
1.8.3.1
|
||||
|
|
@ -0,0 +1,374 @@
|
|||
From a8caf8eabad9bd51425c649189955c9fe18c9418 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 09:20:39 -0500
|
||||
Subject: [PATCH] Revert "timedated: manage systemd-timesyncd directly instead
|
||||
of lists of alternatives"
|
||||
|
||||
This reverts commit b72ddf0f4f552dd53d6404b6ddbc9f17d02b8e12.
|
||||
|
||||
Conflicts:
|
||||
Makefile.am
|
||||
NEWS
|
||||
---
|
||||
Makefile.am | 9 ++
|
||||
NEWS | 2 +
|
||||
src/timedate/timedated.c | 254 +++++++++++++++++++++++++++++------------------
|
||||
3 files changed, 171 insertions(+), 94 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 3666a927fd..3509665176 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -109,6 +109,7 @@ udevrulesdir=$(udevlibexecdir)/rules.d
|
||||
udevhwdbdir=$(udevlibexecdir)/hwdb.d
|
||||
catalogdir=$(prefix)/lib/systemd/catalog
|
||||
kernelinstalldir = $(prefix)/lib/kernel/install.d
|
||||
+ntpunitsdir=$(prefix)/lib/systemd/ntp-units.d
|
||||
factory_etcdir = $(prefix)/share/factory/etc
|
||||
factory_pamdir = $(prefix)/share/factory/etc/pam.d
|
||||
|
||||
@@ -4762,6 +4763,10 @@ dist_systemunit_DATA_busnames += \
|
||||
polkitpolicy_files += \
|
||||
src/timedate/org.freedesktop.timedate1.policy
|
||||
|
||||
+INSTALL_DIRS += \
|
||||
+ $(prefix)/lib/systemd/ntp-units.d \
|
||||
+ $(sysconfdir)/systemd/ntp-units.d
|
||||
+
|
||||
SYSTEM_UNIT_ALIASES += \
|
||||
systemd-timedated.service dbus-org.freedesktop.timedate1.service
|
||||
|
||||
@@ -4840,6 +4845,10 @@ EXTRA_DIST += \
|
||||
|
||||
CLEANFILES += \
|
||||
src/timesync/timesyncd.conf
|
||||
+
|
||||
+dist_ntpunits_DATA = \
|
||||
+ src/timesync/90-systemd.list
|
||||
+
|
||||
endif
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 84a43fd5df..078fabb1e5 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -218,6 +218,8 @@ CHANGES WITH 216:
|
||||
to their unit files to take over and replace systemd's NTP
|
||||
default functionality.
|
||||
|
||||
+ [ reverted in this branch ]
|
||||
+
|
||||
* systemd-sysusers gained a new line type "r" for configuring
|
||||
which UID/GID ranges to allocate system users/groups
|
||||
from. Lines of type "u" may now add an additional column
|
||||
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
|
||||
index 8880812b49..08b604dcca 100644
|
||||
--- a/src/timedate/timedated.c
|
||||
+++ b/src/timedate/timedated.c
|
||||
@@ -180,145 +180,211 @@ static int context_write_data_local_rtc(Context *c) {
|
||||
return write_string_file_atomic_label("/etc/adjtime", w);
|
||||
}
|
||||
|
||||
+static char** get_ntp_services(void) {
|
||||
+ _cleanup_strv_free_ char **r = NULL, **files = NULL;
|
||||
+ char **i;
|
||||
+ int k;
|
||||
+
|
||||
+ k = conf_files_list(&files, ".list", NULL,
|
||||
+ "/etc/systemd/ntp-units.d",
|
||||
+ "/run/systemd/ntp-units.d",
|
||||
+ "/usr/local/lib/systemd/ntp-units.d",
|
||||
+ "/usr/lib/systemd/ntp-units.d",
|
||||
+ NULL);
|
||||
+ if (k < 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ STRV_FOREACH(i, files) {
|
||||
+ _cleanup_fclose_ FILE *f;
|
||||
+
|
||||
+ f = fopen(*i, "re");
|
||||
+ if (!f)
|
||||
+ continue;
|
||||
+
|
||||
+ for (;;) {
|
||||
+ char line[PATH_MAX], *l;
|
||||
+
|
||||
+ if (!fgets(line, sizeof(line), f)) {
|
||||
+ if (ferror(f))
|
||||
+ log_error("Failed to read NTP unit file: %m");
|
||||
+
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ l = strstrip(line);
|
||||
+ if (l[0] == 0 || l[0] == '#')
|
||||
+ continue;
|
||||
+
|
||||
+ if (strv_extend(&r, l) < 0) {
|
||||
+ log_oom();
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ i = r;
|
||||
+ r = NULL; /* avoid cleanup */
|
||||
+
|
||||
+ return strv_uniq(i);
|
||||
+}
|
||||
+
|
||||
static int context_read_ntp(Context *c, sd_bus *bus) {
|
||||
- _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
- sd_bus_message *reply = NULL;
|
||||
- const char *s;
|
||||
+ _cleanup_strv_free_ char **l;
|
||||
+ char **i;
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
assert(bus);
|
||||
|
||||
- r = sd_bus_call_method(
|
||||
- bus,
|
||||
- "org.freedesktop.systemd1",
|
||||
- "/org/freedesktop/systemd1",
|
||||
- "org.freedesktop.systemd1.Manager",
|
||||
- "GetUnitFileState",
|
||||
- &error,
|
||||
- &reply,
|
||||
- "s",
|
||||
- "systemd-timesyncd.service");
|
||||
+ l = get_ntp_services();
|
||||
+ STRV_FOREACH(i, l) {
|
||||
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
+ sd_bus_message *reply = NULL;
|
||||
+ const char *s;
|
||||
|
||||
- if (r < 0) {
|
||||
- if (sd_bus_error_has_name(&error, SD_BUS_ERROR_FILE_NOT_FOUND) ||
|
||||
- sd_bus_error_has_name(&error, "org.freedesktop.systemd1.LoadFailed") ||
|
||||
- sd_bus_error_has_name(&error, "org.freedesktop.systemd1.NoSuchUnit"))
|
||||
- return 0;
|
||||
+ r = sd_bus_call_method(
|
||||
+ bus,
|
||||
+ "org.freedesktop.systemd1",
|
||||
+ "/org/freedesktop/systemd1",
|
||||
+ "org.freedesktop.systemd1.Manager",
|
||||
+ "GetUnitFileState",
|
||||
+ &error,
|
||||
+ &reply,
|
||||
+ "s",
|
||||
+ *i);
|
||||
|
||||
- return r;
|
||||
- }
|
||||
+ if (r < 0) {
|
||||
+ /* This implementation does not exist. Try the next one. */
|
||||
+ if (sd_bus_error_has_name(&error, SD_BUS_ERROR_FILE_NOT_FOUND))
|
||||
+ continue;
|
||||
|
||||
- r = sd_bus_message_read(reply, "s", &s);
|
||||
- if (r < 0)
|
||||
- return r;
|
||||
+ return r;
|
||||
+ }
|
||||
+
|
||||
+ r = sd_bus_message_read(reply, "s", &s);
|
||||
+ if (r < 0)
|
||||
+ return r;
|
||||
|
||||
- c->can_ntp = true;
|
||||
- c->use_ntp = STR_IN_SET(s, "enabled", "enabled-runtime");
|
||||
+ c->can_ntp = true;
|
||||
+ c->use_ntp = STR_IN_SET(s, "enabled", "enabled-runtime");
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int context_start_ntp(Context *c, sd_bus *bus, sd_bus_error *error) {
|
||||
+ _cleanup_strv_free_ char **l = NULL;
|
||||
+ char **i;
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
assert(bus);
|
||||
assert(error);
|
||||
|
||||
- if (c->use_ntp)
|
||||
- r = sd_bus_call_method(
|
||||
- bus,
|
||||
- "org.freedesktop.systemd1",
|
||||
- "/org/freedesktop/systemd1",
|
||||
- "org.freedesktop.systemd1.Manager",
|
||||
- "StartUnit",
|
||||
- error,
|
||||
- NULL,
|
||||
- "ss",
|
||||
- "systemd-timesyncd.service",
|
||||
- "replace");
|
||||
- else
|
||||
- r = sd_bus_call_method(
|
||||
- bus,
|
||||
- "org.freedesktop.systemd1",
|
||||
- "/org/freedesktop/systemd1",
|
||||
- "org.freedesktop.systemd1.Manager",
|
||||
- "StopUnit",
|
||||
- error,
|
||||
- NULL,
|
||||
- "ss",
|
||||
- "systemd-timesyncd.service",
|
||||
- "replace");
|
||||
+ l = get_ntp_services();
|
||||
+ STRV_FOREACH(i, l) {
|
||||
+
|
||||
+ if (c->use_ntp)
|
||||
+ r = sd_bus_call_method(
|
||||
+ bus,
|
||||
+ "org.freedesktop.systemd1",
|
||||
+ "/org/freedesktop/systemd1",
|
||||
+ "org.freedesktop.systemd1.Manager",
|
||||
+ "StartUnit",
|
||||
+ error,
|
||||
+ NULL,
|
||||
+ "ss", *i, "replace");
|
||||
+ else
|
||||
+ r = sd_bus_call_method(
|
||||
+ bus,
|
||||
+ "org.freedesktop.systemd1",
|
||||
+ "/org/freedesktop/systemd1",
|
||||
+ "org.freedesktop.systemd1.Manager",
|
||||
+ "StopUnit",
|
||||
+ error,
|
||||
+ NULL,
|
||||
+ "ss", *i, "replace");
|
||||
+
|
||||
+ if (r < 0) {
|
||||
+ if (sd_bus_error_has_name(error, SD_BUS_ERROR_FILE_NOT_FOUND) ||
|
||||
+ sd_bus_error_has_name(error, "org.freedesktop.systemd1.LoadFailed") ||
|
||||
+ sd_bus_error_has_name(error, "org.freedesktop.systemd1.NoSuchUnit")) {
|
||||
+ /* This implementation does not exist. Try the next one. */
|
||||
+ sd_bus_error_free(error);
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
- if (r < 0) {
|
||||
- if (sd_bus_error_has_name(error, SD_BUS_ERROR_FILE_NOT_FOUND) ||
|
||||
- sd_bus_error_has_name(error, "org.freedesktop.systemd1.LoadFailed") ||
|
||||
- sd_bus_error_has_name(error, "org.freedesktop.systemd1.NoSuchUnit")) {
|
||||
- sd_bus_error_set_const(error, "org.freedesktop.timedate1.NoNTPSupport", "NTP not supported.");
|
||||
- return -ENOTSUP;
|
||||
+ return r;
|
||||
}
|
||||
|
||||
- return r;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
- return 0;
|
||||
+ sd_bus_error_set_const(error, "org.freedesktop.timedate1.NoNTPSupport", "NTP not supported.");
|
||||
+ return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int context_enable_ntp(Context*c, sd_bus *bus, sd_bus_error *error) {
|
||||
+ _cleanup_strv_free_ char **l = NULL;
|
||||
+ char **i;
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
assert(bus);
|
||||
assert(error);
|
||||
|
||||
- if (c->use_ntp)
|
||||
- r = sd_bus_call_method(
|
||||
- bus,
|
||||
- "org.freedesktop.systemd1",
|
||||
- "/org/freedesktop/systemd1",
|
||||
- "org.freedesktop.systemd1.Manager",
|
||||
- "EnableUnitFiles",
|
||||
- error,
|
||||
- NULL,
|
||||
- "asbb", 1,
|
||||
- "systemd-timesyncd.service",
|
||||
- false, true);
|
||||
- else
|
||||
+ l = get_ntp_services();
|
||||
+ STRV_FOREACH(i, l) {
|
||||
+ if (c->use_ntp)
|
||||
+ r = sd_bus_call_method(
|
||||
+ bus,
|
||||
+ "org.freedesktop.systemd1",
|
||||
+ "/org/freedesktop/systemd1",
|
||||
+ "org.freedesktop.systemd1.Manager",
|
||||
+ "EnableUnitFiles",
|
||||
+ error,
|
||||
+ NULL,
|
||||
+ "asbb", 1, *i, false, true);
|
||||
+ else
|
||||
+ r = sd_bus_call_method(
|
||||
+ bus,
|
||||
+ "org.freedesktop.systemd1",
|
||||
+ "/org/freedesktop/systemd1",
|
||||
+ "org.freedesktop.systemd1.Manager",
|
||||
+ "DisableUnitFiles",
|
||||
+ error,
|
||||
+ NULL,
|
||||
+ "asb", 1, *i, false);
|
||||
+
|
||||
+ if (r < 0) {
|
||||
+ if (sd_bus_error_has_name(error, SD_BUS_ERROR_FILE_NOT_FOUND)) {
|
||||
+ /* This implementation does not exist. Try the next one. */
|
||||
+ sd_bus_error_free(error);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ return r;
|
||||
+ }
|
||||
+
|
||||
r = sd_bus_call_method(
|
||||
bus,
|
||||
"org.freedesktop.systemd1",
|
||||
"/org/freedesktop/systemd1",
|
||||
"org.freedesktop.systemd1.Manager",
|
||||
- "DisableUnitFiles",
|
||||
+ "Reload",
|
||||
error,
|
||||
NULL,
|
||||
- "asb", 1,
|
||||
- "systemd-timesyncd.service",
|
||||
- false);
|
||||
-
|
||||
- if (r < 0) {
|
||||
- if (sd_bus_error_has_name(error, SD_BUS_ERROR_FILE_NOT_FOUND)) {
|
||||
- sd_bus_error_set_const(error, "org.freedesktop.timedate1.NoNTPSupport", "NTP not supported.");
|
||||
- return -ENOTSUP;
|
||||
- }
|
||||
+ NULL);
|
||||
+ if (r < 0)
|
||||
+ return r;
|
||||
|
||||
- return r;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
- r = sd_bus_call_method(
|
||||
- bus,
|
||||
- "org.freedesktop.systemd1",
|
||||
- "/org/freedesktop/systemd1",
|
||||
- "org.freedesktop.systemd1.Manager",
|
||||
- "Reload",
|
||||
- error,
|
||||
- NULL,
|
||||
- NULL);
|
||||
- if (r < 0)
|
||||
- return r;
|
||||
-
|
||||
- return 0;
|
||||
+ sd_bus_error_set_const(error, "org.freedesktop.timedate1.NoNTPSupport", "NTP not supported.");
|
||||
+ return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int property_get_rtc_time(
|
|
@ -1,22 +0,0 @@
|
|||
From b1177a14132cb362a50f3ee8b79fab65ec6796dd Mon Sep 17 00:00:00 2001
|
||||
From: Umut Tezduyar Lindskog <umut.tezduyar@axis.com>
|
||||
Date: Thu, 3 Jul 2014 22:28:29 +0200
|
||||
Subject: [PATCH] sd-path: add missing header
|
||||
|
||||
(cherry picked from commit 0c7448867271180e8ac5795ebdff4bee0c0acd0c)
|
||||
---
|
||||
src/libsystemd/sd-path/sd-path.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c
|
||||
index 7ade915c2b..360c85405b 100644
|
||||
--- a/src/libsystemd/sd-path/sd-path.c
|
||||
+++ b/src/libsystemd/sd-path/sd-path.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "path-util.h"
|
||||
#include "strv.h"
|
||||
#include "sd-path.h"
|
||||
+#include "missing.h"
|
||||
|
||||
static int from_environment(const char *envname, const char *fallback, const char **ret) {
|
||||
assert(ret);
|
|
@ -0,0 +1,41 @@
|
|||
From 2ed2be30664faa7076edd819ea4ae429fab8ac08 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 09:42:01 -0500
|
||||
Subject: [PATCH] Revert "sysctl.d: default to fq_codel, fight bufferbloat"
|
||||
|
||||
This reverts commit e6c253e363dee77ef7e5c5f44c4ca55cded3fd47.
|
||||
|
||||
Conflicts:
|
||||
NEWS
|
||||
---
|
||||
NEWS | 2 ++
|
||||
sysctl.d/50-default.conf | 3 ---
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 078fabb1e5..c3d28a6394 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -100,6 +100,8 @@ CHANGES WITH 217:
|
||||
servers that do not do forwarding, "fq" may perform better.
|
||||
Systems without a good clocksource should use "pfifo_fast".
|
||||
|
||||
+ [ reverted in this branch ]
|
||||
+
|
||||
* If kdbus is enabled during build a new option BusPolicy= is
|
||||
available for service units, that allows locking all service
|
||||
processes into a stricter bus policy, in order to limit
|
||||
diff --git a/sysctl.d/50-default.conf b/sysctl.d/50-default.conf
|
||||
index f18923399b..8fc9ab77a9 100644
|
||||
--- a/sysctl.d/50-default.conf
|
||||
+++ b/sysctl.d/50-default.conf
|
||||
@@ -25,9 +25,6 @@ net.ipv4.conf.all.accept_source_route = 0
|
||||
net.ipv4.conf.default.promote_secondaries = 1
|
||||
net.ipv4.conf.all.promote_secondaries = 1
|
||||
|
||||
-# Fair Queue CoDel packet scheduler to fight bufferbloat
|
||||
-net.core.default_qdisc = fq_codel
|
||||
-
|
||||
# Enable hard and soft link protection
|
||||
fs.protected_hardlinks = 1
|
||||
fs.protected_symlinks = 1
|
|
@ -1,25 +0,0 @@
|
|||
From eda7cab62bcd8ba26a4a8681527684a7c4495357 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 3 Jul 2014 22:52:44 +0200
|
||||
Subject: [PATCH] architecture: remove "cris" from uname list
|
||||
|
||||
the only correct name appears to be "crisv32"...
|
||||
|
||||
http://lists.freedesktop.org/archives/systemd-devel/2014-July/020899.html
|
||||
(cherry picked from commit bc4bc52bc3de56405045b0437e145a7067fb085d)
|
||||
---
|
||||
src/shared/architecture.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/src/shared/architecture.c b/src/shared/architecture.c
|
||||
index 7dd049a36a..6cdca4e7e5 100644
|
||||
--- a/src/shared/architecture.c
|
||||
+++ b/src/shared/architecture.c
|
||||
@@ -115,7 +115,6 @@ Architecture uname_architecture(void) {
|
||||
#elif defined(__tilegx__)
|
||||
{ "tilegx", ARCHITECTURE_TILEGX },
|
||||
#elif defined(__cris__)
|
||||
- { "cris", ARCHITECTURE_CRIS },
|
||||
{ "crisv32", ARCHITECTURE_CRIS },
|
||||
#else
|
||||
#error "Please register your architecture here!"
|
|
@ -0,0 +1,54 @@
|
|||
From 93871b345b76480e99b9a135006cad47e10acd7f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 10:02:41 -0500
|
||||
Subject: [PATCH] Revert "units: define appropriate job timeout actions when
|
||||
boot or shutdown timeouts are hit"
|
||||
|
||||
This reverts commit 3898b80d409ae16b049d46f883bf763417bb4c8a.
|
||||
|
||||
We have various jobs that run during early boot and might cause
|
||||
basic.target not to be reached within 15 minutes. E.g. Fedora has
|
||||
fedora-autorelabel.service, which can take an arbitrarily long time on
|
||||
a large and slow drive.
|
||||
---
|
||||
units/basic.target | 2 --
|
||||
units/poweroff.target | 2 --
|
||||
units/reboot.target | 2 --
|
||||
3 files changed, 6 deletions(-)
|
||||
|
||||
diff --git a/units/basic.target b/units/basic.target
|
||||
index 228f62c4b1..b890d48bbc 100644
|
||||
--- a/units/basic.target
|
||||
+++ b/units/basic.target
|
||||
@@ -11,5 +11,3 @@ Documentation=man:systemd.special(7)
|
||||
Requires=sysinit.target
|
||||
Wants=sockets.target timers.target paths.target slices.target
|
||||
After=sysinit.target sockets.target timers.target paths.target slices.target
|
||||
-JobTimeoutSec=15min
|
||||
-JobTimeoutAction=poweroff-force
|
||||
diff --git a/units/poweroff.target b/units/poweroff.target
|
||||
index dd92d816ca..71871033a5 100644
|
||||
--- a/units/poweroff.target
|
||||
+++ b/units/poweroff.target
|
||||
@@ -12,8 +12,6 @@ DefaultDependencies=no
|
||||
Requires=systemd-poweroff.service
|
||||
After=systemd-poweroff.service
|
||||
AllowIsolate=yes
|
||||
-JobTimeoutSec=30min
|
||||
-JobTimeoutAction=poweroff-force
|
||||
|
||||
[Install]
|
||||
Alias=ctrl-alt-del.target
|
||||
diff --git a/units/reboot.target b/units/reboot.target
|
||||
index 668b98d9e4..dec8f56796 100644
|
||||
--- a/units/reboot.target
|
||||
+++ b/units/reboot.target
|
||||
@@ -12,8 +12,6 @@ DefaultDependencies=no
|
||||
Requires=systemd-reboot.service
|
||||
After=systemd-reboot.service
|
||||
AllowIsolate=yes
|
||||
-JobTimeoutSec=30min
|
||||
-JobTimeoutAction=reboot-force
|
||||
|
||||
[Install]
|
||||
Alias=ctrl-alt-del.target
|
|
@ -1,50 +0,0 @@
|
|||
From a8e0b3dcb6cb021193f7ab71e94bcc554cfd0348 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Gundersen <teg@jklm.no>
|
||||
Date: Thu, 3 Jul 2014 21:35:03 +0200
|
||||
Subject: [PATCH] networkd: link - improve link tracking logging
|
||||
|
||||
(cherry picked from commit 393c0c5e64d0cb85ce14f25a06fa8958c9e119e7)
|
||||
---
|
||||
src/network/networkd-link.c | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
|
||||
index 14c0417d83..961c1ab8ad 100644
|
||||
--- a/src/network/networkd-link.c
|
||||
+++ b/src/network/networkd-link.c
|
||||
@@ -2140,7 +2140,7 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
|
||||
|
||||
r = address_new_dynamic(&address);
|
||||
if (r < 0)
|
||||
- return 0;
|
||||
+ return r;
|
||||
|
||||
r = sd_rtnl_message_addr_get_family(message, &address->family);
|
||||
if (r < 0 || !IN_SET(address->family, AF_INET, AF_INET6)) {
|
||||
@@ -2204,7 +2204,10 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
|
||||
case RTM_NEWADDR:
|
||||
if (!address_dropped)
|
||||
log_debug_link(link, "added address: %s/%u", buf,
|
||||
- address->prefixlen);
|
||||
+ address->prefixlen);
|
||||
+ else
|
||||
+ log_debug_link(link, "updated address: %s/%u", buf,
|
||||
+ address->prefixlen);
|
||||
|
||||
LIST_PREPEND(addresses, link->addresses, address);
|
||||
address = NULL;
|
||||
@@ -2215,10 +2218,12 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
|
||||
case RTM_DELADDR:
|
||||
if (address_dropped) {
|
||||
log_debug_link(link, "removed address: %s/%u", buf,
|
||||
- address->prefixlen);
|
||||
+ address->prefixlen);
|
||||
|
||||
link_save(link);
|
||||
- }
|
||||
+ } else
|
||||
+ log_warning_link(link, "removing non-existent address: %s/%u",
|
||||
+ buf, address->prefixlen);
|
||||
|
||||
break;
|
||||
default:
|
|
@ -0,0 +1,38 @@
|
|||
From 2f0a6c615496777ec37f6815b8516f8b3a25e82e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 10:03:49 -0500
|
||||
Subject: [PATCH] Revert "Update NEWS"
|
||||
|
||||
This reverts commit 4ffd29fda1a2621d8f1711ccaad723d327fef93a.
|
||||
---
|
||||
NEWS | 17 -----------------
|
||||
1 file changed, 17 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index c3d28a6394..a590b3101b 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -22,23 +22,6 @@ CHANGES WITH 217:
|
||||
/run/systemd/user directory that was already previously
|
||||
supported, but is under the control of the user.
|
||||
|
||||
- * Job timeouts (i.e. time-outs on the time a job that is
|
||||
- queued stays in the run queue) can now optionally result in
|
||||
- immediate reboot or power-off actions (JobTimeoutAction= and
|
||||
- JobTimeoutRebootArgument=). This is useful on ".target"
|
||||
- units, to limit the maximum time a target remains
|
||||
- undispatched in the run queue, and to trigger an emergency
|
||||
- operation in such a case. This is now used by default to
|
||||
- turn off the system if boot-up (as defined by everything in
|
||||
- basic.target) hangs and does not complete for at least
|
||||
- 15min. Also, if power-off or reboot hang for at least 30min
|
||||
- an immediate power-off/reboot operation is triggered. This
|
||||
- functionality is particularly useful to increase reliability
|
||||
- on embedded devices, but also on laptops which might
|
||||
- accidentally get powered on when carried in a backpack and
|
||||
- whose boot stays stuck in a hard disk encryption passphrase
|
||||
- question.
|
||||
-
|
||||
* systemd-logind can be configured to also handle lid switch
|
||||
events even when the machine is docked or multiple displays
|
||||
are attached (HandleLidSwitchDocked= option).
|
|
@ -1,103 +0,0 @@
|
|||
From f49887cbe75da56dc8555d56c66daad78400b2b3 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Gundersen <teg@jklm.no>
|
||||
Date: Thu, 3 Jul 2014 22:47:51 +0200
|
||||
Subject: [PATCH] networkd: properly track addresses when first added
|
||||
|
||||
When doing a NEWADDR, the reply we get back is the NEWADDR itself, rather
|
||||
than just an empty ack (unlike how NEWLINK works). For this reason, the
|
||||
process that did the NEWADDR does not get the broadcast message.
|
||||
|
||||
We were only listening for broadcast messages, and hence not tracking the
|
||||
addresses we added ourselves. This went unnoticed as the kernel will usually
|
||||
send NEWADDR messages from time to time anyway, so things would mostly work,
|
||||
but in the worst case we would not notice that a routable address was available
|
||||
and consider ourselves offline.
|
||||
|
||||
(cherry picked from commit 4958aee4977f325be19f0e1e4b424922c3cada5f)
|
||||
---
|
||||
src/network/networkd-link.c | 54 +++++++++++++++++++++++++--------------------
|
||||
1 file changed, 30 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
|
||||
index 961c1ab8ad..6257372ffd 100644
|
||||
--- a/src/network/networkd-link.c
|
||||
+++ b/src/network/networkd-link.c
|
||||
@@ -599,10 +599,35 @@ static int route_drop_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int link_get_address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
|
||||
+ _cleanup_link_unref_ Link *link = userdata;
|
||||
+ int r;
|
||||
+
|
||||
+ assert(rtnl);
|
||||
+ assert(m);
|
||||
+ assert(link);
|
||||
+ assert(link->manager);
|
||||
+
|
||||
+ for (; m; m = sd_rtnl_message_next(m)) {
|
||||
+ r = sd_rtnl_message_get_errno(m);
|
||||
+ if (r < 0) {
|
||||
+ log_debug_link(link, "getting address failed: %s", strerror(-r));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ r = link_rtnl_process_address(rtnl, m, link->manager);
|
||||
+ if (r < 0)
|
||||
+ log_warning_link(link, "could not process address: %s", strerror(-r));
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
static int address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
|
||||
_cleanup_link_unref_ Link *link = userdata;
|
||||
int r;
|
||||
|
||||
+ assert(rtnl);
|
||||
assert(m);
|
||||
assert(link);
|
||||
assert(link->ifname);
|
||||
@@ -623,6 +648,11 @@ static int address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
|
||||
link->ifname, strerror(-r),
|
||||
"ERRNO=%d", -r,
|
||||
NULL);
|
||||
+ if (r >= 0) {
|
||||
+ /* calling handler directly so take a ref */
|
||||
+ link_ref(link);
|
||||
+ link_get_address_handler(rtnl, m, link);
|
||||
+ }
|
||||
|
||||
if (link->addr_messages == 0) {
|
||||
log_debug_link(link, "addresses set");
|
||||
@@ -2233,30 +2263,6 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
|
||||
return 1;
|
||||
}
|
||||
|
||||
-static int link_get_address_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
|
||||
- _cleanup_link_unref_ Link *link = userdata;
|
||||
- int r;
|
||||
-
|
||||
- assert(rtnl);
|
||||
- assert(m);
|
||||
- assert(link);
|
||||
- assert(link->manager);
|
||||
-
|
||||
- for (; m; m = sd_rtnl_message_next(m)) {
|
||||
- r = sd_rtnl_message_get_errno(m);
|
||||
- if (r < 0) {
|
||||
- log_debug_link(link, "getting address failed: %s", strerror(-r));
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- r = link_rtnl_process_address(rtnl, m, link->manager);
|
||||
- if (r < 0)
|
||||
- log_warning_link(link, "could not process address: %s", strerror(-r));
|
||||
- }
|
||||
-
|
||||
- return 1;
|
||||
-}
|
||||
-
|
||||
int link_add(Manager *m, sd_rtnl_message *message, Link **ret) {
|
||||
Link *link;
|
||||
_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
|
|
@ -0,0 +1,227 @@
|
|||
From 32e659e2d7a50ebe19dd82db116518eb150f7317 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 10:05:51 -0500
|
||||
Subject: [PATCH] Revert "login: remove multi-seat-x"
|
||||
|
||||
This reverts commit 3769415e6573da64fb80e31f4bb3f850cd99031e.
|
||||
|
||||
Conflicts:
|
||||
NEWS
|
||||
---
|
||||
.gitignore | 1 +
|
||||
Makefile.am | 14 ++++++
|
||||
NEWS | 6 ---
|
||||
TODO | 2 +
|
||||
configure.ac | 9 ++++
|
||||
src/login/multi-seat-x.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
6 files changed, 134 insertions(+), 6 deletions(-)
|
||||
create mode 100644 src/login/multi-seat-x.c
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 0b71f0973b..f119b574c7 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -93,6 +93,7 @@
|
||||
/systemd-machined
|
||||
/systemd-modeset
|
||||
/systemd-modules-load
|
||||
+/systemd-multi-seat-x
|
||||
/systemd-networkd
|
||||
/systemd-networkd-wait-online
|
||||
/systemd-notify
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 3509665176..11a3033253 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -5461,6 +5461,20 @@ SYSTEM_UNIT_ALIASES += \
|
||||
BUSNAMES_TARGET_WANTS += \
|
||||
org.freedesktop.login1.busname
|
||||
|
||||
+if ENABLE_MULTI_SEAT_X
|
||||
+
|
||||
+systemd_multi_seat_x_SOURCES = \
|
||||
+ src/login/multi-seat-x.c
|
||||
+
|
||||
+systemd_multi_seat_x_LDADD = \
|
||||
+ libsystemd-label.la \
|
||||
+ libsystemd-shared.la
|
||||
+
|
||||
+rootlibexec_PROGRAMS += \
|
||||
+ systemd-multi-seat-x
|
||||
+
|
||||
+endif
|
||||
+
|
||||
dist_udevrules_DATA += \
|
||||
src/login/70-uaccess.rules \
|
||||
src/login/70-power-switch.rules
|
||||
diff --git a/NEWS b/NEWS
|
||||
index a590b3101b..c85605f1d6 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -127,12 +127,6 @@ CHANGES WITH 217:
|
||||
occur. Again: you need to update util-linux to at least
|
||||
v2.25 when updating systemd to v217.
|
||||
|
||||
- * The "multi-seat-x" tool has been removed from systemd, as
|
||||
- its functionality has been integrated into X servers 1.16,
|
||||
- and the tool is hence redundant. It is recommended to update
|
||||
- display managers invoking this tool to simply invoke X
|
||||
- directly from now on, again.
|
||||
-
|
||||
* Support for the new ALLOW_INTERACTIVE_AUTHORIZATION D-Bus
|
||||
message flag has been added for all of systemd's PolicyKit
|
||||
authenticated method calls has been added. In particular
|
||||
diff --git a/TODO b/TODO
|
||||
index b07d664715..64b24c18a7 100644
|
||||
--- a/TODO
|
||||
+++ b/TODO
|
||||
@@ -88,6 +88,8 @@ Features:
|
||||
|
||||
* maybe introduce AssertXYZ= similar to ConditionXYZ= that causes a unit to fail (instead of skipping it) if some condition is not true...
|
||||
|
||||
+* remove multi-seat-x now
|
||||
+
|
||||
* refcounting in sd-resolve is borked
|
||||
|
||||
* exponential backoff in timesyncd and resolved when we cannot reach a server
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 48e094cd80..e63d3dc809 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1071,6 +1071,14 @@ fi
|
||||
AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
+have_multi_seat_x=no
|
||||
+AC_ARG_ENABLE(multi_seat_x, AS_HELP_STRING([--disable-multi-seat-x], [do not build multi-seat-x]))
|
||||
+if test "x$enable_multi_seat_x" != "xno"; then
|
||||
+ have_multi_seat_x=yes
|
||||
+fi
|
||||
+AM_CONDITIONAL(ENABLE_MULTI_SEAT_X, [test "$have_multi_seat_x" = "yes"])
|
||||
+
|
||||
+# ------------------------------------------------------------------------------
|
||||
have_terminal=no
|
||||
AC_ARG_ENABLE(terminal, AS_HELP_STRING([--enable-terminal], [enable terminal support]))
|
||||
if test "x$enable_terminal" = "xyes"; then
|
||||
@@ -1379,6 +1387,7 @@ AC_MSG_RESULT([
|
||||
nss-myhostname: ${have_myhostname}
|
||||
gudev: ${enable_gudev}
|
||||
gintrospection: ${enable_introspection}
|
||||
+ multi-seat-x: ${have_multi_seat_x}
|
||||
terminal: ${have_terminal}
|
||||
kdbus: ${have_kdbus}
|
||||
Python: ${have_python}
|
||||
diff --git a/src/login/multi-seat-x.c b/src/login/multi-seat-x.c
|
||||
new file mode 100644
|
||||
index 0000000000..83760d4191
|
||||
--- /dev/null
|
||||
+++ b/src/login/multi-seat-x.c
|
||||
@@ -0,0 +1,108 @@
|
||||
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
+
|
||||
+/***
|
||||
+ This file is part of systemd.
|
||||
+
|
||||
+ Copyright 2011 Lennart Poettering
|
||||
+
|
||||
+ systemd is free software; you can redistribute it and/or modify it
|
||||
+ under the terms of the GNU Lesser General Public License as published by
|
||||
+ the Free Software Foundation; either version 2.1 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ systemd is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public License
|
||||
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
+***/
|
||||
+
|
||||
+#include <string.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#include "util.h"
|
||||
+#include "mkdir.h"
|
||||
+
|
||||
+int main(int argc, char *argv[]) {
|
||||
+
|
||||
+ int i;
|
||||
+ const char *seat = NULL;
|
||||
+ char **new_argv;
|
||||
+ _cleanup_free_ char *path = NULL;
|
||||
+ int r;
|
||||
+ _cleanup_fclose_ FILE *f = NULL;
|
||||
+
|
||||
+ /* This binary will go away as soon as X natively takes the
|
||||
+ * arguments in question as command line parameters, instead
|
||||
+ * of requiring them in the configuration file. */
|
||||
+
|
||||
+ /* If this file is removed, don't forget to remove the code
|
||||
+ * that invokes this in gdm and other display managers. */
|
||||
+
|
||||
+ for (i = 1; i < argc; i++)
|
||||
+ if (streq(argv[i], "-seat"))
|
||||
+ seat = argv[i+1];
|
||||
+
|
||||
+ if (isempty(seat) || streq(seat, "seat0")) {
|
||||
+ argv[0] = (char*) X_SERVER;
|
||||
+ execv(X_SERVER, argv);
|
||||
+ log_error("Failed to execute real X server: %m");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ r = mkdir_safe_label("/run/systemd/multi-session-x", 0755, 0, 0);
|
||||
+ if (r < 0) {
|
||||
+ log_error("Failed to create directory: %s", strerror(-r));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ path = strappend("/run/systemd/multi-session-x/", seat);
|
||||
+ if (!path) {
|
||||
+ log_oom();
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ f = fopen(path, "we");
|
||||
+ if (!f) {
|
||||
+ log_error("Failed to write configuration file: %m");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ fprintf(f,
|
||||
+ "Section \"ServerFlags\"\n"
|
||||
+ " Option \"AutoAddDevices\" \"True\"\n"
|
||||
+ " Option \"AllowEmptyInput\" \"True\"\n"
|
||||
+ " Option \"DontVTSwitch\" \"True\"\n"
|
||||
+ "EndSection\n"
|
||||
+ "Section \"InputClass\"\n"
|
||||
+ " Identifier \"Force Input Devices to Seat\"\n"
|
||||
+ " Option \"GrabDevice\" \"True\"\n"
|
||||
+ "EndSection\n");
|
||||
+
|
||||
+ fflush(f);
|
||||
+
|
||||
+ if (ferror(f)) {
|
||||
+ log_error("Failed to write configuration file: %m");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ fclose(f);
|
||||
+ f = NULL;
|
||||
+
|
||||
+ new_argv = newa(char*, argc + 3 + 1);
|
||||
+ memcpy(new_argv, argv, sizeof(char*) * (argc + 2 + 1));
|
||||
+
|
||||
+ new_argv[0] = (char*) X_SERVER;
|
||||
+ new_argv[argc+0] = (char*) "-config";
|
||||
+ new_argv[argc+1] = path;
|
||||
+ new_argv[argc+2] = (char*) "-sharevts";
|
||||
+ new_argv[argc+3] = NULL;
|
||||
+
|
||||
+ execv(X_SERVER, new_argv);
|
||||
+ log_error("Failed to execute real X server: %m");
|
||||
+
|
||||
+fail:
|
||||
+ return EXIT_FAILURE;
|
||||
+}
|
|
@ -1,26 +0,0 @@
|
|||
From 9cb3134113680e868cd116944c8d6f0d21c1e939 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Gundersen <teg@jklm.no>
|
||||
Date: Fri, 4 Jul 2014 01:26:19 +0200
|
||||
Subject: [PATCH] man: netdev - mention tun and tap
|
||||
|
||||
Reported by Moviuro <moviuro@gmail.com>
|
||||
|
||||
(cherry picked from commit 54f601debc07addbed803fb847cd5bd3e91e021e)
|
||||
---
|
||||
man/systemd.netdev.xml | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml
|
||||
index c90bd8f98c..857221fdb0 100644
|
||||
--- a/man/systemd.netdev.xml
|
||||
+++ b/man/systemd.netdev.xml
|
||||
@@ -163,7 +163,8 @@
|
||||
<literal>macvlan</literal>, <literal>vxlan</literal>,
|
||||
<literal>ipip</literal>, <literal>gre</literal>,
|
||||
<literal>sit</literal>, <literal>vti</literal>,
|
||||
- <literal>veth</literal>, and <literal>dummy</literal>
|
||||
+ <literal>veth</literal>, <literal>tun</literal>,
|
||||
+ <literal>tap</literal> and <literal>dummy</literal>
|
||||
are supported. This option is compulsory.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
|
@ -0,0 +1,22 @@
|
|||
From 9bbe7b209c31fb3b31f7b0e1a66ae82b4c2768d9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 10:24:58 -0500
|
||||
Subject: [PATCH] Revert "service: add missing state table entry"
|
||||
|
||||
This reverts commit 1378a3b5a10444e6c9a17084c65032b4e1061c8e.
|
||||
---
|
||||
src/core/service.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/service.c b/src/core/service.c
|
||||
index f27e63eb9a..2b16778731 100644
|
||||
--- a/src/core/service.c
|
||||
+++ b/src/core/service.c
|
||||
@@ -2830,7 +2830,6 @@ static const char* const service_state_table[_SERVICE_STATE_MAX] = {
|
||||
[SERVICE_EXITED] = "exited",
|
||||
[SERVICE_RELOAD] = "reload",
|
||||
[SERVICE_STOP] = "stop",
|
||||
- [SERVICE_STOP_SIGABRT] = "stop-sigabrt",
|
||||
[SERVICE_STOP_SIGTERM] = "stop-sigterm",
|
||||
[SERVICE_STOP_SIGKILL] = "stop-sigkill",
|
||||
[SERVICE_STOP_POST] = "stop-post",
|
|
@ -1,47 +0,0 @@
|
|||
From fce5e80589911d813dd13d1d0d64df96e0ab7939 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 4 Jul 2014 03:07:20 +0200
|
||||
Subject: [PATCH] units: conditionalize static device node logic on
|
||||
CAP_SYS_MODULES instead of CAP_MKNOD
|
||||
|
||||
npsawn containers generally have CAP_MKNOD, since this is required
|
||||
to make PrviateDevices= work. Thus, it's not useful anymore to
|
||||
conditionalize the kmod static device node units.
|
||||
|
||||
Use CAP_SYS_MODULES instead which is not available for nspawn
|
||||
containers. However, the static device node logic is only done for being
|
||||
able to autoload modules with it, and if we can't do that there's no
|
||||
point in doing it.
|
||||
|
||||
(cherry picked from commit e0c74691c41a204eba2fd5f39615049fc9ff1648)
|
||||
---
|
||||
units/kmod-static-nodes.service.in | 2 +-
|
||||
units/systemd-tmpfiles-setup-dev.service.in | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/units/kmod-static-nodes.service.in b/units/kmod-static-nodes.service.in
|
||||
index 368f980fd1..0934a8751f 100644
|
||||
--- a/units/kmod-static-nodes.service.in
|
||||
+++ b/units/kmod-static-nodes.service.in
|
||||
@@ -9,7 +9,7 @@
|
||||
Description=Create list of required static device nodes for the current kernel
|
||||
DefaultDependencies=no
|
||||
Before=sysinit.target systemd-tmpfiles-setup-dev.service
|
||||
-ConditionCapability=CAP_MKNOD
|
||||
+ConditionCapability=CAP_SYS_MODULE
|
||||
ConditionPathExists=/lib/modules/%v/modules.devname
|
||||
|
||||
[Service]
|
||||
diff --git a/units/systemd-tmpfiles-setup-dev.service.in b/units/systemd-tmpfiles-setup-dev.service.in
|
||||
index b9cfc53bd1..06346d3b7c 100644
|
||||
--- a/units/systemd-tmpfiles-setup-dev.service.in
|
||||
+++ b/units/systemd-tmpfiles-setup-dev.service.in
|
||||
@@ -12,7 +12,7 @@ DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-sysusers.service
|
||||
Before=sysinit.target local-fs-pre.target systemd-udevd.service shutdown.target
|
||||
-ConditionCapability=CAP_MKNOD
|
||||
+ConditionCapability=CAP_SYS_MODULE
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
|
@ -0,0 +1,397 @@
|
|||
From d5cd1a02f0da4de24cce433b1759e3e297df0f5f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 10:25:06 -0500
|
||||
Subject: [PATCH] Revert "core: send sigabrt on watchdog timeout to get the
|
||||
stacktrace"
|
||||
|
||||
This reverts commit db2cb23b5b179707000d28a11efb3d888d06ee80.
|
||||
---
|
||||
TODO | 2 ++
|
||||
man/systemd.service.xml | 5 ++---
|
||||
src/core/busname.c | 2 +-
|
||||
src/core/mount.c | 3 +--
|
||||
src/core/scope.c | 2 +-
|
||||
src/core/service.c | 37 +++++++++++--------------------------
|
||||
src/core/service.h | 1 -
|
||||
src/core/socket.c | 3 +--
|
||||
src/core/swap.c | 3 +--
|
||||
src/core/unit.c | 24 ++++++------------------
|
||||
src/core/unit.h | 8 +-------
|
||||
11 files changed, 27 insertions(+), 63 deletions(-)
|
||||
|
||||
diff --git a/TODO b/TODO
|
||||
index 64b24c18a7..68506671fa 100644
|
||||
--- a/TODO
|
||||
+++ b/TODO
|
||||
@@ -48,6 +48,8 @@ Features:
|
||||
|
||||
* consider showing the unit names during boot up in the status output, not just the unit descriptions
|
||||
|
||||
+* send SIGABRT when a service watchdog is triggered, by default, so that we acquire a backtrace of the hang.
|
||||
+
|
||||
* dhcp: do we allow configuring dhcp routes on interfaces that are not the one we got the dhcp info from?
|
||||
|
||||
* maybe allow timer units with an empty Units= setting, so that they
|
||||
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
|
||||
index e563b1968b..115d1692ed 100644
|
||||
--- a/man/systemd.service.xml
|
||||
+++ b/man/systemd.service.xml
|
||||
@@ -593,9 +593,8 @@
|
||||
(i.e. the "keep-alive ping"). If the time
|
||||
between two such calls is larger than
|
||||
the configured time, then the service
|
||||
- is placed in a failed state and it will
|
||||
- be terminated with <varname>SIGABRT</varname>.
|
||||
- By setting <varname>Restart=</varname> to
|
||||
+ is placed in a failed state. By
|
||||
+ setting <varname>Restart=</varname> to
|
||||
<option>on-failure</option> or
|
||||
<option>always</option>, the service
|
||||
will be automatically restarted. The
|
||||
diff --git a/src/core/busname.c b/src/core/busname.c
|
||||
index 68cb6ca7b7..22d2a6d24b 100644
|
||||
--- a/src/core/busname.c
|
||||
+++ b/src/core/busname.c
|
||||
@@ -446,7 +446,7 @@ static void busname_enter_signal(BusName *n, BusNameState state, BusNameResult f
|
||||
|
||||
r = unit_kill_context(UNIT(n),
|
||||
&kill_context,
|
||||
- state != BUSNAME_SIGTERM ? KILL_KILL : KILL_TERMINATE,
|
||||
+ state != BUSNAME_SIGTERM,
|
||||
-1,
|
||||
n->control_pid,
|
||||
false);
|
||||
diff --git a/src/core/mount.c b/src/core/mount.c
|
||||
index 01243c381a..e284357c6f 100644
|
||||
--- a/src/core/mount.c
|
||||
+++ b/src/core/mount.c
|
||||
@@ -775,8 +775,7 @@ static void mount_enter_signal(Mount *m, MountState state, MountResult f) {
|
||||
r = unit_kill_context(
|
||||
UNIT(m),
|
||||
&m->kill_context,
|
||||
- (state != MOUNT_MOUNTING_SIGTERM && state != MOUNT_UNMOUNTING_SIGTERM && state != MOUNT_REMOUNTING_SIGTERM) ?
|
||||
- KILL_KILL : KILL_TERMINATE,
|
||||
+ state != MOUNT_MOUNTING_SIGTERM && state != MOUNT_UNMOUNTING_SIGTERM && state != MOUNT_REMOUNTING_SIGTERM,
|
||||
-1,
|
||||
m->control_pid,
|
||||
false);
|
||||
diff --git a/src/core/scope.c b/src/core/scope.c
|
||||
index 0f7c1f97ce..e8f9e8dd73 100644
|
||||
--- a/src/core/scope.c
|
||||
+++ b/src/core/scope.c
|
||||
@@ -243,7 +243,7 @@ static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) {
|
||||
r = unit_kill_context(
|
||||
UNIT(s),
|
||||
&s->kill_context,
|
||||
- state != SCOPE_STOP_SIGTERM ? KILL_KILL : KILL_TERMINATE,
|
||||
+ state != SCOPE_STOP_SIGTERM,
|
||||
-1, -1, false);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
diff --git a/src/core/service.c b/src/core/service.c
|
||||
index 2b16778731..d160c4e93b 100644
|
||||
--- a/src/core/service.c
|
||||
+++ b/src/core/service.c
|
||||
@@ -56,7 +56,6 @@ static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
|
||||
[SERVICE_EXITED] = UNIT_ACTIVE,
|
||||
[SERVICE_RELOAD] = UNIT_RELOADING,
|
||||
[SERVICE_STOP] = UNIT_DEACTIVATING,
|
||||
- [SERVICE_STOP_SIGABRT] = UNIT_DEACTIVATING,
|
||||
[SERVICE_STOP_SIGTERM] = UNIT_DEACTIVATING,
|
||||
[SERVICE_STOP_SIGKILL] = UNIT_DEACTIVATING,
|
||||
[SERVICE_STOP_POST] = UNIT_DEACTIVATING,
|
||||
@@ -77,7 +76,6 @@ static const UnitActiveState state_translation_table_idle[_SERVICE_STATE_MAX] =
|
||||
[SERVICE_EXITED] = UNIT_ACTIVE,
|
||||
[SERVICE_RELOAD] = UNIT_RELOADING,
|
||||
[SERVICE_STOP] = UNIT_DEACTIVATING,
|
||||
- [SERVICE_STOP_SIGABRT] = UNIT_DEACTIVATING,
|
||||
[SERVICE_STOP_SIGTERM] = UNIT_DEACTIVATING,
|
||||
[SERVICE_STOP_SIGKILL] = UNIT_DEACTIVATING,
|
||||
[SERVICE_STOP_POST] = UNIT_DEACTIVATING,
|
||||
@@ -665,7 +663,7 @@ static void service_set_state(Service *s, ServiceState state) {
|
||||
SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
|
||||
SERVICE_RELOAD,
|
||||
SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
|
||||
- SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
|
||||
+ SERVICE_STOP_POST,
|
||||
SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL,
|
||||
SERVICE_AUTO_RESTART))
|
||||
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
|
||||
@@ -674,7 +672,7 @@ static void service_set_state(Service *s, ServiceState state) {
|
||||
SERVICE_START, SERVICE_START_POST,
|
||||
SERVICE_RUNNING, SERVICE_RELOAD,
|
||||
SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
|
||||
- SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
|
||||
+ SERVICE_STOP_POST,
|
||||
SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL)) {
|
||||
service_unwatch_main_pid(s);
|
||||
s->main_command = NULL;
|
||||
@@ -684,7 +682,7 @@ static void service_set_state(Service *s, ServiceState state) {
|
||||
SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
|
||||
SERVICE_RELOAD,
|
||||
SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
|
||||
- SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
|
||||
+ SERVICE_STOP_POST,
|
||||
SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL)) {
|
||||
service_unwatch_control_pid(s);
|
||||
s->control_command = NULL;
|
||||
@@ -698,7 +696,7 @@ static void service_set_state(Service *s, ServiceState state) {
|
||||
SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
|
||||
SERVICE_RUNNING, SERVICE_RELOAD,
|
||||
SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL, SERVICE_STOP_POST,
|
||||
- SERVICE_STOP_SIGABRT, SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL) &&
|
||||
+ SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL) &&
|
||||
!(state == SERVICE_DEAD && UNIT(s)->job)) {
|
||||
service_close_socket_fd(s);
|
||||
service_connection_unref(s);
|
||||
@@ -752,7 +750,7 @@ static int service_coldplug(Unit *u) {
|
||||
SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
|
||||
SERVICE_RELOAD,
|
||||
SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
|
||||
- SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
|
||||
+ SERVICE_STOP_POST,
|
||||
SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL)) {
|
||||
|
||||
usec_t k;
|
||||
@@ -781,7 +779,7 @@ static int service_coldplug(Unit *u) {
|
||||
SERVICE_START, SERVICE_START_POST,
|
||||
SERVICE_RUNNING, SERVICE_RELOAD,
|
||||
SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
|
||||
- SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
|
||||
+ SERVICE_STOP_POST,
|
||||
SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL))) {
|
||||
r = unit_watch_pid(UNIT(s), s->main_pid);
|
||||
if (r < 0)
|
||||
@@ -793,7 +791,7 @@ static int service_coldplug(Unit *u) {
|
||||
SERVICE_START_PRE, SERVICE_START, SERVICE_START_POST,
|
||||
SERVICE_RELOAD,
|
||||
SERVICE_STOP, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL,
|
||||
- SERVICE_STOP_SIGABRT, SERVICE_STOP_POST,
|
||||
+ SERVICE_STOP_POST,
|
||||
SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL)) {
|
||||
r = unit_watch_pid(UNIT(s), s->control_pid);
|
||||
if (r < 0)
|
||||
@@ -1183,8 +1181,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
|
||||
r = unit_kill_context(
|
||||
UNIT(s),
|
||||
&s->kill_context,
|
||||
- (state != SERVICE_STOP_SIGTERM && state != SERVICE_FINAL_SIGTERM && state != SERVICE_STOP_SIGABRT) ?
|
||||
- KILL_KILL : (state == SERVICE_STOP_SIGABRT ? KILL_ABORT : KILL_TERMINATE),
|
||||
+ state != SERVICE_STOP_SIGTERM && state != SERVICE_FINAL_SIGTERM,
|
||||
s->main_pid,
|
||||
s->control_pid,
|
||||
s->main_pid_alien);
|
||||
@@ -1200,7 +1197,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
|
||||
}
|
||||
|
||||
service_set_state(s, state);
|
||||
- } else if (state == SERVICE_STOP_SIGTERM || state == SERVICE_STOP_SIGABRT)
|
||||
+ } else if (state == SERVICE_STOP_SIGTERM)
|
||||
service_enter_signal(s, SERVICE_STOP_SIGKILL, SERVICE_SUCCESS);
|
||||
else if (state == SERVICE_STOP_SIGKILL)
|
||||
service_enter_stop_post(s, SERVICE_SUCCESS);
|
||||
@@ -1214,8 +1211,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
|
||||
fail:
|
||||
log_warning_unit(UNIT(s)->id, "%s failed to kill processes: %s", UNIT(s)->id, strerror(-r));
|
||||
|
||||
- if (state == SERVICE_STOP_SIGTERM || state == SERVICE_STOP_SIGKILL ||
|
||||
- state == SERVICE_STOP_SIGABRT)
|
||||
+ if (state == SERVICE_STOP_SIGTERM || state == SERVICE_STOP_SIGKILL)
|
||||
service_enter_stop_post(s, SERVICE_FAILURE_RESOURCES);
|
||||
else
|
||||
service_enter_dead(s, SERVICE_FAILURE_RESOURCES, true);
|
||||
@@ -1641,7 +1637,6 @@ static int service_start(Unit *u) {
|
||||
/* We cannot fulfill this request right now, try again later
|
||||
* please! */
|
||||
if (s->state == SERVICE_STOP ||
|
||||
- s->state == SERVICE_STOP_SIGABRT ||
|
||||
s->state == SERVICE_STOP_SIGTERM ||
|
||||
s->state == SERVICE_STOP_SIGKILL ||
|
||||
s->state == SERVICE_STOP_POST ||
|
||||
@@ -1700,7 +1695,6 @@ static int service_stop(Unit *u) {
|
||||
|
||||
/* Already on it */
|
||||
if (s->state == SERVICE_STOP ||
|
||||
- s->state == SERVICE_STOP_SIGABRT ||
|
||||
s->state == SERVICE_STOP_SIGTERM ||
|
||||
s->state == SERVICE_STOP_SIGKILL ||
|
||||
s->state == SERVICE_STOP_POST ||
|
||||
@@ -2132,7 +2126,6 @@ static void service_notify_cgroup_empty_event(Unit *u) {
|
||||
service_enter_running(s, SERVICE_SUCCESS);
|
||||
break;
|
||||
|
||||
- case SERVICE_STOP_SIGABRT:
|
||||
case SERVICE_STOP_SIGTERM:
|
||||
case SERVICE_STOP_SIGKILL:
|
||||
|
||||
@@ -2259,7 +2252,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
|
||||
service_enter_running(s, f);
|
||||
break;
|
||||
|
||||
- case SERVICE_STOP_SIGABRT:
|
||||
case SERVICE_STOP_SIGTERM:
|
||||
case SERVICE_STOP_SIGKILL:
|
||||
|
||||
@@ -2400,7 +2392,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
|
||||
service_enter_signal(s, SERVICE_STOP_SIGTERM, f);
|
||||
break;
|
||||
|
||||
- case SERVICE_STOP_SIGABRT:
|
||||
case SERVICE_STOP_SIGTERM:
|
||||
case SERVICE_STOP_SIGKILL:
|
||||
if (main_pid_good(s) <= 0)
|
||||
@@ -2470,12 +2461,6 @@ static int service_dispatch_timer(sd_event_source *source, usec_t usec, void *us
|
||||
service_enter_signal(s, SERVICE_STOP_SIGTERM, SERVICE_FAILURE_TIMEOUT);
|
||||
break;
|
||||
|
||||
- case SERVICE_STOP_SIGABRT:
|
||||
- log_warning_unit(UNIT(s)->id,
|
||||
- "%s stop-sigabrt timed out. Terminating.", UNIT(s)->id);
|
||||
- service_enter_signal(s, SERVICE_STOP_SIGTERM, s->result);
|
||||
- break;
|
||||
-
|
||||
case SERVICE_STOP_SIGTERM:
|
||||
if (s->kill_context.send_sigkill) {
|
||||
log_warning_unit(UNIT(s)->id, "%s stop-sigterm timed out. Killing.", UNIT(s)->id);
|
||||
@@ -2543,7 +2528,7 @@ static int service_dispatch_watchdog(sd_event_source *source, usec_t usec, void
|
||||
log_error_unit(UNIT(s)->id, "%s watchdog timeout (limit %s)!", UNIT(s)->id,
|
||||
format_timespan(t, sizeof(t), s->watchdog_usec, 1));
|
||||
|
||||
- service_enter_signal(s, SERVICE_STOP_SIGABRT, SERVICE_FAILURE_WATCHDOG);
|
||||
+ service_enter_signal(s, SERVICE_STOP_SIGTERM, SERVICE_FAILURE_WATCHDOG);
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/src/core/service.h b/src/core/service.h
|
||||
index 54fbe46fa4..0db0c4d64c 100644
|
||||
--- a/src/core/service.h
|
||||
+++ b/src/core/service.h
|
||||
@@ -39,7 +39,6 @@ typedef enum ServiceState {
|
||||
SERVICE_EXITED, /* Nothing is running anymore, but RemainAfterExit is true hence this is OK */
|
||||
SERVICE_RELOAD,
|
||||
SERVICE_STOP, /* No STOP_PRE state, instead just register multiple STOP executables */
|
||||
- SERVICE_STOP_SIGABRT, /* Watchdog timeout */
|
||||
SERVICE_STOP_SIGTERM,
|
||||
SERVICE_STOP_SIGKILL,
|
||||
SERVICE_STOP_POST,
|
||||
diff --git a/src/core/socket.c b/src/core/socket.c
|
||||
index 6ba8338d8b..9004cb42cf 100644
|
||||
--- a/src/core/socket.c
|
||||
+++ b/src/core/socket.c
|
||||
@@ -1578,8 +1578,7 @@ static void socket_enter_signal(Socket *s, SocketState state, SocketResult f) {
|
||||
r = unit_kill_context(
|
||||
UNIT(s),
|
||||
&s->kill_context,
|
||||
- (state != SOCKET_STOP_PRE_SIGTERM && state != SOCKET_FINAL_SIGTERM) ?
|
||||
- KILL_KILL : KILL_TERMINATE,
|
||||
+ state != SOCKET_STOP_PRE_SIGTERM && state != SOCKET_FINAL_SIGTERM,
|
||||
-1,
|
||||
s->control_pid,
|
||||
false);
|
||||
diff --git a/src/core/swap.c b/src/core/swap.c
|
||||
index 1add722bf1..13e12ad67a 100644
|
||||
--- a/src/core/swap.c
|
||||
+++ b/src/core/swap.c
|
||||
@@ -687,8 +687,7 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) {
|
||||
r = unit_kill_context(
|
||||
UNIT(s),
|
||||
&s->kill_context,
|
||||
- (state != SWAP_ACTIVATING_SIGTERM && state != SWAP_DEACTIVATING_SIGTERM) ?
|
||||
- KILL_KILL : KILL_TERMINATE,
|
||||
+ state != SWAP_ACTIVATING_SIGTERM && state != SWAP_DEACTIVATING_SIGTERM,
|
||||
-1,
|
||||
s->control_pid,
|
||||
false);
|
||||
diff --git a/src/core/unit.c b/src/core/unit.c
|
||||
index 84f210a312..489ea1e502 100644
|
||||
--- a/src/core/unit.c
|
||||
+++ b/src/core/unit.c
|
||||
@@ -3313,7 +3313,7 @@ int unit_make_transient(Unit *u) {
|
||||
int unit_kill_context(
|
||||
Unit *u,
|
||||
KillContext *c,
|
||||
- KillOperation k,
|
||||
+ bool sigkill,
|
||||
pid_t main_pid,
|
||||
pid_t control_pid,
|
||||
bool main_pid_alien) {
|
||||
@@ -3326,19 +3326,7 @@ int unit_kill_context(
|
||||
if (c->kill_mode == KILL_NONE)
|
||||
return 0;
|
||||
|
||||
- switch (k) {
|
||||
- case KILL_KILL:
|
||||
- sig = SIGKILL;
|
||||
- break;
|
||||
- case KILL_ABORT:
|
||||
- sig = SIGABRT;
|
||||
- break;
|
||||
- case KILL_TERMINATE:
|
||||
- sig = c->kill_signal;
|
||||
- break;
|
||||
- default:
|
||||
- assert_not_reached("KillOperation unknown");
|
||||
- }
|
||||
+ sig = sigkill ? SIGKILL : c->kill_signal;
|
||||
|
||||
if (main_pid > 0) {
|
||||
r = kill_and_sigcont(main_pid, sig);
|
||||
@@ -3352,7 +3340,7 @@ int unit_kill_context(
|
||||
if (!main_pid_alien)
|
||||
wait_for_exit = true;
|
||||
|
||||
- if (c->send_sighup && k != KILL_KILL)
|
||||
+ if (c->send_sighup && !sigkill)
|
||||
kill(main_pid, SIGHUP);
|
||||
}
|
||||
}
|
||||
@@ -3368,12 +3356,12 @@ int unit_kill_context(
|
||||
} else {
|
||||
wait_for_exit = true;
|
||||
|
||||
- if (c->send_sighup && k != KILL_KILL)
|
||||
+ if (c->send_sighup && !sigkill)
|
||||
kill(control_pid, SIGHUP);
|
||||
}
|
||||
}
|
||||
|
||||
- if ((c->kill_mode == KILL_CONTROL_GROUP || (c->kill_mode == KILL_MIXED && k == KILL_KILL)) && u->cgroup_path) {
|
||||
+ if ((c->kill_mode == KILL_CONTROL_GROUP || (c->kill_mode == KILL_MIXED && sigkill)) && u->cgroup_path) {
|
||||
_cleanup_set_free_ Set *pid_set = NULL;
|
||||
|
||||
/* Exclude the main/control pids from being killed via the cgroup */
|
||||
@@ -3397,7 +3385,7 @@ int unit_kill_context(
|
||||
|
||||
/* wait_for_exit = true; */
|
||||
|
||||
- if (c->send_sighup && k != KILL_KILL) {
|
||||
+ if (c->send_sighup && !sigkill) {
|
||||
set_free(pid_set);
|
||||
|
||||
pid_set = unit_pid_set(main_pid, control_pid);
|
||||
diff --git a/src/core/unit.h b/src/core/unit.h
|
||||
index 081ab18f10..bbad546356 100644
|
||||
--- a/src/core/unit.h
|
||||
+++ b/src/core/unit.h
|
||||
@@ -54,12 +54,6 @@ enum UnitActiveState {
|
||||
_UNIT_ACTIVE_STATE_INVALID = -1
|
||||
};
|
||||
|
||||
-typedef enum KillOperation {
|
||||
- KILL_TERMINATE,
|
||||
- KILL_KILL,
|
||||
- KILL_ABORT,
|
||||
-} KillOperation;
|
||||
-
|
||||
static inline bool UNIT_IS_ACTIVE_OR_RELOADING(UnitActiveState t) {
|
||||
return t == UNIT_ACTIVE || t == UNIT_RELOADING;
|
||||
}
|
||||
@@ -582,7 +576,7 @@ int unit_write_drop_in_private_format(Unit *u, UnitSetPropertiesMode mode, const
|
||||
|
||||
int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name);
|
||||
|
||||
-int unit_kill_context(Unit *u, KillContext *c, KillOperation k, pid_t main_pid, pid_t control_pid, bool main_pid_alien);
|
||||
+int unit_kill_context(Unit *u, KillContext *c, bool sigkill, pid_t main_pid, pid_t control_pid, bool main_pid_alien);
|
||||
|
||||
int unit_make_transient(Unit *u);
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
From b654a1065f278c93b3891cc5993645026e0d3702 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 4 Jul 2014 03:10:09 +0200
|
||||
Subject: [PATCH] units: conditionalize configfs and debugfs with CAP_SYS_RAWIO
|
||||
|
||||
We really don't want these in containers as they provide a too lowlevel
|
||||
look on the system.
|
||||
|
||||
Conditionalize them with CAP_SYS_RAWIO since that's required to access
|
||||
/proc/kcore, /dev/kmem and similar, which feel similar in style. Also,
|
||||
npsawn containers lack that capability.
|
||||
|
||||
(cherry picked from commit fa229d09281d435153b4cfd138a2a62fa66d889b)
|
||||
---
|
||||
units/sys-kernel-config.mount | 1 +
|
||||
units/sys-kernel-debug.mount | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/units/sys-kernel-config.mount b/units/sys-kernel-config.mount
|
||||
index 020101c0d8..21648eff6a 100644
|
||||
--- a/units/sys-kernel-config.mount
|
||||
+++ b/units/sys-kernel-config.mount
|
||||
@@ -11,6 +11,7 @@ Documentation=https://www.kernel.org/doc/Documentation/filesystems/configfs/conf
|
||||
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
|
||||
DefaultDependencies=no
|
||||
ConditionPathExists=/sys/kernel/config
|
||||
+ConditionCapability=CAP_SYS_RAWIO
|
||||
After=systemd-modules-load.service
|
||||
Before=sysinit.target
|
||||
|
||||
diff --git a/units/sys-kernel-debug.mount b/units/sys-kernel-debug.mount
|
||||
index 5369728a9f..1e94387bac 100644
|
||||
--- a/units/sys-kernel-debug.mount
|
||||
+++ b/units/sys-kernel-debug.mount
|
||||
@@ -11,6 +11,7 @@ Documentation=https://www.kernel.org/doc/Documentation/filesystems/debugfs.txt
|
||||
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
|
||||
DefaultDependencies=no
|
||||
ConditionPathExists=/sys/kernel/debug
|
||||
+ConditionCapability=CAP_SYS_RAWIO
|
||||
Before=sysinit.target
|
||||
|
||||
[Mount]
|
|
@ -0,0 +1,23 @@
|
|||
From 6bb37d22af95d11df7f487f3e34abc97fa5fa9bf Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Tue, 28 Oct 2014 20:36:32 +0100
|
||||
Subject: [PATCH] NEWS: well, it's Options= now, not Discard=
|
||||
|
||||
(cherry picked from commit c4ac990007cd0069bb7e76ec15dd731320f382fd)
|
||||
---
|
||||
NEWS | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index c85605f1d6..bf8d0ac242 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -59,7 +59,7 @@ CHANGES WITH 217:
|
||||
rotating media anymore, and nobody stepped up to actively
|
||||
maintain this component of systemd it has now been removed.
|
||||
|
||||
- * Swap units can use Discard= to specify discard options.
|
||||
+ * Swap units can use Options= to specify discard options.
|
||||
Discard options specified for swaps in /etc/fstab are now
|
||||
respected.
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
From 59afe82145260430e426cf4ac999e8fc69e2a288 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 4 Jul 2014 03:13:05 +0200
|
||||
Subject: [PATCH] main: change check whether /etc is unpopulated to look for
|
||||
/etc/machine-id
|
||||
|
||||
Previously, we checked whether /etc was completely empty. This makes it
|
||||
difficult though for container managers such as nspawn to install a
|
||||
small number of files (such as /etc/timezone), and have the system
|
||||
otherwise populate its own tree.
|
||||
|
||||
Hence, change this by looking for /etc/machine-id, which should be a
|
||||
good sign whether /etc is populated or not.
|
||||
|
||||
(cherry picked from commit baa1bdf70f21848fbe01d3f383ae0f59d86a9bf3)
|
||||
---
|
||||
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 38835fc620..1ca899998e 100644
|
||||
--- a/src/core/main.c
|
||||
+++ b/src/core/main.c
|
||||
@@ -1543,7 +1543,7 @@ int main(int argc, char *argv[]) {
|
||||
if (in_initrd())
|
||||
log_info("Running in initial RAM disk.");
|
||||
|
||||
- empty_etc = dir_is_empty("/etc") > 0;
|
||||
+ empty_etc = access("/etc/machine-id", F_OK) < 0;
|
||||
if (empty_etc)
|
||||
log_info("Running with unpopulated /etc.");
|
||||
} else {
|
|
@ -1,28 +0,0 @@
|
|||
From 1b74050afb9b407eaa59c67b6015611c9113f7e4 Mon Sep 17 00:00:00 2001
|
||||
From: Steven Noonan <steven@uplinklabs.net>
|
||||
Date: Thu, 3 Jul 2014 19:43:56 -0700
|
||||
Subject: [PATCH] networkd: don't clear dhcpv6 lease timers if there's no
|
||||
previous lease
|
||||
|
||||
If client->lease is NULL, dhcp6_lease_clear_timers will cause a segmentation
|
||||
fault.
|
||||
|
||||
(cherry picked from commit b1e1238fb3af77419eca704fb64f68a313954734)
|
||||
---
|
||||
src/libsystemd-network/sd-dhcp6-client.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
|
||||
index 8fdbbfe320..a83778e938 100644
|
||||
--- a/src/libsystemd-network/sd-dhcp6-client.c
|
||||
+++ b/src/libsystemd-network/sd-dhcp6-client.c
|
||||
@@ -708,7 +708,8 @@ static int client_receive_reply(sd_dhcp6_client *client, DHCP6Message *reply,
|
||||
return 0;
|
||||
}
|
||||
|
||||
- dhcp6_lease_clear_timers(&client->lease->ia);
|
||||
+ if (client->lease)
|
||||
+ dhcp6_lease_clear_timers(&client->lease->ia);
|
||||
|
||||
client->lease = sd_dhcp6_lease_unref(client->lease);
|
||||
client->lease = lease;
|
|
@ -0,0 +1,23 @@
|
|||
From 8207682d7a40270e6581515e3537adaff885a072 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Wed, 29 Oct 2014 17:58:43 +0100
|
||||
Subject: [PATCH] sd-bus: properly handle removals of non-existing matches
|
||||
|
||||
(cherry picked from commit ef7b6c0190fefaacf6d8f8e1a6dda4ba8b98091b)
|
||||
---
|
||||
src/libsystemd/sd-bus/bus-match.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c
|
||||
index 18afe0f12a..5658c61ba7 100644
|
||||
--- a/src/libsystemd/sd-bus/bus-match.c
|
||||
+++ b/src/libsystemd/sd-bus/bus-match.c
|
||||
@@ -537,7 +537,7 @@ static int bus_match_find_compare_value(
|
||||
else if (BUS_MATCH_CAN_HASH(t))
|
||||
n = hashmap_get(c->compare.children, value_str);
|
||||
else {
|
||||
- for (n = c->child; !value_node_same(n, t, value_u8, value_str); n = n->next)
|
||||
+ for (n = c->child; n && !value_node_same(n, t, value_u8, value_str); n = n->next)
|
||||
;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
From 18aa6c0119fbcad1e569f1d178c4f1691d4e3b90 Mon Sep 17 00:00:00 2001
|
||||
From: Steven Noonan <steven@uplinklabs.net>
|
||||
Date: Thu, 3 Jul 2014 19:42:19 -0700
|
||||
Subject: [PATCH] networkd: accept section DHCP in systemd.network files
|
||||
|
||||
(cherry picked from commit c38d2eb828f1a62ae9052c9db45ccc70f98fdb47)
|
||||
---
|
||||
src/network/networkd-network.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
|
||||
index 9ab4f23068..9f6de18538 100644
|
||||
--- a/src/network/networkd-network.c
|
||||
+++ b/src/network/networkd-network.c
|
||||
@@ -92,7 +92,7 @@ static int network_load_one(Manager *manager, const char *filename) {
|
||||
network->dhcp_routes = true;
|
||||
network->dhcp_sendhost = true;
|
||||
|
||||
- r = config_parse(NULL, filename, file, "Match\0Network\0Address\0Route\0DHCPv4\0", config_item_perf_lookup,
|
||||
+ r = config_parse(NULL, filename, file, "Match\0Network\0Address\0Route\0DHCP\0DHCPv4\0", config_item_perf_lookup,
|
||||
(void*) network_network_gperf_lookup, false, false, network);
|
||||
if (r < 0) {
|
||||
log_warning("Could not parse config file %s: %s", filename, strerror(-r));
|
|
@ -0,0 +1,32 @@
|
|||
From 5b6b524662ddc3178b4d8c2e51eba5d023ad08c4 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Reisner <dreisner@archlinux.org>
|
||||
Date: Wed, 29 Oct 2014 13:32:43 -0400
|
||||
Subject: [PATCH] nspawn: ignore EEXIST when creating mount point
|
||||
|
||||
A combination of commits f3c80515c and 79d80fc14 cause nspawn to
|
||||
silently fail with a commandline such as:
|
||||
|
||||
# systemd-nspawn -D /build/extra-x86_64 --bind=/usr
|
||||
|
||||
strace shows the culprit:
|
||||
|
||||
[pid 27868] writev(2, [{"Failed to create mount point /build/extra-x86_64/usr: File exists", 82}, {"\n", 1}], 2) = 83
|
||||
|
||||
(cherry picked from commit 1ab19cb167b32967556eefd8f6d3df0e3de7d67d)
|
||||
---
|
||||
src/nspawn/nspawn.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
|
||||
index b6d9bc631c..d88987a580 100644
|
||||
--- a/src/nspawn/nspawn.c
|
||||
+++ b/src/nspawn/nspawn.c
|
||||
@@ -758,7 +758,7 @@ static int mount_binds(const char *dest, char **l, bool ro) {
|
||||
* and char devices. */
|
||||
if (S_ISDIR(source_st.st_mode)) {
|
||||
r = mkdir_label(where, 0755);
|
||||
- if (r < 0) {
|
||||
+ if (r < 0 && errno != EEXIST) {
|
||||
log_error("Failed to create mount point %s: %s", where, strerror(-r));
|
||||
|
||||
return r;
|
|
@ -1,25 +0,0 @@
|
|||
From 6e07a1c070376b7c2bcc8d57e8adbc8f6f78e8d5 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Gundersen <teg@jklm.no>
|
||||
Date: Sun, 6 Jul 2014 14:12:28 +0200
|
||||
Subject: [PATCH] machine: don't return uninitialized variable
|
||||
|
||||
Repotred by Ronny Chevalier
|
||||
|
||||
(cherry picked from commit f14aa1f1b2e4e99ee20393871b5f64f1378ed6c3)
|
||||
---
|
||||
src/machine/machine.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/machine/machine.c b/src/machine/machine.c
|
||||
index c0fa1b24b6..cf38e3fb94 100644
|
||||
--- a/src/machine/machine.c
|
||||
+++ b/src/machine/machine.c
|
||||
@@ -371,7 +371,7 @@ static int machine_stop_scope(Machine *m) {
|
||||
free(m->scope_job);
|
||||
m->scope_job = job;
|
||||
|
||||
- return r;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
int machine_stop(Machine *m) {
|
|
@ -0,0 +1,40 @@
|
|||
From c96c14e1f545e6533c781e33c2238d1433deb30f Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay@vrfy.org>
|
||||
Date: Thu, 30 Oct 2014 01:18:34 +0100
|
||||
Subject: [PATCH] udev: path_id - update comments
|
||||
|
||||
(cherry picked from commit a42cdff19f2d34f12ceca0f40707421a8aaa2c2f)
|
||||
---
|
||||
src/udev/udev-builtin-path_id.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
|
||||
index 0d247f6b5a..df996cb17a 100644
|
||||
--- a/src/udev/udev-builtin-path_id.c
|
||||
+++ b/src/udev/udev-builtin-path_id.c
|
||||
@@ -548,9 +548,9 @@ static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
|
||||
}
|
||||
|
||||
/*
|
||||
- * Do return devices with have an unknown type of parent device, they
|
||||
- * might produce conflicting IDs below multiple independent parent
|
||||
- * devices.
|
||||
+ * Do not return devices with an unknown parent device type. They
|
||||
+ * might produce conflicting IDs if the parent does not provide a
|
||||
+ * unique and predictable name.
|
||||
*/
|
||||
if (!supported_parent) {
|
||||
free(path);
|
||||
@@ -558,9 +558,9 @@ static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
|
||||
}
|
||||
|
||||
/*
|
||||
- * Do not return a have-only a single-parent block devices, some
|
||||
- * have entire hidden buses behind it, and not create predictable
|
||||
- * IDs that way.
|
||||
+ * Do not return block devices without a well-known transport. Some
|
||||
+ * devices do not expose their buses and do not provide a unique
|
||||
+ * and predictable name that way.
|
||||
*/
|
||||
if (streq(udev_device_get_subsystem(dev), "block") && !supported_transport) {
|
||||
free(path);
|
|
@ -0,0 +1,71 @@
|
|||
From 1c7a80d7748ee8c4117ccbb628274413f2c7cb59 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Wed, 29 Oct 2014 22:25:33 -0400
|
||||
Subject: [PATCH] bash-completion: rework startable/restartable units once more
|
||||
|
||||
I tried to use 'systemctl --all list-units' to filter unit files, but
|
||||
this always filters out unit files which are not loaded. We want to complete
|
||||
systemctl start with those units too, so this approach is not going to work.
|
||||
|
||||
New version is rather slow, but hopefully correct.
|
||||
|
||||
(cherry picked from commit 9ff8af5460d57dfab78a1137ec743b539715e82a)
|
||||
---
|
||||
shell-completion/bash/systemctl.in | 27 ++++++++++++++-------------
|
||||
1 file changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
|
||||
index 1c44a8df01..9e538a9a5b 100644
|
||||
--- a/shell-completion/bash/systemctl.in
|
||||
+++ b/shell-completion/bash/systemctl.in
|
||||
@@ -52,20 +52,23 @@ __filter_units_by_property () {
|
||||
}
|
||||
|
||||
__get_all_units () { { __systemctl $1 list-unit-files; __systemctl $1 list-units --all; } \
|
||||
- | { while read -r a b; do echo " $a"; done; }; }
|
||||
+ | { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }; }
|
||||
__get_template_names () { __systemctl $1 list-unit-files \
|
||||
| { while read -r a b; do [[ $a =~ @\. ]] && echo " ${a%%@.*}@"; done; }; }
|
||||
|
||||
__get_active_units () { __systemctl $1 list-units \
|
||||
| { while read -r a b; do echo " $a"; done; }; }
|
||||
__get_startable_units () {
|
||||
- # find inactive or failed units, filter out masked and not-found
|
||||
- __systemctl $1 list-units --state inactive,failed -- $( __get_all_units ) | \
|
||||
- { while read -r a b c d; do [[ $b == "loaded" ]] && echo " $a"; done; }; }
|
||||
+ # find startable inactive units
|
||||
+ __filter_units_by_property $mode LoadState loaded $(
|
||||
+ __filter_units_by_property $mode ActiveState inactive $(
|
||||
+ __filter_units_by_property $mode CanStart yes $( __get_all_units )))
|
||||
+}
|
||||
__get_restartable_units () {
|
||||
- # find !masked, filter out masked and not-found
|
||||
- __systemctl $1 list-units --state active,inactive,failed -- $( __get_all_units ) | \
|
||||
- { while read -r a b c d; do [[ $b == "loaded" ]] && echo " $a"; done; }; }
|
||||
+ # filter out masked and not-found
|
||||
+ __filter_units_by_property $mode LoadState loaded $(
|
||||
+ __filter_units_by_property $mode CanStart yes $( __get_all_units ))
|
||||
+}
|
||||
__get_failed_units () { __systemctl $1 list-units \
|
||||
| { while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }; }
|
||||
__get_enabled_units () { __systemctl $1 list-unit-files \
|
||||
@@ -186,15 +189,13 @@ _systemctl () {
|
||||
compopt -o filenames
|
||||
|
||||
elif __contains_word "$verb" ${VERBS[STARTABLE_UNITS]}; then
|
||||
- comps=$( __filter_units_by_property $mode CanStart yes \
|
||||
- $( __get_startable_units $mode);
|
||||
- __get_template_names $mode)
|
||||
+ comps=$( __get_startable_units $mode;
|
||||
+ __get_template_names $mode)
|
||||
compopt -o filenames
|
||||
|
||||
elif __contains_word "$verb" ${VERBS[RESTARTABLE_UNITS]}; then
|
||||
- comps=$( __filter_units_by_property $mode CanStart yes \
|
||||
- $( __get_restartable_units $mode); \
|
||||
- __get_template_names $mode)
|
||||
+ comps=$( __get_restartable_units $mode;
|
||||
+ __get_template_names $mode)
|
||||
compopt -o filenames
|
||||
|
||||
elif __contains_word "$verb" ${VERBS[STOPPABLE_UNITS]}; then
|
|
@ -1,23 +0,0 @@
|
|||
From e41d164c532fa4345bc2dd1c5e1daaaec76b787c Mon Sep 17 00:00:00 2001
|
||||
From: Ronny Chevalier <chevalier.ronny@gmail.com>
|
||||
Date: Sun, 6 Jul 2014 13:33:38 +0200
|
||||
Subject: [PATCH] sysusers: fix uninitialized warning
|
||||
|
||||
(cherry picked from commit bce415edcae8e7af8327de8265d621f95fa5426f)
|
||||
---
|
||||
src/sysusers/sysusers.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
|
||||
index 1209a5a8b4..c0af69300a 100644
|
||||
--- a/src/sysusers/sysusers.c
|
||||
+++ b/src/sysusers/sysusers.c
|
||||
@@ -1312,6 +1312,8 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||
|
||||
h = groups;
|
||||
break;
|
||||
+ default:
|
||||
+ return -EBADMSG;
|
||||
}
|
||||
|
||||
i->type = action[0];
|
|
@ -0,0 +1,98 @@
|
|||
From 4ffc2172253c5ac6ad49bee3c87e5740ae520c8a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Wed, 29 Oct 2014 22:46:30 -0400
|
||||
Subject: [PATCH] systemctl: let list-{units,unit-files } honour --type
|
||||
|
||||
The docs don't clarify what is expected, but I don't see any reason
|
||||
why --type should be ignored.
|
||||
|
||||
Also restucture the compund conditions into separate clauses for
|
||||
easier reading.
|
||||
|
||||
(cherry picked from commit 6c71341aeecc3d092ed90f66e1b2c481b8e260ff)
|
||||
---
|
||||
src/systemctl/systemctl.c | 48 ++++++++++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 37 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
||||
index 28eaa6a847..b71040be40 100644
|
||||
--- a/src/systemctl/systemctl.c
|
||||
+++ b/src/systemctl/systemctl.c
|
||||
@@ -301,21 +301,37 @@ static int compare_unit_info(const void *a, const void *b) {
|
||||
}
|
||||
|
||||
static bool output_show_unit(const UnitInfo *u, char **patterns) {
|
||||
- const char *dot;
|
||||
-
|
||||
if (!strv_isempty(patterns)) {
|
||||
char **pattern;
|
||||
|
||||
STRV_FOREACH(pattern, patterns)
|
||||
if (fnmatch(*pattern, u->id, FNM_NOESCAPE) == 0)
|
||||
- return true;
|
||||
+ goto next;
|
||||
return false;
|
||||
}
|
||||
|
||||
- return (!arg_types || ((dot = strrchr(u->id, '.')) &&
|
||||
- strv_find(arg_types, dot+1))) &&
|
||||
- (arg_all || !(streq(u->active_state, "inactive")
|
||||
- || u->following[0]) || u->job_id > 0);
|
||||
+next:
|
||||
+ if (arg_types) {
|
||||
+ const char *dot;
|
||||
+
|
||||
+ dot = strrchr(u->id, '.');
|
||||
+ if (!dot)
|
||||
+ return false;
|
||||
+
|
||||
+ if (!strv_find(arg_types, dot+1))
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (arg_all)
|
||||
+ return true;
|
||||
+
|
||||
+ if (u->job_id > 0)
|
||||
+ return true;
|
||||
+
|
||||
+ if (streq(u->active_state, "inactive") || u->following[0])
|
||||
+ return false;
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
|
||||
@@ -1231,18 +1247,28 @@ static int compare_unit_file_list(const void *a, const void *b) {
|
||||
}
|
||||
|
||||
static bool output_show_unit_file(const UnitFileList *u, char **patterns) {
|
||||
- const char *dot;
|
||||
-
|
||||
if (!strv_isempty(patterns)) {
|
||||
char **pattern;
|
||||
|
||||
STRV_FOREACH(pattern, patterns)
|
||||
if (fnmatch(*pattern, basename(u->path), FNM_NOESCAPE) == 0)
|
||||
- return true;
|
||||
+ goto next;
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !arg_types || ((dot = strrchr(u->path, '.')) && strv_find(arg_types, dot+1));
|
||||
+next:
|
||||
+ if (!strv_isempty(arg_types)) {
|
||||
+ const char *dot;
|
||||
+
|
||||
+ dot = strrchr(u->path, '.');
|
||||
+ if (!dot)
|
||||
+ return false;
|
||||
+
|
||||
+ if (!strv_find(arg_types, dot+1))
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
static void output_unit_file_list(const UnitFileList *units, unsigned c) {
|
|
@ -1,92 +0,0 @@
|
|||
From 20a575e8935cf5d2d078bbe3acf21fff56f2345c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Tue, 1 Jul 2014 22:20:11 -0400
|
||||
Subject: [PATCH] vconsole-setup: run setfont before loadkeys
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=80685
|
||||
(cherry picked from commit abee28c56d523e55751b0c007d0bf812cc285c00)
|
||||
---
|
||||
src/vconsole/vconsole-setup.c | 48 +++++++++++++++++++++----------------------
|
||||
1 file changed, 23 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
|
||||
index e0c4050611..25d15afd5c 100644
|
||||
--- a/src/vconsole/vconsole-setup.c
|
||||
+++ b/src/vconsole/vconsole-setup.c
|
||||
@@ -238,12 +238,10 @@ static void font_copy_to_all_vcs(int fd) {
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
const char *vc;
|
||||
- char *vc_keymap = NULL;
|
||||
- char *vc_keymap_toggle = NULL;
|
||||
- char *vc_font = NULL;
|
||||
- char *vc_font_map = NULL;
|
||||
- char *vc_font_unimap = NULL;
|
||||
- int fd = -1;
|
||||
+ _cleanup_free_ char
|
||||
+ *vc_keymap = NULL, *vc_keymap_toggle = NULL,
|
||||
+ *vc_font = NULL, *vc_font_map = NULL, *vc_font_unimap = NULL;
|
||||
+ _cleanup_close_ int fd = -1;
|
||||
bool utf8;
|
||||
pid_t font_pid = 0, keymap_pid = 0;
|
||||
bool font_copy = false;
|
||||
@@ -265,12 +263,12 @@ int main(int argc, char **argv) {
|
||||
fd = open_terminal(vc, O_RDWR|O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
log_error("Failed to open %s: %m", vc);
|
||||
- goto finish;
|
||||
+ return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!is_vconsole(fd)) {
|
||||
log_error("Device %s is not a virtual console.", vc);
|
||||
- goto finish;
|
||||
+ return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
utf8 = is_locale_utf8();
|
||||
@@ -305,27 +303,27 @@ int main(int argc, char **argv) {
|
||||
else
|
||||
disable_utf8(fd);
|
||||
|
||||
- r = EXIT_FAILURE;
|
||||
- if (keymap_load(vc, vc_keymap, vc_keymap_toggle, utf8, &keymap_pid) >= 0 &&
|
||||
- font_load(vc, vc_font, vc_font_map, vc_font_unimap, &font_pid) >= 0)
|
||||
- r = EXIT_SUCCESS;
|
||||
-
|
||||
-finish:
|
||||
- if (keymap_pid > 0)
|
||||
- wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid);
|
||||
+ r = font_load(vc, vc_font, vc_font_map, vc_font_unimap, &font_pid);
|
||||
+ if (r < 0) {
|
||||
+ log_error("Failed to start " KBD_LOADKEYS ": %s", strerror(-r));
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
|
||||
- if (font_pid > 0) {
|
||||
+ if (font_pid > 0)
|
||||
wait_for_terminate_and_warn(KBD_SETFONT, font_pid);
|
||||
- if (font_copy)
|
||||
- font_copy_to_all_vcs(fd);
|
||||
+
|
||||
+ r = keymap_load(vc, vc_keymap, vc_keymap_toggle, utf8, &keymap_pid);
|
||||
+ if (r < 0) {
|
||||
+ log_error("Failed to start " KBD_SETFONT ": %s", strerror(-r));
|
||||
+ return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
- free(vc_keymap);
|
||||
- free(vc_font);
|
||||
- free(vc_font_map);
|
||||
- free(vc_font_unimap);
|
||||
+ if (keymap_pid > 0)
|
||||
+ wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid);
|
||||
|
||||
- safe_close(fd);
|
||||
+ /* Only copy the font when we started setfont successfully */
|
||||
+ if (font_copy && font_pid > 0)
|
||||
+ font_copy_to_all_vcs(fd);
|
||||
|
||||
- return r;
|
||||
+ return EXIT_SUCCESS;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
From 34156047f4e34b0d3c621b0641ec3444f2b37f8d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 6 Jul 2014 18:35:46 -0400
|
||||
Subject: [PATCH] coredumpctl: show a useful error on permission problems
|
||||
|
||||
(cherry picked from commit 31cda3d1759dee3e48c8ed4a949d99f041bdca1c)
|
||||
---
|
||||
src/journal/coredumpctl.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
|
||||
index 2158d73771..ecde54744d 100644
|
||||
--- a/src/journal/coredumpctl.c
|
||||
+++ b/src/journal/coredumpctl.c
|
||||
@@ -595,7 +595,8 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) {
|
||||
retrieve(data, len, "COREDUMP_FILENAME", &filename);
|
||||
|
||||
if (filename && access(filename, R_OK) < 0) {
|
||||
- log_debug("File %s is not readable: %m", filename);
|
||||
+ log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
|
||||
+ "File %s is not readable: %m", filename);
|
||||
free(filename);
|
||||
filename = NULL;
|
||||
}
|
||||
@@ -668,7 +669,7 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) {
|
||||
#endif
|
||||
} else {
|
||||
if (r == -ENOENT)
|
||||
- log_error("Coredump neither in journal file nor stored externally on disk.");
|
||||
+ log_error("Cannot retrieve coredump from journal nor disk.");
|
||||
else
|
||||
log_error("Failed to retrieve COREDUMP field: %s", strerror(-r));
|
||||
goto error;
|
|
@ -0,0 +1,26 @@
|
|||
From ff0c10038b7dc58ad13dce492806e6781a0f34fc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Wed, 29 Oct 2014 22:51:00 -0400
|
||||
Subject: [PATCH] systemctl: obey --state in list-unit-files
|
||||
|
||||
(cherry picked from commit fec1530e6b5b8d6dc352c7338010357126e84621)
|
||||
---
|
||||
src/systemctl/systemctl.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
||||
index b71040be40..8481a9b20c 100644
|
||||
--- a/src/systemctl/systemctl.c
|
||||
+++ b/src/systemctl/systemctl.c
|
||||
@@ -1268,6 +1268,11 @@ next:
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (!strv_isempty(arg_states)) {
|
||||
+ if (!strv_find(arg_states, unit_file_state_to_string(u->state)))
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
From fef18888ca215c0600b95cd4dfd9b469c9936043 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Wed, 29 Oct 2014 23:06:58 -0400
|
||||
Subject: [PATCH] bash-completion: use improved filtering to make things faster
|
||||
|
||||
(cherry picked from commit 372b221166eb586c4f767969f442ed940e21f353)
|
||||
---
|
||||
shell-completion/bash/systemctl.in | 16 +++++++++++-----
|
||||
1 file changed, 11 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
|
||||
index 9e538a9a5b..9e98a1850e 100644
|
||||
--- a/shell-completion/bash/systemctl.in
|
||||
+++ b/shell-completion/bash/systemctl.in
|
||||
@@ -60,14 +60,20 @@ __get_active_units () { __systemctl $1 list-units \
|
||||
| { while read -r a b; do echo " $a"; done; }; }
|
||||
__get_startable_units () {
|
||||
# find startable inactive units
|
||||
- __filter_units_by_property $mode LoadState loaded $(
|
||||
- __filter_units_by_property $mode ActiveState inactive $(
|
||||
- __filter_units_by_property $mode CanStart yes $( __get_all_units )))
|
||||
+ __filter_units_by_property $mode ActiveState inactive $(
|
||||
+ __filter_units_by_property $mode CanStart yes $(
|
||||
+ __systemctl $mode list-unit-files --state enabled,disabled,static | \
|
||||
+ { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }
|
||||
+ __systemctl $mode list-units --state inactive,failed | \
|
||||
+ { while read -r a b; do echo " $a"; done; } ))
|
||||
}
|
||||
__get_restartable_units () {
|
||||
# filter out masked and not-found
|
||||
- __filter_units_by_property $mode LoadState loaded $(
|
||||
- __filter_units_by_property $mode CanStart yes $( __get_all_units ))
|
||||
+ __filter_units_by_property $mode CanStart yes $(
|
||||
+ __systemctl $mode list-unit-files --state enabled,disabled,static | \
|
||||
+ { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }
|
||||
+ __systemctl $mode list-units | \
|
||||
+ { while read -r a b; do echo " $a"; done; } )
|
||||
}
|
||||
__get_failed_units () { __systemctl $1 list-units \
|
||||
| { while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }; }
|
|
@ -1,68 +0,0 @@
|
|||
From 65b8b293a6a8560fc1d6eecf7712f870d597965b Mon Sep 17 00:00:00 2001
|
||||
From: Tom Gundersen <teg@jklm.no>
|
||||
Date: Mon, 7 Jul 2014 14:18:26 +0200
|
||||
Subject: [PATCH] networkd: netdev - add missing refs
|
||||
|
||||
Without this, the underlying device would get freed (and hence
|
||||
fail).
|
||||
|
||||
(cherry picked from commit e04468dec04a968c523ee09da7d2163a1d1a5a15)
|
||||
---
|
||||
src/network/networkd-macvlan.c | 2 ++
|
||||
src/network/networkd-tunnel.c | 2 ++
|
||||
src/network/networkd-vlan.c | 2 ++
|
||||
src/network/networkd-vxlan.c | 2 ++
|
||||
4 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/network/networkd-macvlan.c b/src/network/networkd-macvlan.c
|
||||
index 9227144531..7c234264ac 100644
|
||||
--- a/src/network/networkd-macvlan.c
|
||||
+++ b/src/network/networkd-macvlan.c
|
||||
@@ -150,6 +150,8 @@ int netdev_create_macvlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t
|
||||
return r;
|
||||
}
|
||||
|
||||
+ link_ref(link);
|
||||
+
|
||||
log_debug_netdev(netdev, "creating netdev");
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
diff --git a/src/network/networkd-tunnel.c b/src/network/networkd-tunnel.c
|
||||
index 7341487795..5a244f61b0 100644
|
||||
--- a/src/network/networkd-tunnel.c
|
||||
+++ b/src/network/networkd-tunnel.c
|
||||
@@ -529,6 +529,8 @@ int netdev_create_tunnel(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c
|
||||
return r;
|
||||
}
|
||||
|
||||
+ link_ref(link);
|
||||
+
|
||||
log_debug_netdev(netdev, "Creating tunnel netdev: %s",
|
||||
netdev_kind_to_string(netdev->kind));
|
||||
|
||||
diff --git a/src/network/networkd-vlan.c b/src/network/networkd-vlan.c
|
||||
index 1d812fdcaa..8727b9f103 100644
|
||||
--- a/src/network/networkd-vlan.c
|
||||
+++ b/src/network/networkd-vlan.c
|
||||
@@ -139,6 +139,8 @@ int netdev_create_vlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t cal
|
||||
return r;
|
||||
}
|
||||
|
||||
+ link_ref(link);
|
||||
+
|
||||
log_debug_netdev(netdev, "creating netdev");
|
||||
|
||||
netdev->state = NETDEV_STATE_CREATING;
|
||||
diff --git a/src/network/networkd-vxlan.c b/src/network/networkd-vxlan.c
|
||||
index 8832024ef1..160459450d 100644
|
||||
--- a/src/network/networkd-vxlan.c
|
||||
+++ b/src/network/networkd-vxlan.c
|
||||
@@ -154,6 +154,8 @@ int netdev_create_vxlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t ca
|
||||
return r;
|
||||
}
|
||||
|
||||
+ link_ref(link);
|
||||
+
|
||||
log_debug_netdev(netdev, "Creating vxlan netdev: %s",
|
||||
netdev_kind_to_string(netdev->kind));
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
From 14c30a407a7599c96af2e9998c3038574005c368 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Mon, 7 Jul 2014 08:55:30 -0400
|
||||
Subject: [PATCH] vconsole-setup: fix inverted error messages
|
||||
|
||||
Introduced in abee28c56d.
|
||||
|
||||
Pointed-out-by: Werner Fink <werner@suse.de>
|
||||
(cherry picked from commit 3dde3f819732aaa66ab8e881305488adaea17641)
|
||||
---
|
||||
src/vconsole/vconsole-setup.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
|
||||
index 25d15afd5c..645b1e6994 100644
|
||||
--- a/src/vconsole/vconsole-setup.c
|
||||
+++ b/src/vconsole/vconsole-setup.c
|
||||
@@ -305,7 +305,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
r = font_load(vc, vc_font, vc_font_map, vc_font_unimap, &font_pid);
|
||||
if (r < 0) {
|
||||
- log_error("Failed to start " KBD_LOADKEYS ": %s", strerror(-r));
|
||||
+ log_error("Failed to start " KBD_SETFONT ": %s", strerror(-r));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
r = keymap_load(vc, vc_keymap, vc_keymap_toggle, utf8, &keymap_pid);
|
||||
if (r < 0) {
|
||||
- log_error("Failed to start " KBD_SETFONT ": %s", strerror(-r));
|
||||
+ log_error("Failed to start " KBD_LOADKEYS ": %s", strerror(-r));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
From 8b2735073009dcb855d65a3aa85eec25d8100a2a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Wed, 29 Oct 2014 23:47:55 -0400
|
||||
Subject: [PATCH] zsh-completion: update start/restart completions
|
||||
|
||||
Now zsh should behave the same for those two subcommands as bash.
|
||||
|
||||
(cherry picked from commit 81333ecf9d5497f8aa95f7fec23c67b869d5abf9)
|
||||
---
|
||||
shell-completion/zsh/_systemctl.in | 28 +++++++++++++++++++++-------
|
||||
1 file changed, 21 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
|
||||
index 44981fe85d..7eefe53aec 100644
|
||||
--- a/shell-completion/zsh/_systemctl.in
|
||||
+++ b/shell-completion/zsh/_systemctl.in
|
||||
@@ -141,13 +141,29 @@ _filter_units_by_property() {
|
||||
done
|
||||
}
|
||||
|
||||
-_systemctl_all_units() { { __systemctl list-unit-files; __systemctl list-units --all; } | { while read -r a b; do echo -E - " $a"; done; } }
|
||||
+_systemctl_all_units() { { __systemctl list-unit-files; __systemctl list-units --all; } | { while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; } }
|
||||
_systemctl_get_template_names() { __systemctl list-unit-files | { while read -r a b; do [[ $a =~ @\. ]] && echo -E - " ${a%%@.*}@"; done; } }
|
||||
|
||||
|
||||
_systemctl_active_units() {_sys_active_units=( $(__systemctl list-units | { while read -r a b; do echo -E - " $a"; done; }) )}
|
||||
-_systemctl_startable_units(){_sys_startable_units=($(__systemctl list-units --state inactive,failed -- $(_systemctl_all_units) | { while read -r a b c d; do [[ $b == "loaded" ]] && echo -E - " $a"; done; }) )}
|
||||
-_systemctl_restartable_units(){_sys_restartable_units=($(__systemctl list-units --state inactive,failed,active -- $(_systemctl_all_units) | { while read -r a b c d; do [[ $b == "loaded" ]] && echo -E - " $a"; done; }) )}
|
||||
+
|
||||
+_systemctl_startable_units(){
|
||||
+ _sys_startable_units=(_filter_units_by_property ActiveState inactive $(
|
||||
+ _filter_units_by_property CanStart yes $(
|
||||
+ __systemctl $mode list-unit-files --state enabled,disabled,static | \
|
||||
+ { while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; }
|
||||
+ __systemctl $mode list-units --state inactive,failed | \
|
||||
+ { while read -r a b; do echo -E - " $a"; done; } )))
|
||||
+}
|
||||
+
|
||||
+_systemctl_restartable_units(){
|
||||
+ _sys_restartable_units=(_filter_units_by_property CanStart yes $(
|
||||
+ __systemctl $mode list-unit-files --state enabled,disabled,static | \
|
||||
+ { while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; }
|
||||
+ __systemctl $mode list-units | \
|
||||
+ { while read -r a b; do echo -E - " $a"; done; } ))
|
||||
+}
|
||||
+
|
||||
_systemctl_failed_units() {_sys_failed_units=( $(__systemctl list-units --failed | { while read -r a b; do echo -E - " $a"; done; }) )}
|
||||
_systemctl_enabled_units() {_sys_enabled_units=( $(__systemctl list-unit-files | { while read -r a b; do [[ $b == "enabled" ]] && echo -E - " $a"; done; }) )}
|
||||
_systemctl_disabled_units(){_sys_disabled_units=($(__systemctl list-unit-files | { while read -r a b; do [[ $b == "disabled" ]] && echo -E - " $a"; done; }) )}
|
||||
@@ -194,8 +210,7 @@ done
|
||||
(( $+functions[_systemctl_start] )) || _systemctl_start()
|
||||
{
|
||||
_systemctl_startable_units
|
||||
- compadd "$@" - $( _filter_units_by_property CanStart yes \
|
||||
- ${_sys_startable_units[*]} )
|
||||
+ compadd "$@" - ${_sys_startable_units[*]} $(_systemctl_get_template_names)
|
||||
}
|
||||
|
||||
# Completion functions for STOPPABLE_UNITS
|
||||
@@ -231,8 +246,7 @@ for fun in restart reload-or-restart ; do
|
||||
(( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
|
||||
{
|
||||
_systemctl_restartable_units
|
||||
- compadd "$@" - $( _filter_units_by_property CanStart yes \
|
||||
- ${_sys_restartable_units[*]} )
|
||||
+ compadd "$@" - ${_sys_restartable_units[*]} $(_systemctl_get_template_names)
|
||||
}
|
||||
done
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
From b9ae7f976b524c712b7b98062087adaa662f3cf8 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Thu, 30 Oct 2014 10:15:54 +0100
|
||||
Subject: [PATCH] keymap: Ignore brightness keys on Dell Inspiron 1520 to avoid
|
||||
double events
|
||||
|
||||
On the Dell Inspiron 1520 both the atkbd and acpi-video input devices report
|
||||
an event for pressing the brightness up / down key-combos, resulting in user
|
||||
space seeing double events and increasing / decreasing the brightness 2 steps
|
||||
for each keypress.
|
||||
|
||||
This hwdb snippet suppresses the atkbd events, making the Inspiron 1520 work
|
||||
like most modern laptops which emit brightness up / down events through
|
||||
acpi-video only.
|
||||
|
||||
Reported by Pavel Malyshev <p.malishev@gmail.com>
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1141525
|
||||
(cherry picked from commit aba248ee6b1eb10baf3d89eca2ad7569459af6ab)
|
||||
---
|
||||
hwdb/60-keyboard.hwdb | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
|
||||
index 06caba9791..d2ca965c90 100644
|
||||
--- a/hwdb/60-keyboard.hwdb
|
||||
+++ b/hwdb/60-keyboard.hwdb
|
||||
@@ -230,6 +230,11 @@ keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*1110:pvr*
|
||||
keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*1210:pvr*
|
||||
KEYBOARD_KEY_84=wlan
|
||||
|
||||
+# Dell Inspiron 1520
|
||||
+keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*1520:pvr*
|
||||
+ KEYBOARD_KEY_85=unknown # Brightness Down, also emitted by acpi-video, ignore
|
||||
+ KEYBOARD_KEY_86=unknown # Brightness Up, also emitted by acpi-video, ignore
|
||||
+
|
||||
# Latitude XT2
|
||||
keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*XT2:pvr*
|
||||
KEYBOARD_KEY_9b=up # tablet rocker up
|
|
@ -1,40 +0,0 @@
|
|||
From 0afeabd2abb0f86c17f04558d84e39528d3eb9ee Mon Sep 17 00:00:00 2001
|
||||
From: Tom Gundersen <teg@jklm.no>
|
||||
Date: Mon, 7 Jul 2014 14:50:16 +0200
|
||||
Subject: [PATCH] udev: link_config - ignore errors due to missing MAC address
|
||||
|
||||
Otherwis, we get misleading error messages on links with MACs.
|
||||
|
||||
Reported by Leonid Isaev.
|
||||
|
||||
(cherry picked from commit a669ea9860900d5cdebbc4cb9aaea72db7e28a02)
|
||||
---
|
||||
src/udev/net/link-config.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
|
||||
index b8650a6c6c..5a45c53cc6 100644
|
||||
--- a/src/udev/net/link-config.c
|
||||
+++ b/src/udev/net/link-config.c
|
||||
@@ -383,7 +383,9 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, struct udev_dev
|
||||
case MACPOLICY_PERSISTENT:
|
||||
if (mac_is_random(device)) {
|
||||
r = get_mac(device, false, &generated_mac);
|
||||
- if (r < 0)
|
||||
+ if (r == -ENOENT)
|
||||
+ break;
|
||||
+ else if (r < 0)
|
||||
return r;
|
||||
mac = &generated_mac;
|
||||
}
|
||||
@@ -391,7 +393,9 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, struct udev_dev
|
||||
case MACPOLICY_RANDOM:
|
||||
if (!mac_is_random(device)) {
|
||||
r = get_mac(device, true, &generated_mac);
|
||||
- if (r < 0)
|
||||
+ if (r == -ENOENT)
|
||||
+ break;
|
||||
+ else if (r < 0)
|
||||
return r;
|
||||
mac = &generated_mac;
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
From c3a8638cf447ae5901dccb89ea766d768febe529 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Guthrie <colin@mageia.org>
|
||||
Date: Wed, 29 Oct 2014 14:03:41 +0000
|
||||
Subject: [PATCH] sysusers: Preserve ownership and mode on /etc/passwd and
|
||||
friends
|
||||
|
||||
When running sysusers we would clobber file ownership and permissions
|
||||
on the files /etc/passwd, /etc/group and /etc/[g]shadow.
|
||||
|
||||
This simply preserves the ownership and mode if existing files are
|
||||
found.
|
||||
|
||||
(cherry picked from commit e3c72c21d62aadabf4df436c3e2c7219eeeccc1c)
|
||||
---
|
||||
src/sysusers/sysusers.c | 61 +++++++++++++++++++++++++++++++++----------------
|
||||
1 file changed, 41 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
|
||||
index 9b9be96a0a..c133dc5f10 100644
|
||||
--- a/src/sysusers/sysusers.c
|
||||
+++ b/src/sysusers/sysusers.c
|
||||
@@ -358,6 +358,7 @@ static int write_files(void) {
|
||||
_cleanup_fclose_ FILE *passwd = NULL, *group = NULL, *shadow = NULL, *gshadow = NULL;
|
||||
_cleanup_free_ char *passwd_tmp = NULL, *group_tmp = NULL, *shadow_tmp = NULL, *gshadow_tmp = NULL;
|
||||
const char *passwd_path = NULL, *group_path = NULL, *shadow_path = NULL, *gshadow_path = NULL;
|
||||
+ struct stat st;
|
||||
bool group_changed = false;
|
||||
Iterator iterator;
|
||||
Item *i;
|
||||
@@ -372,15 +373,17 @@ static int write_files(void) {
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
- if (fchmod(fileno(group), 0644) < 0) {
|
||||
- r = -errno;
|
||||
- goto finish;
|
||||
- }
|
||||
-
|
||||
original = fopen(group_path, "re");
|
||||
if (original) {
|
||||
struct group *gr;
|
||||
|
||||
+ if (fstat(fileno(original), &st) < 0 ||
|
||||
+ fchmod(fileno(group), st.st_mode & 07777) < 0 ||
|
||||
+ fchown(fileno(group), st.st_uid, st.st_gid) < 0) {
|
||||
+ r = -errno;
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
errno = 0;
|
||||
while ((gr = fgetgrent(original))) {
|
||||
/* Safety checks against name and GID
|
||||
@@ -418,6 +421,9 @@ static int write_files(void) {
|
||||
} else if (errno != ENOENT) {
|
||||
r = -errno;
|
||||
goto finish;
|
||||
+ } else if (fchmod(fileno(group), 0644) < 0) {
|
||||
+ r = -errno;
|
||||
+ goto finish;
|
||||
}
|
||||
|
||||
HASHMAP_FOREACH(i, todo_gids, iterator) {
|
||||
@@ -449,15 +455,17 @@ static int write_files(void) {
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
- if (fchmod(fileno(gshadow), 0000) < 0) {
|
||||
- r = -errno;
|
||||
- goto finish;
|
||||
- }
|
||||
-
|
||||
original = fopen(gshadow_path, "re");
|
||||
if (original) {
|
||||
struct sgrp *sg;
|
||||
|
||||
+ if (fstat(fileno(original), &st) < 0 ||
|
||||
+ fchmod(fileno(gshadow), st.st_mode & 07777) < 0 ||
|
||||
+ fchown(fileno(gshadow), st.st_uid, st.st_gid) < 0) {
|
||||
+ r = -errno;
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
errno = 0;
|
||||
while ((sg = fgetsgent(original))) {
|
||||
|
||||
@@ -483,6 +491,9 @@ static int write_files(void) {
|
||||
} else if (errno != ENOENT) {
|
||||
r = -errno;
|
||||
goto finish;
|
||||
+ } else if (fchmod(fileno(gshadow), 0000) < 0) {
|
||||
+ r = -errno;
|
||||
+ goto finish;
|
||||
}
|
||||
|
||||
HASHMAP_FOREACH(i, todo_gids, iterator) {
|
||||
@@ -513,15 +524,17 @@ static int write_files(void) {
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
- if (fchmod(fileno(passwd), 0644) < 0) {
|
||||
- r = -errno;
|
||||
- goto finish;
|
||||
- }
|
||||
-
|
||||
original = fopen(passwd_path, "re");
|
||||
if (original) {
|
||||
struct passwd *pw;
|
||||
|
||||
+ if (fstat(fileno(original), &st) < 0 ||
|
||||
+ fchmod(fileno(passwd), st.st_mode & 07777) < 0 ||
|
||||
+ fchown(fileno(passwd), st.st_uid, st.st_gid) < 0) {
|
||||
+ r = -errno;
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
errno = 0;
|
||||
while ((pw = fgetpwent(original))) {
|
||||
|
||||
@@ -552,6 +565,9 @@ static int write_files(void) {
|
||||
} else if (errno != ENOENT) {
|
||||
r = -errno;
|
||||
goto finish;
|
||||
+ } else if (fchmod(fileno(passwd), 0644) < 0) {
|
||||
+ r = -errno;
|
||||
+ goto finish;
|
||||
}
|
||||
|
||||
HASHMAP_FOREACH(i, todo_uids, iterator) {
|
||||
@@ -596,15 +612,17 @@ static int write_files(void) {
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
- if (fchmod(fileno(shadow), 0000) < 0) {
|
||||
- r = -errno;
|
||||
- goto finish;
|
||||
- }
|
||||
-
|
||||
original = fopen(shadow_path, "re");
|
||||
if (original) {
|
||||
struct spwd *sp;
|
||||
|
||||
+ if (fstat(fileno(original), &st) < 0 ||
|
||||
+ fchmod(fileno(shadow), st.st_mode & 07777) < 0 ||
|
||||
+ fchown(fileno(shadow), st.st_uid, st.st_gid) < 0) {
|
||||
+ r = -errno;
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
errno = 0;
|
||||
while ((sp = fgetspent(original))) {
|
||||
|
||||
@@ -629,6 +647,9 @@ static int write_files(void) {
|
||||
} else if (errno != ENOENT) {
|
||||
r = -errno;
|
||||
goto finish;
|
||||
+ } else if (fchmod(fileno(shadow), 0000) < 0) {
|
||||
+ r = -errno;
|
||||
+ goto finish;
|
||||
}
|
||||
|
||||
lstchg = (long) (now(CLOCK_REALTIME) / USEC_PER_DAY);
|
|
@ -1,53 +0,0 @@
|
|||
From a71b7b7e52f312c7a9fc19154ac0d444e057e1d4 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 11:47:10 +0200
|
||||
Subject: [PATCH] util: consider 0x7F a control chracter (which it is: DEL)
|
||||
|
||||
Let's better be safe than sorry.
|
||||
|
||||
(cherry picked from commit 3a8a916338d8446b938f3cf40f6aae0c611892e3)
|
||||
---
|
||||
src/shared/util.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/shared/util.c b/src/shared/util.c
|
||||
index 3d875c72b3..d25ee6652f 100644
|
||||
--- a/src/shared/util.c
|
||||
+++ b/src/shared/util.c
|
||||
@@ -1608,8 +1608,9 @@ int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) {
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
+ errno = 0;
|
||||
if (!fgets(line, sizeof(line), f))
|
||||
- return -EIO;
|
||||
+ return errno ? -errno : -EIO;
|
||||
|
||||
truncate_nl(line);
|
||||
|
||||
@@ -5355,6 +5356,9 @@ bool string_is_safe(const char *p) {
|
||||
if (*t > 0 && *t < ' ')
|
||||
return false;
|
||||
|
||||
+ if (*t == 127)
|
||||
+ return false;
|
||||
+
|
||||
if (strchr("\\\"\'", *t))
|
||||
return false;
|
||||
}
|
||||
@@ -5371,10 +5375,14 @@ bool string_has_cc(const char *p) {
|
||||
|
||||
assert(p);
|
||||
|
||||
- for (t = p; *t; t++)
|
||||
+ for (t = p; *t; t++) {
|
||||
if (*t > 0 && *t < ' ' && *t != '\t')
|
||||
return true;
|
||||
|
||||
+ if (*t == 127)
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From a821499e679a2d76c96ea6fda76e7847ba57a565 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 11:47:46 +0200
|
||||
Subject: [PATCH] main: explain our /etc empty check a bit in a comment
|
||||
|
||||
(cherry picked from commit 3408ba015aee3a88c91962c028738be757779519)
|
||||
---
|
||||
src/core/main.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/core/main.c b/src/core/main.c
|
||||
index 1ca899998e..a732c6945a 100644
|
||||
--- a/src/core/main.c
|
||||
+++ b/src/core/main.c
|
||||
@@ -1543,6 +1543,14 @@ int main(int argc, char *argv[]) {
|
||||
if (in_initrd())
|
||||
log_info("Running in initial RAM disk.");
|
||||
|
||||
+ /* Let's check whether /etc is already populated. We
|
||||
+ * don't actually really check for that, but use
|
||||
+ * /etc/machine-id as flag file. This allows container
|
||||
+ * managers and installers to provision a couple of
|
||||
+ * files already. If the container manager wants to
|
||||
+ * provision the machine ID itself it should pass
|
||||
+ * $container_uuid to PID 1.*/
|
||||
+
|
||||
empty_etc = access("/etc/machine-id", F_OK) < 0;
|
||||
if (empty_etc)
|
||||
log_info("Running with unpopulated /etc.");
|
|
@ -0,0 +1,23 @@
|
|||
From 3db5ad126fcca99e7d341e47f1c2967aa70fc813 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Tue, 28 Oct 2014 12:36:17 -0400
|
||||
Subject: [PATCH] snapshot: return error when snapshot exists
|
||||
|
||||
(cherry picked from commit 7cabba07745b388497e8c0fc19b61984167fd474)
|
||||
---
|
||||
src/core/snapshot.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/snapshot.c b/src/core/snapshot.c
|
||||
index 5eed615a15..c2678cbe6e 100644
|
||||
--- a/src/core/snapshot.c
|
||||
+++ b/src/core/snapshot.c
|
||||
@@ -208,7 +208,7 @@ int snapshot_create(Manager *m, const char *name, bool cleanup, sd_bus_error *e,
|
||||
return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Unit name %s lacks snapshot suffix.", name);
|
||||
|
||||
if (manager_get_unit(m, name))
|
||||
- sd_bus_error_setf(e, BUS_ERROR_UNIT_EXISTS, "Snapshot %s exists already.", name);
|
||||
+ return sd_bus_error_setf(e, BUS_ERROR_UNIT_EXISTS, "Snapshot %s exists already.", name);
|
||||
|
||||
} else {
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
From 8606ef2e22777f167a528c41fc15371bfe934f45 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 14:58:13 +0200
|
||||
Subject: [PATCH] man: add missing archs to ConditionArchitecture= description
|
||||
|
||||
(cherry picked from commit f1e4d93f573087655ab1d0adb725102d5d2c1960)
|
||||
---
|
||||
man/systemd.unit.xml | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
|
||||
index 960fb90dbd..be0873c344 100644
|
||||
--- a/man/systemd.unit.xml
|
||||
+++ b/man/systemd.unit.xml
|
||||
@@ -931,7 +931,9 @@
|
||||
<varname>x86</varname>,
|
||||
<varname>x86-64</varname>,
|
||||
<varname>ppc</varname>,
|
||||
+ <varname>ppc-le</varname>,
|
||||
<varname>ppc64</varname>,
|
||||
+ <varname>ppc64-le</varname>,
|
||||
<varname>ia64</varname>,
|
||||
<varname>parisc</varname>,
|
||||
<varname>parisc64</varname>,
|
||||
@@ -940,7 +942,9 @@
|
||||
<varname>sparc</varname>,
|
||||
<varname>sparc64</varname>,
|
||||
<varname>mips</varname>,
|
||||
+ <varname>mips-le</varname>,
|
||||
<varname>mips64</varname>,
|
||||
+ <varname>mips64-le</varname>,
|
||||
<varname>alpha</varname>,
|
||||
<varname>arm</varname>,
|
||||
<varname>arm-be</varname>,
|
||||
@@ -948,7 +952,9 @@
|
||||
<varname>arm64-be</varname>,
|
||||
<varname>sh</varname>,
|
||||
<varname>sh64</varname>,
|
||||
- <varname>m86k</varname> to test
|
||||
+ <varname>m86k</varname>,
|
||||
+ <varname>tilegx</varname>,
|
||||
+ <varname>cris</varname> to test
|
||||
against a specific architecture. The
|
||||
architecture is determined from the
|
||||
information returned by
|
|
@ -0,0 +1,30 @@
|
|||
From b994526e7fbc8acc71889120645508ac5f8aca33 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Williams <dcbw@redhat.com>
|
||||
Date: Thu, 30 Oct 2014 14:23:00 -0500
|
||||
Subject: [PATCH] sd-dhcp-client: clean up raw socket sd_event_source when
|
||||
creating new UDP socket
|
||||
|
||||
The raw socket sd_event_source used for DHCP server solicitations
|
||||
was simply dropped on the floor when creating the new UDP socket
|
||||
after a lease has been acquired. Clean it up properly so we're
|
||||
not still listening and responding to events on it.
|
||||
|
||||
(cherry picked from commit affaa94fc38a980a70534f70f6a6c58a4129b062)
|
||||
---
|
||||
src/libsystemd-network/sd-dhcp-client.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
|
||||
index 0eba4c379d..1f7f238ca0 100644
|
||||
--- a/src/libsystemd-network/sd-dhcp-client.c
|
||||
+++ b/src/libsystemd-network/sd-dhcp-client.c
|
||||
@@ -1269,6 +1269,9 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message,
|
||||
if (r >= 0) {
|
||||
client->timeout_resend =
|
||||
sd_event_source_unref(client->timeout_resend);
|
||||
+ client->receive_message =
|
||||
+ sd_event_source_unref(client->receive_message);
|
||||
+ client->fd = asynchronous_close(client->fd);
|
||||
|
||||
if (IN_SET(client->state, DHCP_STATE_REQUESTING,
|
||||
DHCP_STATE_REBOOTING))
|
|
@ -1,23 +0,0 @@
|
|||
From 3fe1ea74a50b7815816157da93c60379e8328821 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 14:58:36 +0200
|
||||
Subject: [PATCH] man: chroot jails are no longer detected by
|
||||
ConditionVirtualization=
|
||||
|
||||
(cherry picked from commit ac8ddf8c964f813464ef32cad1fcb7b61b692a01)
|
||||
---
|
||||
man/systemd.unit.xml | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
|
||||
index be0873c344..cd3279c192 100644
|
||||
--- a/man/systemd.unit.xml
|
||||
+++ b/man/systemd.unit.xml
|
||||
@@ -990,7 +990,6 @@
|
||||
<varname>oracle</varname>,
|
||||
<varname>xen</varname>,
|
||||
<varname>bochs</varname>,
|
||||
- <varname>chroot</varname>,
|
||||
<varname>uml</varname>,
|
||||
<varname>openvz</varname>,
|
||||
<varname>lxc</varname>,
|
|
@ -0,0 +1,37 @@
|
|||
From deb58970549681f28a7e38ee0f75664523f5066a Mon Sep 17 00:00:00 2001
|
||||
From: Dave Reisner <dreisner@archlinux.org>
|
||||
Date: Thu, 30 Oct 2014 20:12:05 -0400
|
||||
Subject: [PATCH] shared/install: avoid prematurely rejecting "missing" units
|
||||
|
||||
f7101b7368df copied some logic to prevent enabling masked units, but
|
||||
also added a check which causes attempts to enable templated units to
|
||||
fail. Since we know the logic beyond this check will properly handle
|
||||
units which truly do not exist, we can rely on the unit file state
|
||||
comparison to suffice for expressing the intent of f7101b7368df.
|
||||
|
||||
ref: https://bugs.archlinux.org/task/42616
|
||||
(cherry picked from commit 0ffce503cd6e5a5ff5ba5cd1cc23684cfb8bb9e3)
|
||||
---
|
||||
src/shared/install.c | 8 +++-----
|
||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/shared/install.c b/src/shared/install.c
|
||||
index 035b44cc52..cab93e8dc6 100644
|
||||
--- a/src/shared/install.c
|
||||
+++ b/src/shared/install.c
|
||||
@@ -1620,12 +1620,10 @@ int unit_file_enable(
|
||||
STRV_FOREACH(i, files) {
|
||||
UnitFileState state;
|
||||
|
||||
+ /* We only want to know if this unit is masked, so we ignore
|
||||
+ * errors from unit_file_get_state, deferring other checks.
|
||||
+ * This allows templated units to be enabled on the fly. */
|
||||
state = unit_file_get_state(scope, root_dir, *i);
|
||||
- if (state < 0) {
|
||||
- log_error("Failed to get unit file state for %s: %s", *i, strerror(-state));
|
||||
- return state;
|
||||
- }
|
||||
-
|
||||
if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
|
||||
log_error("Failed to enable unit: Unit %s is masked", *i);
|
||||
return -ENOTSUP;
|
|
@ -1,25 +0,0 @@
|
|||
From 384bcccd9d6557a7543a21a44fce57ca06efcfdd Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 14:59:06 +0200
|
||||
Subject: [PATCH] architecture: add string table entries for mips-le archs
|
||||
which were missing
|
||||
|
||||
(cherry picked from commit 037c26d0aeb750ca9c8d605884ea1db7baecfea8)
|
||||
---
|
||||
src/shared/architecture.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/shared/architecture.c b/src/shared/architecture.c
|
||||
index 6cdca4e7e5..dc45f3589d 100644
|
||||
--- a/src/shared/architecture.c
|
||||
+++ b/src/shared/architecture.c
|
||||
@@ -153,7 +153,9 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = {
|
||||
[ARCHITECTURE_SPARC] = "sparc",
|
||||
[ARCHITECTURE_SPARC64] = "sparc64",
|
||||
[ARCHITECTURE_MIPS] = "mips",
|
||||
+ [ARCHITECTURE_MIPS_LE] = "mips-le",
|
||||
[ARCHITECTURE_MIPS64] = "mips64",
|
||||
+ [ARCHITECTURE_MIPS64_LE] = "mips64-le",
|
||||
[ARCHITECTURE_ALPHA] = "alpha",
|
||||
[ARCHITECTURE_ARM] = "arm",
|
||||
[ARCHITECTURE_ARM_BE] = "arm-be",
|
|
@ -0,0 +1,75 @@
|
|||
From c986f1e5ff7afaa52274ee25a7ba94bec0356d03 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 30 Oct 2014 20:53:23 +0100
|
||||
Subject: [PATCH] nspawn: don't make up -1 as error code
|
||||
|
||||
(cherry picked from commit fddbb89c46ea5d39e52e361b390ea34a06cbb67c)
|
||||
---
|
||||
src/nspawn/nspawn.c | 27 +++++++++++----------------
|
||||
1 file changed, 11 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
|
||||
index d88987a580..7e96efd425 100644
|
||||
--- a/src/nspawn/nspawn.c
|
||||
+++ b/src/nspawn/nspawn.c
|
||||
@@ -2931,33 +2931,30 @@ static int wait_for_container(pid_t pid, ContainerStatus *container) {
|
||||
}
|
||||
|
||||
switch (status.si_code) {
|
||||
+
|
||||
case CLD_EXITED:
|
||||
r = status.si_status;
|
||||
if (r == 0) {
|
||||
if (!arg_quiet)
|
||||
- log_debug("Container %s exited successfully.",
|
||||
- arg_machine);
|
||||
+ log_debug("Container %s exited successfully.", arg_machine);
|
||||
|
||||
*container = CONTAINER_TERMINATED;
|
||||
- } else {
|
||||
- log_error("Container %s failed with error code %i.",
|
||||
- arg_machine, status.si_status);
|
||||
- }
|
||||
+ } else
|
||||
+ log_error("Container %s failed with error code %i.", arg_machine, status.si_status);
|
||||
+
|
||||
break;
|
||||
|
||||
case CLD_KILLED:
|
||||
if (status.si_status == SIGINT) {
|
||||
if (!arg_quiet)
|
||||
- log_info("Container %s has been shut down.",
|
||||
- arg_machine);
|
||||
+ log_info("Container %s has been shut down.", arg_machine);
|
||||
|
||||
*container = CONTAINER_TERMINATED;
|
||||
r = 0;
|
||||
break;
|
||||
} else if (status.si_status == SIGHUP) {
|
||||
if (!arg_quiet)
|
||||
- log_info("Container %s is being rebooted.",
|
||||
- arg_machine);
|
||||
+ log_info("Container %s is being rebooted.", arg_machine);
|
||||
|
||||
*container = CONTAINER_REBOOTED;
|
||||
r = 0;
|
||||
@@ -2966,15 +2963,13 @@ static int wait_for_container(pid_t pid, ContainerStatus *container) {
|
||||
/* CLD_KILLED fallthrough */
|
||||
|
||||
case CLD_DUMPED:
|
||||
- log_error("Container %s terminated by signal %s.",
|
||||
- arg_machine, signal_to_string(status.si_status));
|
||||
- r = -1;
|
||||
+ log_error("Container %s terminated by signal %s.", arg_machine, signal_to_string(status.si_status));
|
||||
+ r = -EIO;
|
||||
break;
|
||||
|
||||
default:
|
||||
- log_error("Container %s failed due to unknown reason.",
|
||||
- arg_machine);
|
||||
- r = -1;
|
||||
+ log_error("Container %s failed due to unknown reason.", arg_machine);
|
||||
+ r = -EIO;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
From 853896f09d35f8c2db3bf25376d1c3ab240287ed Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 17:33:46 +0200
|
||||
Subject: [PATCH] service: flush status text and errno values each time a
|
||||
service is started
|
||||
|
||||
We shouldn't show status texts from previous service starts
|
||||
|
||||
(cherry picked from commit 8cfdb077b8e3da1c47fc1d735d051f21f33144c1)
|
||||
---
|
||||
src/core/service.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/core/service.c b/src/core/service.c
|
||||
index 0b19767d9e..2d8aa01445 100644
|
||||
--- a/src/core/service.c
|
||||
+++ b/src/core/service.c
|
||||
@@ -1699,6 +1699,9 @@ static int service_start(Unit *u) {
|
||||
s->main_pid_alien = false;
|
||||
s->forbid_restart = false;
|
||||
|
||||
+ free(s->status_text);
|
||||
+ s->status_text = NULL;
|
||||
+
|
||||
service_enter_start_pre(s);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
From 860e33966a511e008f80bbfa23450dcc33650290 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 31 Oct 2014 16:22:36 +0100
|
||||
Subject: [PATCH] units: don't order journal flushing afte remote-fs.target
|
||||
|
||||
Instead, only depend on the actual file systems we need.
|
||||
|
||||
This should solve dep loops on setups where remote-fs.target is moved
|
||||
into late boot.
|
||||
|
||||
(cherry picked from commit 919699ec301ea507edce4a619141ed22e789ac0d)
|
||||
---
|
||||
src/nspawn/nspawn.c | 38 ++++++++++++++--------------------
|
||||
units/systemd-journal-flush.service.in | 3 ++-
|
||||
2 files changed, 18 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
|
||||
index 7e96efd425..f332ade03e 100644
|
||||
--- a/src/nspawn/nspawn.c
|
||||
+++ b/src/nspawn/nspawn.c
|
||||
@@ -2911,8 +2911,8 @@ static int change_uid_gid(char **_home) {
|
||||
* container argument.
|
||||
* > 0 : The program executed in the container terminated with an
|
||||
* error. The exit code of the program executed in the
|
||||
- * container is returned. No change is made to the container
|
||||
- * argument.
|
||||
+ * container is returned. The container argument has been set
|
||||
+ * to CONTAINER_TERMINATED.
|
||||
* 0 : The container is being rebooted, has been shut down or exited
|
||||
* successfully. The container argument has been set to either
|
||||
* CONTAINER_TERMINATED or CONTAINER_REBOOTED.
|
||||
@@ -2921,8 +2921,8 @@ static int change_uid_gid(char **_home) {
|
||||
* error is indicated by a non-zero value.
|
||||
*/
|
||||
static int wait_for_container(pid_t pid, ContainerStatus *container) {
|
||||
- int r;
|
||||
siginfo_t status;
|
||||
+ int r;
|
||||
|
||||
r = wait_for_terminate(pid, &status);
|
||||
if (r < 0) {
|
||||
@@ -2933,44 +2933,38 @@ static int wait_for_container(pid_t pid, ContainerStatus *container) {
|
||||
switch (status.si_code) {
|
||||
|
||||
case CLD_EXITED:
|
||||
- r = status.si_status;
|
||||
- if (r == 0) {
|
||||
- if (!arg_quiet)
|
||||
- log_debug("Container %s exited successfully.", arg_machine);
|
||||
+ if (status.si_status == 0) {
|
||||
+ log_full(arg_quiet ? LOG_DEBUG : LOG_INFO, "Container %s exited successfully.", arg_machine);
|
||||
|
||||
- *container = CONTAINER_TERMINATED;
|
||||
} else
|
||||
- log_error("Container %s failed with error code %i.", arg_machine, status.si_status);
|
||||
+ log_full(arg_quiet ? LOG_DEBUG : LOG_INFO, "Container %s failed with error code %i.", arg_machine, status.si_status);
|
||||
|
||||
- break;
|
||||
+ *container = CONTAINER_TERMINATED;
|
||||
+ return status.si_status;
|
||||
|
||||
case CLD_KILLED:
|
||||
if (status.si_status == SIGINT) {
|
||||
- if (!arg_quiet)
|
||||
- log_info("Container %s has been shut down.", arg_machine);
|
||||
|
||||
+ log_full(arg_quiet ? LOG_DEBUG : LOG_INFO, "Container %s has been shut down.", arg_machine);
|
||||
*container = CONTAINER_TERMINATED;
|
||||
- r = 0;
|
||||
- break;
|
||||
+ return 0;
|
||||
+
|
||||
} else if (status.si_status == SIGHUP) {
|
||||
- if (!arg_quiet)
|
||||
- log_info("Container %s is being rebooted.", arg_machine);
|
||||
|
||||
+ log_full(arg_quiet ? LOG_DEBUG : LOG_INFO, "Container %s is being rebooted.", arg_machine);
|
||||
*container = CONTAINER_REBOOTED;
|
||||
- r = 0;
|
||||
- break;
|
||||
+ return 0;
|
||||
}
|
||||
+
|
||||
/* CLD_KILLED fallthrough */
|
||||
|
||||
case CLD_DUMPED:
|
||||
log_error("Container %s terminated by signal %s.", arg_machine, signal_to_string(status.si_status));
|
||||
- r = -EIO;
|
||||
- break;
|
||||
+ return -EIO;
|
||||
|
||||
default:
|
||||
log_error("Container %s failed due to unknown reason.", arg_machine);
|
||||
- r = -EIO;
|
||||
- break;
|
||||
+ return -EIO;
|
||||
}
|
||||
|
||||
return r;
|
||||
diff --git a/units/systemd-journal-flush.service.in b/units/systemd-journal-flush.service.in
|
||||
index 699670bb4e..2612220e2e 100644
|
||||
--- a/units/systemd-journal-flush.service.in
|
||||
+++ b/units/systemd-journal-flush.service.in
|
||||
@@ -10,8 +10,9 @@ Description=Trigger Flushing of Journal to Persistent Storage
|
||||
Documentation=man:systemd-journald.service(8) man:journald.conf(5)
|
||||
DefaultDependencies=no
|
||||
Requires=systemd-journald.service
|
||||
-After=systemd-journald.service local-fs.target remote-fs.target
|
||||
+After=systemd-journald.service
|
||||
Before=systemd-user-sessions.service systemd-tmpfiles-setup.service
|
||||
+RequiresMountsFor=/var/log/journal
|
||||
|
||||
[Service]
|
||||
ExecStart=@rootbindir@/journalctl --flush
|
|
@ -1,36 +0,0 @@
|
|||
From 313b57468fae9e3d4b762326c46e82afe6ec1c36 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 7 Jul 2014 17:45:53 +0200
|
||||
Subject: [PATCH] base-filesystem.c: terminate string array elements with \0
|
||||
|
||||
NULSTR_FOREACH() looks for a terminating zero and the element also needs
|
||||
one.
|
||||
|
||||
(cherry picked from commit 30d7c9c472bd7be1b6a09d3bd5afd939988de990)
|
||||
---
|
||||
src/shared/base-filesystem.c | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
|
||||
index daaeaca515..addd26ca39 100644
|
||||
--- a/src/shared/base-filesystem.c
|
||||
+++ b/src/shared/base-filesystem.c
|
||||
@@ -42,12 +42,13 @@ typedef struct BaseFilesystem {
|
||||
} BaseFilesystem;
|
||||
|
||||
static const BaseFilesystem table[] = {
|
||||
- { "bin", 0, "usr/bin", NULL },
|
||||
- { "lib", 0, "usr/lib", NULL },
|
||||
- { "root", 0755, NULL, NULL },
|
||||
- { "sbin", 0, "usr/sbin", NULL },
|
||||
+ { "bin", 0, "usr/bin\0", NULL },
|
||||
+ { "lib", 0, "usr/lib\0", NULL },
|
||||
+ { "root", 0755, NULL, NULL },
|
||||
+ { "sbin", 0, "usr/sbin\0", NULL },
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
- { "lib64", 0, "usr/lib/x86_64-linux-gnu\0usr/lib64", "ld-linux-x86-64.so.2" },
|
||||
+ { "lib64", 0, "usr/lib/x86_64-linux-gnu\0"
|
||||
+ "usr/lib64\0", "ld-linux-x86-64.so.2" },
|
||||
#endif
|
||||
};
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
From 077f3bccf730114917c581fb9f47beb4518835bd Mon Sep 17 00:00:00 2001
|
||||
From: Marcel Holtmann <marcel@holtmann.org>
|
||||
Date: Fri, 31 Oct 2014 20:37:59 +0100
|
||||
Subject: [PATCH] hwdb: Update database of Bluetooth company identifiers
|
||||
|
||||
(cherry picked from commit 5d20fde4a5c4dff4d7c737b545fbd13582d544c1)
|
||||
---
|
||||
hwdb/20-bluetooth-vendor-product.hwdb | 57 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 57 insertions(+)
|
||||
|
||||
diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb
|
||||
index ee2efdff2e..58ca87d69d 100644
|
||||
--- a/hwdb/20-bluetooth-vendor-product.hwdb
|
||||
+++ b/hwdb/20-bluetooth-vendor-product.hwdb
|
||||
@@ -1166,3 +1166,60 @@ bluetooth:v0181*
|
||||
|
||||
bluetooth:v0182*
|
||||
ID_VENDOR_FROM_DATABASE=HOP Ubiquitous
|
||||
+
|
||||
+bluetooth:v0183*
|
||||
+ ID_VENDOR_FROM_DATABASE=To Be Assigned
|
||||
+
|
||||
+bluetooth:v0184*
|
||||
+ ID_VENDOR_FROM_DATABASE=Nectar
|
||||
+
|
||||
+bluetooth:v0185*
|
||||
+ ID_VENDOR_FROM_DATABASE=bel'apps LLC
|
||||
+
|
||||
+bluetooth:v0186*
|
||||
+ ID_VENDOR_FROM_DATABASE=CORE Lighting Ltd
|
||||
+
|
||||
+bluetooth:v0187*
|
||||
+ ID_VENDOR_FROM_DATABASE=Seraphim Sense Ltd
|
||||
+
|
||||
+bluetooth:v0188*
|
||||
+ ID_VENDOR_FROM_DATABASE=Unico RBC
|
||||
+
|
||||
+bluetooth:v0189*
|
||||
+ ID_VENDOR_FROM_DATABASE=Physical Enterprises Inc.
|
||||
+
|
||||
+bluetooth:v018A*
|
||||
+ ID_VENDOR_FROM_DATABASE=Able Trend Technology Limited
|
||||
+
|
||||
+bluetooth:v018B*
|
||||
+ ID_VENDOR_FROM_DATABASE=Konica Minolta, Inc.
|
||||
+
|
||||
+bluetooth:v018C*
|
||||
+ ID_VENDOR_FROM_DATABASE=Wilo SE
|
||||
+
|
||||
+bluetooth:v018D*
|
||||
+ ID_VENDOR_FROM_DATABASE=Extron Design Services
|
||||
+
|
||||
+bluetooth:v018E*
|
||||
+ ID_VENDOR_FROM_DATABASE=Fitbit, Inc.
|
||||
+
|
||||
+bluetooth:v018F*
|
||||
+ ID_VENDOR_FROM_DATABASE=Fireflies Systems
|
||||
+
|
||||
+bluetooth:v0190*
|
||||
+ ID_VENDOR_FROM_DATABASE=Intelletto Technologies Inc.
|
||||
+
|
||||
+bluetooth:v0191*
|
||||
+ ID_VENDOR_FROM_DATABASE=FDK CORPORATION
|
||||
+
|
||||
+bluetooth:v0192*
|
||||
+ ID_VENDOR_FROM_DATABASE=Cloudleaf, Inc
|
||||
+
|
||||
+bluetooth:v0193*
|
||||
+ ID_VENDOR_FROM_DATABASE=Maveric Automation LLC
|
||||
+
|
||||
+bluetooth:v0194*
|
||||
+ ID_VENDOR_FROM_DATABASE=Acoustic Stream Corporation
|
||||
+
|
||||
+bluetooth:v0195*
|
||||
+ ID_VENDOR_FROM_DATABASE=Zuli
|
|
@ -0,0 +1,60 @@
|
|||
From e63854bf942d6f3364e5e69d5e7bcfd5a2ad8ec8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sat, 1 Nov 2014 11:32:44 -0400
|
||||
Subject: [PATCH] libudev: modernization
|
||||
|
||||
This brings udev logging style a bit closer to normal systemd convention.
|
||||
|
||||
(cherry picked from commit fe756ed9ec2c0fa33c30b1d9a33d745dc1593aed)
|
||||
---
|
||||
src/libudev/libudev.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
|
||||
index e2ab960d55..7803863b2e 100644
|
||||
--- a/src/libudev/libudev.c
|
||||
+++ b/src/libudev/libudev.c
|
||||
@@ -119,7 +119,7 @@ _public_ struct udev *udev_new(void)
|
||||
{
|
||||
struct udev *udev;
|
||||
const char *env;
|
||||
- FILE *f;
|
||||
+ _cleanup_free_ FILE *f = NULL;
|
||||
|
||||
udev = new0(struct udev, 1);
|
||||
if (udev == NULL)
|
||||
@@ -132,7 +132,7 @@ _public_ struct udev *udev_new(void)
|
||||
f = fopen("/etc/udev/udev.conf", "re");
|
||||
if (f != NULL) {
|
||||
char line[UTIL_LINE_SIZE];
|
||||
- int line_nr = 0;
|
||||
+ unsigned line_nr = 0;
|
||||
|
||||
while (fgets(line, sizeof(line), f)) {
|
||||
size_t len;
|
||||
@@ -153,7 +153,7 @@ _public_ struct udev *udev_new(void)
|
||||
/* split key/value */
|
||||
val = strchr(key, '=');
|
||||
if (val == NULL) {
|
||||
- udev_err(udev, "missing <key>=<value> in /etc/udev/udev.conf[%i]; skip line\n", line_nr);
|
||||
+ udev_err(udev, "/etc/udev/udev.conf:%u: missing assignment, skipping line.\n", line_nr);
|
||||
continue;
|
||||
}
|
||||
val[0] = '\0';
|
||||
@@ -185,7 +185,7 @@ _public_ struct udev *udev_new(void)
|
||||
/* unquote */
|
||||
if (val[0] == '"' || val[0] == '\'') {
|
||||
if (val[len-1] != val[0]) {
|
||||
- udev_err(udev, "inconsistent quoting in /etc/udev/udev.conf[%i]; skip line\n", line_nr);
|
||||
+ udev_err(udev, "/etc/udev/udev.conf:%u: inconsistent quoting, skipping line.\n", line_nr);
|
||||
continue;
|
||||
}
|
||||
val[len-1] = '\0';
|
||||
@@ -197,7 +197,6 @@ _public_ struct udev *udev_new(void)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
- fclose(f);
|
||||
}
|
||||
|
||||
/* environment overrides config */
|
|
@ -1,50 +0,0 @@
|
|||
From 13191f413a4dbff98094fe407cb592ae9723f956 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 18:45:07 +0200
|
||||
Subject: [PATCH] man: drop references to the --priviliged command line option
|
||||
which has been removed a while back
|
||||
|
||||
(cherry picked from commit ed3e4a3fd96891b5e7015723978e78cd21efd4fe)
|
||||
---
|
||||
man/hostnamectl.xml | 8 --------
|
||||
man/localectl.xml | 8 --------
|
||||
2 files changed, 16 deletions(-)
|
||||
|
||||
diff --git a/man/hostnamectl.xml b/man/hostnamectl.xml
|
||||
index 71973fde91..4e456eb8f9 100644
|
||||
--- a/man/hostnamectl.xml
|
||||
+++ b/man/hostnamectl.xml
|
||||
@@ -102,14 +102,6 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
- <term><option>-P</option></term>
|
||||
- <term><option>--privileged</option></term>
|
||||
-
|
||||
- <listitem><para>Acquire privileges via PolicyKit
|
||||
- before executing the operation.</para></listitem>
|
||||
- </varlistentry>
|
||||
-
|
||||
- <varlistentry>
|
||||
<term><option>--static</option></term>
|
||||
<term><option>--transient</option></term>
|
||||
<term><option>--pretty</option></term>
|
||||
diff --git a/man/localectl.xml b/man/localectl.xml
|
||||
index c2e79a2d71..9c32c794aa 100644
|
||||
--- a/man/localectl.xml
|
||||
+++ b/man/localectl.xml
|
||||
@@ -90,14 +90,6 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
- <term><option>-P</option></term>
|
||||
- <term><option>--privileged</option></term>
|
||||
-
|
||||
- <listitem><para>Acquire privileges via PolicyKit
|
||||
- before executing the operation.</para></listitem>
|
||||
- </varlistentry>
|
||||
-
|
||||
- <varlistentry>
|
||||
<term><option>--no-convert</option></term>
|
||||
|
||||
<listitem><para>If
|
|
@ -1,27 +0,0 @@
|
|||
From 06d46a47eb13907a597a0e67cd8142321a81494e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Mon, 7 Jul 2014 16:10:38 -0400
|
||||
Subject: [PATCH] fstab-generator: add comma when removed option is in the
|
||||
middle
|
||||
|
||||
xxx,x-systemd.default-timeout=y,zzz was filtered to xxxzzz,
|
||||
but should be xxx,zzz, of course.
|
||||
|
||||
(cherry picked from commit 36a259d22c450fbf3f696df0161db50275a98667)
|
||||
---
|
||||
src/shared/generator.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/shared/generator.c b/src/shared/generator.c
|
||||
index 5d5b6a0a61..2f9e5954c2 100644
|
||||
--- a/src/shared/generator.c
|
||||
+++ b/src/shared/generator.c
|
||||
@@ -125,7 +125,7 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher
|
||||
char *prefix, *postfix;
|
||||
|
||||
prefix = strndupa(opts, start - opts - (start != opts));
|
||||
- postfix = timeout + len + (timeout[len] != '\0');
|
||||
+ postfix = timeout + len + (start == opts && timeout[len] != '\0');
|
||||
*filtered = strjoin(prefix, *postfix ? postfix : NULL, NULL);
|
||||
if (!*filtered)
|
||||
return log_oom();
|
|
@ -0,0 +1,72 @@
|
|||
From 6c2d3f24672aaa806bbd6b4b5741e315566da35c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sat, 1 Nov 2014 12:06:41 -0400
|
||||
Subject: [PATCH] libudev: do not accept invalid log levels
|
||||
|
||||
Invalid log levels lead to a assert failure later on.
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=85657
|
||||
(cherry picked from commit ee7122c0ec6aa11f02e9e8d94254b353f12d2c14)
|
||||
---
|
||||
src/libudev/libudev-util.c | 10 +++++++---
|
||||
src/libudev/libudev.c | 19 ++++++++++++++++---
|
||||
2 files changed, 23 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
|
||||
index f3fdf3b5aa..0bc10f3470 100644
|
||||
--- a/src/libudev/libudev-util.c
|
||||
+++ b/src/libudev/libudev-util.c
|
||||
@@ -159,9 +159,13 @@ int util_log_priority(const char *priority)
|
||||
char *endptr;
|
||||
int prio;
|
||||
|
||||
- prio = strtol(priority, &endptr, 10);
|
||||
- if (endptr[0] == '\0' || isspace(endptr[0]))
|
||||
- return prio;
|
||||
+ prio = strtoul(priority, &endptr, 10);
|
||||
+ if (endptr[0] == '\0' || isspace(endptr[0])) {
|
||||
+ if (prio >= 0 && prio <= 7)
|
||||
+ return prio;
|
||||
+ else
|
||||
+ return -ERANGE;
|
||||
+ }
|
||||
|
||||
return log_level_from_string(priority);
|
||||
}
|
||||
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
|
||||
index 7803863b2e..8464427651 100644
|
||||
--- a/src/libudev/libudev.c
|
||||
+++ b/src/libudev/libudev.c
|
||||
@@ -193,7 +193,13 @@ _public_ struct udev *udev_new(void)
|
||||
}
|
||||
|
||||
if (streq(key, "udev_log")) {
|
||||
- udev_set_log_priority(udev, util_log_priority(val));
|
||||
+ int prio;
|
||||
+
|
||||
+ prio = util_log_priority(val);
|
||||
+ if (prio < 0)
|
||||
+ udev_err(udev, "/etc/udev/udev.conf:%u: invalid logging level '%s', ignoring.\n", line_nr, val);
|
||||
+ else
|
||||
+ udev_set_log_priority(udev, prio);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -201,8 +207,15 @@ _public_ struct udev *udev_new(void)
|
||||
|
||||
/* environment overrides config */
|
||||
env = secure_getenv("UDEV_LOG");
|
||||
- if (env != NULL)
|
||||
- udev_set_log_priority(udev, util_log_priority(env));
|
||||
+ if (env != NULL) {
|
||||
+ int prio;
|
||||
+
|
||||
+ prio = util_log_priority(env);
|
||||
+ if (prio < 0)
|
||||
+ udev_err(udev, "$UDEV_LOG specifies invalid logging level '%s', ignoring.\n", env);
|
||||
+ else
|
||||
+ udev_set_log_priority(udev, prio);
|
||||
+ }
|
||||
|
||||
return udev;
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
From 5cec192e0c86a24bad9c3b24eca7d655470382df Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
||||
Date: Mon, 7 Jul 2014 21:40:00 +0200
|
||||
Subject: [PATCH] dropin: add format attribute and fix a wrong caller
|
||||
|
||||
(cherry picked from commit f5a4b0d3534bb13ef734a857647ab04be236c6f3)
|
||||
---
|
||||
src/shared/dropin.h | 4 +++-
|
||||
src/shared/generator.c | 2 +-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/shared/dropin.h b/src/shared/dropin.h
|
||||
index 27a2b2953f..9c9742d0e4 100644
|
||||
--- a/src/shared/dropin.h
|
||||
+++ b/src/shared/dropin.h
|
||||
@@ -21,6 +21,8 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
+#include "macro.h"
|
||||
+
|
||||
int drop_in_file(const char *dir, const char *unit, unsigned level,
|
||||
const char *name, char **_p, char **_q);
|
||||
|
||||
@@ -28,4 +30,4 @@ int write_drop_in(const char *dir, const char *unit, unsigned level,
|
||||
const char *name, const char *data);
|
||||
|
||||
int write_drop_in_format(const char *dir, const char *unit, unsigned level,
|
||||
- const char *name, const char *format, ...);
|
||||
+ const char *name, const char *format, ...) _printf_(5, 6);
|
||||
diff --git a/src/shared/generator.c b/src/shared/generator.c
|
||||
index 2f9e5954c2..5d4cb5d54f 100644
|
||||
--- a/src/shared/generator.c
|
||||
+++ b/src/shared/generator.c
|
||||
@@ -148,7 +148,7 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher
|
||||
|
||||
return write_drop_in_format(dir, unit, 50, "device-timeout",
|
||||
"# Automatically generated by %s\n\n"
|
||||
- "[Unit]\nJobTimeoutSec=%u",
|
||||
+ "[Unit]\nJobTimeoutSec=%lu",
|
||||
program_invocation_short_name,
|
||||
u / USEC_PER_SEC);
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
From acfc0db365d38b1185ab4cb47f03c63b9aa23087 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sat, 1 Nov 2014 14:36:29 -0400
|
||||
Subject: [PATCH] man: describe all log levels in udevadm(8)
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=85657
|
||||
(cherry picked from commit e03234a16047dc635d13f7118fc9fcf243744b51)
|
||||
---
|
||||
man/udevadm.xml | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/man/udevadm.xml b/man/udevadm.xml
|
||||
index b85d9a9249..fd17f40be3 100644
|
||||
--- a/man/udevadm.xml
|
||||
+++ b/man/udevadm.xml
|
||||
@@ -368,9 +368,14 @@
|
||||
<term><option>-l</option></term>
|
||||
<term><option>--log-priority=<replaceable>value</replaceable></option></term>
|
||||
<listitem>
|
||||
- <para>Set the internal log level of systemd-udevd. Valid values are the numerical
|
||||
- syslog priorities or their textual representations: <option>err</option>,
|
||||
- <option>info</option> and <option>debug</option>.</para>
|
||||
+ <para>Set the internal log level of
|
||||
+ <filename>systemd-udevd</filename>. Valid values are the
|
||||
+ numerical syslog priorities or their textual
|
||||
+ representations: <option>emerg</option>,
|
||||
+ <option>alert</option>, <option>crit</option>,
|
||||
+ <option>err</option>, <option>warning</option>,
|
||||
+ <option>notice</option>, <option>info</option>, and
|
||||
+ <option>debug</option>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
|
@ -1,92 +0,0 @@
|
|||
From af50ff78b93b683687464e45dee14033f494fcbe Mon Sep 17 00:00:00 2001
|
||||
From: Michael Biebl <biebl@debian.org>
|
||||
Date: Wed, 4 Jun 2014 01:57:11 +0200
|
||||
Subject: [PATCH] add new systemd-escape tool
|
||||
|
||||
(cherry picked from commit b1a5a9989ada9b3738d71605f051ff393d41f2ff)
|
||||
---
|
||||
Makefile.am | 10 +++++++++-
|
||||
src/escape/escape.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 55 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/escape/escape.c
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index e238cdeebf..c856d822de 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -347,7 +347,8 @@ bin_PROGRAMS = \
|
||||
systemd-delta \
|
||||
systemd-analyze \
|
||||
systemd-run \
|
||||
- systemd-path
|
||||
+ systemd-path \
|
||||
+ systemd-escape
|
||||
|
||||
dist_bin_SCRIPTS = \
|
||||
src/kernel-install/kernel-install
|
||||
@@ -2079,6 +2080,13 @@ systemd_cgroups_agent_LDADD = \
|
||||
libsystemd-shared.la
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
+systemd_escape_SOURCES = \
|
||||
+ src/escape/escape.c
|
||||
+
|
||||
+systemd_escape_LDADD = \
|
||||
+ libsystemd-shared.la
|
||||
+
|
||||
+# -----------------------------------------------------------------------------
|
||||
systemctl_SOURCES = \
|
||||
src/systemctl/systemctl.c
|
||||
|
||||
diff --git a/src/escape/escape.c b/src/escape/escape.c
|
||||
new file mode 100644
|
||||
index 0000000000..0a59a05e28
|
||||
--- /dev/null
|
||||
+++ b/src/escape/escape.c
|
||||
@@ -0,0 +1,46 @@
|
||||
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
+
|
||||
+/***
|
||||
+ This file is part of systemd.
|
||||
+
|
||||
+ Copyright 2014 Michael Biebl
|
||||
+
|
||||
+ systemd is free software; you can redistribute it and/or modify it
|
||||
+ under the terms of the GNU Lesser General Public License as published by
|
||||
+ the Free Software Foundation; either version 2.1 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ systemd is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public License
|
||||
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
+***/
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+#include "log.h"
|
||||
+#include "unit-name.h"
|
||||
+
|
||||
+int main(int argc, char *argv[]) {
|
||||
+ char *escaped_name = NULL;
|
||||
+
|
||||
+ if (argc != 2) {
|
||||
+ log_error("This program requires on argument.");
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ escaped_name = unit_name_escape(argv[1]);
|
||||
+
|
||||
+ if (!escaped_name) {
|
||||
+ log_error("Failed to escape name.");
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ printf("%s", escaped_name);
|
||||
+
|
||||
+ return EXIT_SUCCESS;
|
||||
+}
|
|
@ -0,0 +1,47 @@
|
|||
From 896050eeb3acbf4106d71204a5173b4984cf1675 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Synacek <jsynacek@redhat.com>
|
||||
Date: Fri, 31 Oct 2014 10:16:45 +0100
|
||||
Subject: [PATCH] core: improve error message when machine id is missing
|
||||
|
||||
(cherry picked from commit 86fb9ca7ae49790880d4b3ce523988b01b13d9ae)
|
||||
---
|
||||
src/core/machine-id-setup.c | 17 ++++++++++++-----
|
||||
1 file changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
|
||||
index efb074fcbd..ce6d8e02d0 100644
|
||||
--- a/src/core/machine-id-setup.c
|
||||
+++ b/src/core/machine-id-setup.c
|
||||
@@ -162,7 +162,7 @@ static int generate(char id[34], const char *root) {
|
||||
int machine_id_setup(const char *root) {
|
||||
const char *etc_machine_id, *run_machine_id;
|
||||
_cleanup_close_ int fd = -1;
|
||||
- bool writable = false;
|
||||
+ bool writable = true;
|
||||
struct stat st;
|
||||
char id[34]; /* 32 + \n + \0 */
|
||||
int r;
|
||||
@@ -186,12 +186,19 @@ int machine_id_setup(const char *root) {
|
||||
|
||||
mkdir_parents(etc_machine_id, 0755);
|
||||
fd = open(etc_machine_id, O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY, 0444);
|
||||
- if (fd >= 0)
|
||||
- writable = true;
|
||||
- else {
|
||||
+ if (fd < 0) {
|
||||
+ int old_errno = errno;
|
||||
+
|
||||
fd = open(etc_machine_id, O_RDONLY|O_CLOEXEC|O_NOCTTY);
|
||||
if (fd < 0) {
|
||||
- log_error("Cannot open %s: %m", etc_machine_id);
|
||||
+ if (old_errno == EROFS && errno == ENOENT)
|
||||
+ log_error("System cannot boot: Missing /etc/machine-id and /etc is mounted read-only.\n"
|
||||
+ "Booting up is supported only when:\n"
|
||||
+ "1) /etc/machine-id exists and is populated.\n"
|
||||
+ "2) /etc/machine-id exists and is empty.\n"
|
||||
+ "3) /etc/machine-id is missing and /etc is writable.\n");
|
||||
+ else
|
||||
+ log_error("Cannot open %s: %m", etc_machine_id);
|
||||
return -errno;
|
||||
}
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
From ee228789816679b6fff19c7c2f637eb0a1a3fcc4 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 22:23:00 +0200
|
||||
Subject: [PATCH] escape: beef up new systemd-escape tool
|
||||
|
||||
Add various options for making it easy unescape, or mangle, or format as
|
||||
template instance or append a suffix.
|
||||
|
||||
(cherry picked from commit a1948c7bfeb87b54bc7715a44490c01593ee6e23)
|
||||
|
||||
Conflicts:
|
||||
.gitignore
|
||||
---
|
||||
.gitignore | 1 +
|
||||
src/escape/Makefile | 1 +
|
||||
src/escape/escape.c | 215 +++++++++++++++++++++++++++++++++++++++++++++++++---
|
||||
3 files changed, 206 insertions(+), 11 deletions(-)
|
||||
create mode 120000 src/escape/Makefile
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 9523ea027e..e08aa52aee 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -64,6 +64,7 @@
|
||||
/systemd-delta
|
||||
/systemd-detect-virt
|
||||
/systemd-efi-boot-generator
|
||||
+/systemd-escape
|
||||
/systemd-fsck
|
||||
/systemd-fstab-generator
|
||||
/systemd-getty-generator
|
||||
diff --git a/src/escape/Makefile b/src/escape/Makefile
|
||||
new file mode 120000
|
||||
index 0000000000..d0b0e8e008
|
||||
--- /dev/null
|
||||
+++ b/src/escape/Makefile
|
||||
@@ -0,0 +1 @@
|
||||
+../Makefile
|
||||
\ No newline at end of file
|
||||
diff --git a/src/escape/escape.c b/src/escape/escape.c
|
||||
index 0a59a05e28..ae0c183eca 100644
|
||||
--- a/src/escape/escape.c
|
||||
+++ b/src/escape/escape.c
|
||||
@@ -21,26 +21,219 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <getopt.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "unit-name.h"
|
||||
+#include "build.h"
|
||||
+#include "strv.h"
|
||||
|
||||
-int main(int argc, char *argv[]) {
|
||||
- char *escaped_name = NULL;
|
||||
+static enum {
|
||||
+ ACTION_ESCAPE,
|
||||
+ ACTION_UNESCAPE,
|
||||
+ ACTION_MANGLE
|
||||
+} arg_action = ACTION_ESCAPE;
|
||||
+static const char *arg_suffix = NULL;
|
||||
+static const char *arg_template = NULL;
|
||||
+static bool arg_path = false;
|
||||
+
|
||||
+static int help(void) {
|
||||
+
|
||||
+ printf("%s [OPTIONS...] [NAME...]\n\n"
|
||||
+ "Show system and user paths.\n\n"
|
||||
+ " -h --help Show this help\n"
|
||||
+ " --version Show package version\n"
|
||||
+ " --suffix=SUFFIX Unit suffix to append to escaped strings\n"
|
||||
+ " --template=TEMPLATE Insert strings as instance into template\n"
|
||||
+ " -u --unescape Unescape strings\n"
|
||||
+ " -m --mangle Mangle strings\n"
|
||||
+ " -p --path When escaping/unescaping assume the string is a path\n",
|
||||
+ program_invocation_short_name);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int parse_argv(int argc, char *argv[]) {
|
||||
+
|
||||
+ enum {
|
||||
+ ARG_VERSION = 0x100,
|
||||
+ ARG_SUFFIX,
|
||||
+ ARG_TEMPLATE
|
||||
+ };
|
||||
+
|
||||
+ static const struct option options[] = {
|
||||
+ { "help", no_argument, NULL, 'h' },
|
||||
+ { "version", no_argument, NULL, ARG_VERSION },
|
||||
+ { "suffix", required_argument, NULL, ARG_SUFFIX },
|
||||
+ { "template", required_argument, NULL, ARG_TEMPLATE },
|
||||
+ { "unescape", no_argument, NULL, 'u' },
|
||||
+ { "mangle", no_argument, NULL, 'm' },
|
||||
+ { "path", no_argument, NULL, 'p' },
|
||||
+ {}
|
||||
+ };
|
||||
+
|
||||
+ int c;
|
||||
+
|
||||
+ assert(argc >= 0);
|
||||
+ assert(argv);
|
||||
+
|
||||
+ while ((c = getopt_long(argc, argv, "hump", options, NULL)) >= 0) {
|
||||
+
|
||||
+ switch (c) {
|
||||
+
|
||||
+ case 'h':
|
||||
+ return help();
|
||||
+
|
||||
+ case ARG_VERSION:
|
||||
+ puts(PACKAGE_STRING);
|
||||
+ puts(SYSTEMD_FEATURES);
|
||||
+ return 0;
|
||||
+
|
||||
+ case ARG_SUFFIX:
|
||||
+
|
||||
+ if (unit_type_from_string(optarg) < 0) {
|
||||
+ log_error("Invalid unit suffix type %s.", optarg);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ arg_suffix = optarg;
|
||||
+ break;
|
||||
+
|
||||
+ case ARG_TEMPLATE:
|
||||
+
|
||||
+ if (!unit_name_is_valid(optarg, true) || !unit_name_is_template(optarg)) {
|
||||
+ log_error("Template name %s is not valid.", optarg);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ arg_template = optarg;
|
||||
+ break;
|
||||
+
|
||||
+ case 'u':
|
||||
+ arg_action = ACTION_UNESCAPE;
|
||||
+ break;
|
||||
+
|
||||
+ case 'm':
|
||||
+ arg_action = ACTION_MANGLE;
|
||||
+ break;
|
||||
+
|
||||
+ case 'p':
|
||||
+ arg_path = true;
|
||||
+ break;
|
||||
+
|
||||
+ case '?':
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ default:
|
||||
+ assert_not_reached("Unhandled option");
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- if (argc != 2) {
|
||||
- log_error("This program requires on argument.");
|
||||
- return EXIT_FAILURE;
|
||||
+ if (optind >= argc) {
|
||||
+ log_error("Not enough arguments.");
|
||||
+ return -EINVAL;
|
||||
}
|
||||
|
||||
- escaped_name = unit_name_escape(argv[1]);
|
||||
+ if (arg_template && arg_suffix) {
|
||||
+ log_error("--suffix= and --template= may not be combined.");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ if ((arg_template || arg_suffix) && arg_action != ACTION_ESCAPE) {
|
||||
+ log_error("--suffix= and --template= are not compatible with --unescape or --mangle.");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ if (arg_path && !IN_SET(arg_action, ACTION_ESCAPE, ACTION_UNESCAPE)) {
|
||||
+ log_error("--path may not be combined with --mangle.");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+int main(int argc, char *argv[]) {
|
||||
+ char **i;
|
||||
+ int r;
|
||||
+
|
||||
+ log_parse_environment();
|
||||
+ log_open();
|
||||
+
|
||||
+ r = parse_argv(argc, argv);
|
||||
+ if (r <= 0)
|
||||
+ goto finish;
|
||||
+
|
||||
+ STRV_FOREACH(i, argv + optind) {
|
||||
+ _cleanup_free_ char *e = NULL;
|
||||
+
|
||||
+ switch (arg_action) {
|
||||
+
|
||||
+ case ACTION_ESCAPE:
|
||||
+ if (arg_path)
|
||||
+ e = unit_name_path_escape(*i);
|
||||
+ else
|
||||
+ e = unit_name_escape(*i);
|
||||
+
|
||||
+ if (!e) {
|
||||
+ r = log_oom();
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
+ if (arg_template) {
|
||||
+ char *x;
|
||||
+
|
||||
+ x = unit_name_replace_instance(arg_template, e);
|
||||
+ if (!x) {
|
||||
+ r = log_oom();
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
+ free(e);
|
||||
+ e = x;
|
||||
+ } else if (arg_suffix) {
|
||||
+ char *x;
|
||||
+
|
||||
+ x = strjoin(e, ".", arg_suffix, NULL);
|
||||
+ if (!x) {
|
||||
+ r = log_oom();
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
+ free(e);
|
||||
+ e = x;
|
||||
+ }
|
||||
+
|
||||
+ break;
|
||||
+
|
||||
+ case ACTION_UNESCAPE:
|
||||
+ if (arg_path)
|
||||
+ e = unit_name_path_unescape(*i);
|
||||
+ else
|
||||
+ e = unit_name_unescape(*i);
|
||||
+
|
||||
+ if (!e) {
|
||||
+ r = log_oom();
|
||||
+ goto finish;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case ACTION_MANGLE:
|
||||
+ e = unit_name_mangle(*i, MANGLE_NOGLOB);
|
||||
+ if (!e) {
|
||||
+ r = log_oom();
|
||||
+ goto finish;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i != argv+optind)
|
||||
+ fputc(' ', stdout);
|
||||
|
||||
- if (!escaped_name) {
|
||||
- log_error("Failed to escape name.");
|
||||
- return EXIT_FAILURE;
|
||||
+ fputs(e, stdout);
|
||||
}
|
||||
|
||||
- printf("%s", escaped_name);
|
||||
+ fputc('\n', stdout);
|
||||
|
||||
- return EXIT_SUCCESS;
|
||||
+finish:
|
||||
+ return r ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
From 3169d6cf7f78ab2906b7249466d0c5721890fc7a Mon Sep 17 00:00:00 2001
|
||||
From: Umut Tezduyar Lindskog <umut.tezduyar@axis.com>
|
||||
Date: Wed, 29 Oct 2014 11:20:02 +0100
|
||||
Subject: [PATCH] man: explain journalctl --flush correctly
|
||||
|
||||
(cherry picked from commit 2a97b03b3b087e724867e7501ae0c1535ee35031)
|
||||
---
|
||||
NEWS | 4 ++++
|
||||
man/journalctl.xml | 4 ++--
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index bf8d0ac242..afc73a781f 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,6 +7,10 @@ CHANGES WITH 217:
|
||||
show log timestamps in the UTC timezone. journalctl now also
|
||||
accepts -n/--lines=all to disable line capping in a pager.
|
||||
|
||||
+ * journalctl gained a new switch, --flush, that flushes
|
||||
+ logs from /run/log/journal to /var/log/journal if
|
||||
+ persistent storage is enabled.
|
||||
+
|
||||
* Services can notify the manager before they start a reload
|
||||
(by sending RELOADING=1) or shutdown (by sending
|
||||
STOPPING=1). This allows the manager to track and show the
|
||||
diff --git a/man/journalctl.xml b/man/journalctl.xml
|
||||
index db2a1e142b..0ed3ca3bc8 100644
|
||||
--- a/man/journalctl.xml
|
||||
+++ b/man/journalctl.xml
|
||||
@@ -883,9 +883,9 @@
|
||||
|
||||
<listitem><para>Asks the Journal
|
||||
daemon to flush any log data stored in
|
||||
- <filename>/run/systemd/log</filename>
|
||||
+ <filename>/run/log/journal</filename>
|
||||
into
|
||||
- <filename>/var/systemd/log</filename>,
|
||||
+ <filename>/var/log/journal</filename>,
|
||||
if persistent storage is enabled. This
|
||||
call does not return until the
|
||||
operation is
|
|
@ -1,234 +0,0 @@
|
|||
From 9045c9cedb155255e4dd55b988a39093364efbac Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 22:48:25 +0200
|
||||
Subject: [PATCH] man: document systemd-escape(1)
|
||||
|
||||
(cherry picked from commit 9869e75929acd9377aa460074334d8523cf8e822)
|
||||
|
||||
Conflicts:
|
||||
Makefile-man.am
|
||||
---
|
||||
Makefile-man.am | 2 +
|
||||
man/systemd-escape.xml | 193 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 195 insertions(+)
|
||||
create mode 100644 man/systemd-escape.xml
|
||||
|
||||
diff --git a/Makefile-man.am b/Makefile-man.am
|
||||
index 5c289dda2a..4238c21710 100644
|
||||
--- a/Makefile-man.am
|
||||
+++ b/Makefile-man.am
|
||||
@@ -63,6 +63,7 @@ MANPAGES += \
|
||||
man/systemd-delta.1 \
|
||||
man/systemd-detect-virt.1 \
|
||||
man/systemd-efi-boot-generator.8 \
|
||||
+ man/systemd-escape.1 \
|
||||
man/systemd-fsck@.service.8 \
|
||||
man/systemd-fstab-generator.8 \
|
||||
man/systemd-getty-generator.8 \
|
||||
@@ -1600,6 +1601,7 @@ EXTRA_DIST += \
|
||||
man/systemd-delta.xml \
|
||||
man/systemd-detect-virt.xml \
|
||||
man/systemd-efi-boot-generator.xml \
|
||||
+ man/systemd-escape.xml \
|
||||
man/systemd-fsck@.service.xml \
|
||||
man/systemd-fstab-generator.xml \
|
||||
man/systemd-getty-generator.xml \
|
||||
diff --git a/man/systemd-escape.xml b/man/systemd-escape.xml
|
||||
new file mode 100644
|
||||
index 0000000000..b2a4a9ce8c
|
||||
--- /dev/null
|
||||
+++ b/man/systemd-escape.xml
|
||||
@@ -0,0 +1,193 @@
|
||||
+<?xml version='1.0'?> <!--*-nxml-*-->
|
||||
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
+
|
||||
+<!--
|
||||
+ This file is part of systemd.
|
||||
+
|
||||
+ Copyright 2014 Lennart Poettering
|
||||
+
|
||||
+ systemd is free software; you can redistribute it and/or modify it
|
||||
+ under the terms of the GNU Lesser General Public License as published by
|
||||
+ the Free Software Foundation; either version 2.1 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ systemd is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public License
|
||||
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
+-->
|
||||
+
|
||||
+<refentry id="systemd-escape"
|
||||
+ xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
+
|
||||
+ <refentryinfo>
|
||||
+ <title>systemd-escape</title>
|
||||
+ <productname>systemd</productname>
|
||||
+
|
||||
+ <authorgroup>
|
||||
+ <author>
|
||||
+ <contrib>Developer</contrib>
|
||||
+ <firstname>Lennart</firstname>
|
||||
+ <surname>Poettering</surname>
|
||||
+ <email>lennart@poettering.net</email>
|
||||
+ </author>
|
||||
+ </authorgroup>
|
||||
+ </refentryinfo>
|
||||
+
|
||||
+ <refmeta>
|
||||
+ <refentrytitle>systemd-escape</refentrytitle>
|
||||
+ <manvolnum>1</manvolnum>
|
||||
+ </refmeta>
|
||||
+
|
||||
+ <refnamediv>
|
||||
+ <refname>systemd-escape</refname>
|
||||
+ <refpurpose>Escape strings for usage in system unit names</refpurpose>
|
||||
+ </refnamediv>
|
||||
+
|
||||
+ <refsynopsisdiv>
|
||||
+ <cmdsynopsis>
|
||||
+ <command>systemd-escape <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt" rep="repeat">STRING</arg></command>
|
||||
+ </cmdsynopsis>
|
||||
+ </refsynopsisdiv>
|
||||
+
|
||||
+ <refsect1>
|
||||
+ <title>Description</title>
|
||||
+
|
||||
+ <para><command>systemd-escape</command> may be used to
|
||||
+ escape strings for inclusion in systemd unit
|
||||
+ names. The command may be used to escape and to undo
|
||||
+ escaping of strings.</para>
|
||||
+
|
||||
+ <para>The command takes any number of strings on the
|
||||
+ command line, and will process them individually, one
|
||||
+ after the other. It will output them separated by
|
||||
+ spaces to stdout.</para>
|
||||
+
|
||||
+ <para>By default this command will escape the strings
|
||||
+ passed, unless <option>--unescape</option> is passed
|
||||
+ which results in the inverse operation being
|
||||
+ applied. If <option>--mangle</option> a special mode
|
||||
+ of escaping is applied instead, which assumes a string
|
||||
+ to be already escaped but will escape everything that
|
||||
+ appears obviously non-escaped.</para>
|
||||
+ </refsect1>
|
||||
+
|
||||
+ <refsect1>
|
||||
+ <title>Options</title>
|
||||
+
|
||||
+ <para>The following options are understood:</para>
|
||||
+
|
||||
+ <variablelist>
|
||||
+ <varlistentry>
|
||||
+ <term><option>--suffix=</option></term>
|
||||
+
|
||||
+ <listitem><para>Appends the specified
|
||||
+ unit type suffix to the escaped
|
||||
+ string. Takes one of the unit types
|
||||
+ supported by systemd, such as
|
||||
+ <literal>.service</literal> or
|
||||
+ <literal>.mount</literal>. May not be
|
||||
+ used in conjunction with
|
||||
+ <option>--template=</option>,
|
||||
+ <option>--unescape</option> or
|
||||
+ <option>--mangle</option>.</para></listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
+ <term><option>--template=</option></term>
|
||||
+
|
||||
+ <listitem><para>Inserts the escaped
|
||||
+ strings in a unit name template. Takes
|
||||
+ a unit name template such as
|
||||
+ <filename>foobar@.service</filename>
|
||||
+ May not be used in conjunction with
|
||||
+ <option>--suffix=</option>,
|
||||
+ <option>--unescape</option> or
|
||||
+ <option>--mangle</option>.</para></listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
+ <term><option>--path</option></term>
|
||||
+ <term><option>-p</option></term>
|
||||
+
|
||||
+ <listitem><para>When escaping or
|
||||
+ unescaping a string, assume it refers
|
||||
+ to a file system path. This enables
|
||||
+ special processing of the initial
|
||||
+ <literal>/</literal> of the
|
||||
+ path.</para></listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
+ <term><option>--unescape</option></term>
|
||||
+
|
||||
+ <listitem><para>Instead of escaping
|
||||
+ the specified strings, undo the
|
||||
+ escaping, reversing the operation. May
|
||||
+ not be used in conjunction with
|
||||
+ <option>--suffix=</option>,
|
||||
+ <option>--template=</option> or
|
||||
+ <option>--mangle</option>.</para></listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
+ <term><option>--mangle</option></term>
|
||||
+
|
||||
+ <listitem><para>Like
|
||||
+ <option>--escape</option>, but only
|
||||
+ escape characters that are obviously
|
||||
+ not escaped yet, and possibly
|
||||
+ automatically append an appropriate
|
||||
+ unit type suffix to the string. May
|
||||
+ not be used in conjunction with
|
||||
+ <option>--suffix=</option>,
|
||||
+ <option>--template=</option> or
|
||||
+ <option>--unescape</option>.</para></listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <xi:include href="standard-options.xml" xpointer="help" />
|
||||
+ <xi:include href="standard-options.xml" xpointer="version" />
|
||||
+ </variablelist>
|
||||
+
|
||||
+ </refsect1>
|
||||
+
|
||||
+ <refsect1>
|
||||
+ <title>Examples</title>
|
||||
+
|
||||
+ <para>Escape a single string:</para>
|
||||
+ <programlisting>$ systemd-escape 'Hallöchen, Meister'
|
||||
+Hall\xc3\xb6chen\x2c\x20Meister</programlisting>
|
||||
+
|
||||
+ <para>To undo escaping on a single string:</para>
|
||||
+ <programlisting>$ systemd-escape -u 'Hall\xc3\xb6chen\x2c\x20Meister'
|
||||
+Hallöchen, Meister</programlisting>
|
||||
+
|
||||
+ <para>To generate the mount unit for a path:</para>
|
||||
+ <programlisting>$ systemd-escape -p --suffix=mount "/tmp//waldi/foobar/"
|
||||
+tmp-waldi-foobar.mount</programlisting>
|
||||
+
|
||||
+ <para>To generate instance names of three strings</para>
|
||||
+ <programlisting>$ systemd-escape --template=systemd-nspawn@.service 'My Container 1' 'containerb' 'container/III'
|
||||
+systemd-nspawn@My\x20Container\x201.service systemd-nspawn@containerb.service systemd-nspawn@container-III.service</programlisting>
|
||||
+ </refsect1>
|
||||
+
|
||||
+ <refsect1>
|
||||
+ <title>Exit status</title>
|
||||
+
|
||||
+ <para>On success, 0 is returned, a non-zero failure
|
||||
+ code otherwise.</para>
|
||||
+ </refsect1>
|
||||
+
|
||||
+ <refsect1>
|
||||
+ <title>See Also</title>
|
||||
+ <para>
|
||||
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
+ <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
||||
+ </para>
|
||||
+ </refsect1>
|
||||
+
|
||||
+</refentry>
|
|
@ -0,0 +1,45 @@
|
|||
From 309ce8c2537ae72e2c7a07b7e21bee5fd2da0960 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sat, 1 Nov 2014 13:52:14 -0400
|
||||
Subject: [PATCH] systemd-journal-flush.service: remove "trigger" from
|
||||
description
|
||||
|
||||
This service is now synchronous, so "trigger" is misleading.
|
||||
|
||||
(cherry picked from commit a65b82457735df2ef58736a55846f400124a8dc0)
|
||||
---
|
||||
NEWS | 7 ++++---
|
||||
units/systemd-journal-flush.service.in | 2 +-
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index afc73a781f..ac987ad5b7 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,9 +7,10 @@ CHANGES WITH 217:
|
||||
show log timestamps in the UTC timezone. journalctl now also
|
||||
accepts -n/--lines=all to disable line capping in a pager.
|
||||
|
||||
- * journalctl gained a new switch, --flush, that flushes
|
||||
- logs from /run/log/journal to /var/log/journal if
|
||||
- persistent storage is enabled.
|
||||
+ * journalctl gained a new switch, --flush, that synchronously
|
||||
+ flushes logs from /run/log/journal to /var/log/journal if
|
||||
+ persistent storage is enabled. systemd-journal-flush.service
|
||||
+ now waits until the operation is complete.
|
||||
|
||||
* Services can notify the manager before they start a reload
|
||||
(by sending RELOADING=1) or shutdown (by sending
|
||||
diff --git a/units/systemd-journal-flush.service.in b/units/systemd-journal-flush.service.in
|
||||
index 2612220e2e..fa290897d6 100644
|
||||
--- a/units/systemd-journal-flush.service.in
|
||||
+++ b/units/systemd-journal-flush.service.in
|
||||
@@ -6,7 +6,7 @@
|
||||
# (at your option) any later version.
|
||||
|
||||
[Unit]
|
||||
-Description=Trigger Flushing of Journal to Persistent Storage
|
||||
+Description=Flush Journal to Persistent Storage
|
||||
Documentation=man:systemd-journald.service(8) man:journald.conf(5)
|
||||
DefaultDependencies=no
|
||||
Requires=systemd-journald.service
|
|
@ -0,0 +1,36 @@
|
|||
From b464167132f65d25364d3d22368346ab48981a4a Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chapman <mike@very.puzzling.org>
|
||||
Date: Wed, 29 Oct 2014 11:54:07 +1100
|
||||
Subject: [PATCH] kernel-install/90-loaderentry.install: fix cmdline parsing
|
||||
|
||||
A recent commit (2f3a215) changed the parsing of /proc/cmdline to use a
|
||||
shell array. Unfortunately, this introduced a bug: "read -ar line"
|
||||
populates the shell variable $r, not $line. This breaks installation of
|
||||
new loader entries:
|
||||
|
||||
# kernel-install add 3.17.1-304.fc21.x86_64 \
|
||||
/boot/vmlinuz-3.17.1-304.fc21.x86_64
|
||||
Could not determine the kernel command line parameters.
|
||||
Please specify the kernel command line in /etc/kernel/cmdline!
|
||||
|
||||
This commit alters the read command to correctly populate the $line
|
||||
array instead.
|
||||
|
||||
(cherry picked from commit c008f6ee8df9aa36782378d1a3767543b3635a54)
|
||||
---
|
||||
src/kernel-install/90-loaderentry.install | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install
|
||||
index 6f032b5a4b..d433e00a5c 100644
|
||||
--- a/src/kernel-install/90-loaderentry.install
|
||||
+++ b/src/kernel-install/90-loaderentry.install
|
||||
@@ -47,7 +47,7 @@ if [[ -f /etc/kernel/cmdline ]]; then
|
||||
fi
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
- read -ar line < /proc/cmdline
|
||||
+ read -a line -r < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" ]] && continue
|
||||
BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i"
|
|
@ -1,23 +0,0 @@
|
|||
From 539fc6acb23fb2928a2443d1e27db95d7084d41a Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 22:49:59 +0200
|
||||
Subject: [PATCH] shared: fix format string for usec_t type
|
||||
|
||||
(cherry picked from commit de48d5ab62e452b596d6f2762422d0ab32c4d313)
|
||||
---
|
||||
src/shared/generator.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/shared/generator.c b/src/shared/generator.c
|
||||
index 5d4cb5d54f..414470be1c 100644
|
||||
--- a/src/shared/generator.c
|
||||
+++ b/src/shared/generator.c
|
||||
@@ -148,7 +148,7 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher
|
||||
|
||||
return write_drop_in_format(dir, unit, 50, "device-timeout",
|
||||
"# Automatically generated by %s\n\n"
|
||||
- "[Unit]\nJobTimeoutSec=%lu",
|
||||
+ "[Unit]\nJobTimeoutSec=" USEC_FMT,
|
||||
program_invocation_short_name,
|
||||
u / USEC_PER_SEC);
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
From a1a46db86071388fcfeb35d06147f673c6c58c6d Mon Sep 17 00:00:00 2001
|
||||
From: David Herrmann <dh.herrmann@gmail.com>
|
||||
Date: Tue, 8 Jul 2014 12:56:55 +0200
|
||||
Subject: [PATCH] logind: allow switching to unused VTs via SwitchTo()
|
||||
|
||||
If compositors use the new SwitchTo() logic to map F1-F12, we should allow
|
||||
them to switch to unregistered VTs, too. Otherwise, the auto-spawn logic
|
||||
of gettys won't trigger.
|
||||
|
||||
Reported-by: Jasper St. Pierre <jstpierre@mecheye.net>
|
||||
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
|
||||
(cherry picked from commit 154034270c4643b7cfe61c0be1676d78bb1b7b07)
|
||||
---
|
||||
src/login/logind-seat.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
|
||||
index 3114de84de..9992195151 100644
|
||||
--- a/src/login/logind-seat.c
|
||||
+++ b/src/login/logind-seat.c
|
||||
@@ -275,8 +275,13 @@ int seat_switch_to(Seat *s, unsigned int num) {
|
||||
if (!num)
|
||||
return -EINVAL;
|
||||
|
||||
- if (num >= s->position_count || !s->positions[num])
|
||||
+ if (num >= s->position_count || !s->positions[num]) {
|
||||
+ /* allow switching to unused VTs to trigger auto-activate */
|
||||
+ if (seat_has_vts(s) && num < 64)
|
||||
+ return chvt(num);
|
||||
+
|
||||
return -EINVAL;
|
||||
+ }
|
||||
|
||||
return session_activate(s->positions[num]);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
From 3db8a5d1b39f88981e979ff01afb4a0c7aa9a126 Mon Sep 17 00:00:00 2001
|
||||
From: Joe Lawrence <joe.lawrence@stratus.com>
|
||||
Date: Sat, 1 Nov 2014 12:18:08 -0400
|
||||
Subject: [PATCH] scsi_id: fix usage spelling
|
||||
|
||||
s/threat/treat/g
|
||||
|
||||
(cherry picked from commit 85f13fce322e6303e7e4e55cb43104f81827f36b)
|
||||
---
|
||||
src/udev/scsi_id/scsi_id.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c
|
||||
index 4d9378a5c0..48c6cf7dba 100644
|
||||
--- a/src/udev/scsi_id/scsi_id.c
|
||||
+++ b/src/udev/scsi_id/scsi_id.c
|
||||
@@ -317,8 +317,8 @@ static void help(void) {
|
||||
" -f,--config= location of config file\n"
|
||||
" -p,--page=0x80|0x83|pre-spc3-83 SCSI page (0x80, 0x83, pre-spc3-83)\n"
|
||||
" -s,--sg-version=3|4 use SGv3 or SGv4\n"
|
||||
- " -b,--blacklisted threat device as blacklisted\n"
|
||||
- " -g,--whitelisted threat device as whitelisted\n"
|
||||
+ " -b,--blacklisted treat device as blacklisted\n"
|
||||
+ " -g,--whitelisted treat device as whitelisted\n"
|
||||
" -u,--replace-whitespace replace all whitespace by underscores\n"
|
||||
" -v,--verbose verbose logging\n"
|
||||
" --version print version\n"
|
|
@ -0,0 +1,28 @@
|
|||
From 5a9b149c96f39d8363e6b2dcb45e95056d2799ea Mon Sep 17 00:00:00 2001
|
||||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Sat, 1 Nov 2014 15:49:53 -0400
|
||||
Subject: [PATCH] libudev: Use correct free function
|
||||
|
||||
FILE * wants cleanup_fclose().
|
||||
|
||||
Spotted by udev hwdb segfaulting in gnome-continuous' buildroot
|
||||
construction.
|
||||
|
||||
(cherry picked from commit ea55caa60c6860e33fa4f1a216c003ff666e9c68)
|
||||
---
|
||||
src/libudev/libudev.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
|
||||
index 8464427651..05f3b479fa 100644
|
||||
--- a/src/libudev/libudev.c
|
||||
+++ b/src/libudev/libudev.c
|
||||
@@ -119,7 +119,7 @@ _public_ struct udev *udev_new(void)
|
||||
{
|
||||
struct udev *udev;
|
||||
const char *env;
|
||||
- _cleanup_free_ FILE *f = NULL;
|
||||
+ _cleanup_fclose_ FILE *f = NULL;
|
||||
|
||||
udev = new0(struct udev, 1);
|
||||
if (udev == NULL)
|
|
@ -1,24 +0,0 @@
|
|||
From bcb94736047823194fcfc98e23c4ed4e392eb3d3 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Schmidt <mschmidt@redhat.com>
|
||||
Date: Tue, 8 Jul 2014 15:17:36 +0200
|
||||
Subject: [PATCH] systemctl: fix visual alignment for lines prefixed with color
|
||||
dots
|
||||
|
||||
(cherry picked from commit b7bbdabeb4a5b66fdbcdfed0d097109cfb39c43e)
|
||||
---
|
||||
src/systemctl/systemctl.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
||||
index 03720f411d..8086e1e296 100644
|
||||
--- a/src/systemctl/systemctl.c
|
||||
+++ b/src/systemctl/systemctl.c
|
||||
@@ -456,7 +456,7 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
|
||||
}
|
||||
|
||||
if (circle_len > 0)
|
||||
- printf("%s%s%s", on_circle, circle ? draw_special_char(DRAW_BLACK_CIRCLE) : " ", off_circle);
|
||||
+ printf("%s%s%s ", on_circle, circle ? draw_special_char(DRAW_BLACK_CIRCLE) : " ", off_circle);
|
||||
|
||||
printf("%s%-*s%s %s%-*s%s %s%-*s %-*s%s %-*s",
|
||||
on_active, id_len, id, off_active,
|
|
@ -0,0 +1,40 @@
|
|||
From b5404292de0a4252b4b7447ef45bf3f334cae529 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 12:10:42 -0500
|
||||
Subject: [PATCH] Raise level of 'Found dependency...' lines
|
||||
|
||||
This way they always show up together with 'Found ordering cycle...'.
|
||||
Ordering cycles are a serious error and a major pain to debug. If
|
||||
quiet is enabled, only the first and the last line of output are
|
||||
shown:
|
||||
|
||||
systemd[1]: Found ordering cycle on basic.target/start
|
||||
systemd[1]: Breaking ordering cycle by deleting job timers.target/start
|
||||
systemd[1]: Job timers.target/start deleted to break ordering cycle starting with basic.target/start
|
||||
|
||||
which isn't particularly enlightening. So just show the whole message
|
||||
at the same level.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1158206
|
||||
(cherry picked from commit 14fe721b5f6d8457cc8737fa75f2ed79e7fa534b)
|
||||
---
|
||||
src/core/transaction.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/core/transaction.c b/src/core/transaction.c
|
||||
index dbb4133fe3..91f5ee18df 100644
|
||||
--- a/src/core/transaction.c
|
||||
+++ b/src/core/transaction.c
|
||||
@@ -377,9 +377,9 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
|
||||
for (k = from; k; k = ((k->generation == generation && k->marker != k) ? k->marker : NULL)) {
|
||||
|
||||
/* logging for j not k here here to provide consistent narrative */
|
||||
- log_info_unit(j->unit->id,
|
||||
- "Found dependency on %s/%s",
|
||||
- k->unit->id, job_type_to_string(k->type));
|
||||
+ log_warning_unit(j->unit->id,
|
||||
+ "Found dependency on %s/%s",
|
||||
+ k->unit->id, job_type_to_string(k->type));
|
||||
|
||||
if (!delete && hashmap_get(tr->jobs, k->unit) &&
|
||||
!unit_matters_to_anchor(k->unit, k)) {
|
|
@ -1,74 +0,0 @@
|
|||
From e27bfc22bba932950a398b32bf57be6f825438ee Mon Sep 17 00:00:00 2001
|
||||
From: Bastien Nocera <hadess@hadess.net>
|
||||
Date: Tue, 8 Jul 2014 18:29:06 +0200
|
||||
Subject: [PATCH] accelerometer: Don't wait for new data from the sensor
|
||||
|
||||
Instead of waiting for new data from the sensor, which might be
|
||||
a long time coming, depending on the sensor device, ask the kernel
|
||||
for the last state for that particular input device.
|
||||
|
||||
(cherry picked from commit a545c6e1aa31b4d7e80c9d3609d9fc4fc9921498)
|
||||
---
|
||||
src/udev/accelerometer/accelerometer.c | 33 ++++++---------------------------
|
||||
1 file changed, 6 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/src/udev/accelerometer/accelerometer.c b/src/udev/accelerometer/accelerometer.c
|
||||
index 925d38de1f..32adf27777 100644
|
||||
--- a/src/udev/accelerometer/accelerometer.c
|
||||
+++ b/src/udev/accelerometer/accelerometer.c
|
||||
@@ -180,7 +180,7 @@ get_prev_orientation(struct udev_device *dev)
|
||||
return string_to_orientation(value);
|
||||
}
|
||||
|
||||
-#define SET_AXIS(axis, code_) if (ev[i].code == code_) { if (got_##axis == 0) { axis = ev[i].value; got_##axis = true; } }
|
||||
+#define READ_AXIS(axis, var) { memzero(&abs_info, sizeof(abs_info)); r = ioctl(fd, EVIOCGABS(axis), &abs_info); if (r < 0) return; var = abs_info.value; }
|
||||
|
||||
/* accelerometers */
|
||||
static void test_orientation(struct udev *udev,
|
||||
@@ -189,10 +189,9 @@ static void test_orientation(struct udev *udev,
|
||||
{
|
||||
OrientationUp old, new;
|
||||
_cleanup_close_ int fd = -1;
|
||||
- struct input_event ev[64];
|
||||
- bool got_syn = false;
|
||||
- bool got_x = false, got_y = false, got_z = false;
|
||||
+ struct input_absinfo abs_info;
|
||||
int x = 0, y = 0, z = 0;
|
||||
+ int r;
|
||||
char text[64];
|
||||
|
||||
old = get_prev_orientation(dev);
|
||||
@@ -201,30 +200,10 @@ static void test_orientation(struct udev *udev,
|
||||
if (fd < 0)
|
||||
return;
|
||||
|
||||
- while (1) {
|
||||
- int i, r;
|
||||
-
|
||||
- r = read(fd, ev, sizeof(struct input_event) * 64);
|
||||
-
|
||||
- if (r < (int) sizeof(struct input_event))
|
||||
- return;
|
||||
-
|
||||
- for (i = 0; i < r / (int) sizeof(struct input_event); i++) {
|
||||
- if (got_syn) {
|
||||
- if (ev[i].type == EV_ABS) {
|
||||
- SET_AXIS(x, ABS_X);
|
||||
- SET_AXIS(y, ABS_Y);
|
||||
- SET_AXIS(z, ABS_Z);
|
||||
- }
|
||||
- }
|
||||
- if (ev[i].type == EV_SYN && ev[i].code == SYN_REPORT)
|
||||
- got_syn = true;
|
||||
- if (got_x && got_y && got_z)
|
||||
- goto read_dev;
|
||||
- }
|
||||
- }
|
||||
+ READ_AXIS(ABS_X, x);
|
||||
+ READ_AXIS(ABS_Y, y);
|
||||
+ READ_AXIS(ABS_Z, z);
|
||||
|
||||
-read_dev:
|
||||
new = orientation_calc(old, x, y, z);
|
||||
snprintf(text, sizeof(text),
|
||||
"ID_INPUT_ACCELEROMETER_ORIENTATION=%s", orientation_to_string(new));
|
|
@ -1,38 +0,0 @@
|
|||
From f6431973ef3d681c1c0c3e6850c7906a22ee7ec7 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Biebl <biebl@debian.org>
|
||||
Date: Tue, 8 Jul 2014 21:06:07 +0200
|
||||
Subject: [PATCH] escape: move to rootbindir
|
||||
|
||||
The systemd-escape utility might be used during early boot (e.g. when
|
||||
being triggered from udev rules), so move it to rootbindir to support
|
||||
systems with a split /usr setup.
|
||||
|
||||
(cherry picked from commit 2945a452b084879c6885efe51aefea00c179aa5f)
|
||||
---
|
||||
Makefile.am | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index c856d822de..7210ab70be 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -337,7 +337,8 @@ rootbin_PROGRAMS = \
|
||||
systemd-notify \
|
||||
systemd-ask-password \
|
||||
systemd-tty-ask-password-agent \
|
||||
- systemd-machine-id-setup
|
||||
+ systemd-machine-id-setup \
|
||||
+ systemd-escape
|
||||
|
||||
bin_PROGRAMS = \
|
||||
systemd-cgls \
|
||||
@@ -347,8 +348,7 @@ bin_PROGRAMS = \
|
||||
systemd-delta \
|
||||
systemd-analyze \
|
||||
systemd-run \
|
||||
- systemd-path \
|
||||
- systemd-escape
|
||||
+ systemd-path
|
||||
|
||||
dist_bin_SCRIPTS = \
|
||||
src/kernel-install/kernel-install
|
|
@ -0,0 +1,124 @@
|
|||
From db2241b5259671c2a7435235f5fc560ba4e97077 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 12:19:38 -0500
|
||||
Subject: [PATCH] manager: do not print timing when running in test mode
|
||||
|
||||
(cherry picked from commit 56dacdbc1ca95cef8bf8c97c0d7af761a71eaab3)
|
||||
---
|
||||
src/core/manager.c | 84 ++++++++++++++++++++++++++++++------------------------
|
||||
1 file changed, 46 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/src/core/manager.c b/src/core/manager.c
|
||||
index d427d88d4e..ff29ae1d9d 100644
|
||||
--- a/src/core/manager.c
|
||||
+++ b/src/core/manager.c
|
||||
@@ -2584,45 +2584,13 @@ bool manager_unit_inactive_or_pending(Manager *m, const char *name) {
|
||||
return unit_inactive_or_pending(u);
|
||||
}
|
||||
|
||||
-void manager_check_finished(Manager *m) {
|
||||
+static void manager_notify_finished(Manager *m) {
|
||||
char userspace[FORMAT_TIMESPAN_MAX], initrd[FORMAT_TIMESPAN_MAX], kernel[FORMAT_TIMESPAN_MAX], sum[FORMAT_TIMESPAN_MAX];
|
||||
usec_t firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec;
|
||||
- Unit *u = NULL;
|
||||
- Iterator i;
|
||||
|
||||
- assert(m);
|
||||
-
|
||||
- if (m->n_running_jobs == 0)
|
||||
- m->jobs_in_progress_event_source = sd_event_source_unref(m->jobs_in_progress_event_source);
|
||||
-
|
||||
- if (hashmap_size(m->jobs) > 0) {
|
||||
-
|
||||
- if (m->jobs_in_progress_event_source)
|
||||
- sd_event_source_set_time(m->jobs_in_progress_event_source, now(CLOCK_MONOTONIC) + JOBS_IN_PROGRESS_WAIT_USEC);
|
||||
-
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- manager_flip_auto_status(m, false);
|
||||
-
|
||||
- /* Notify Type=idle units that we are done now */
|
||||
- m->idle_pipe_event_source = sd_event_source_unref(m->idle_pipe_event_source);
|
||||
- manager_close_idle_pipe(m);
|
||||
-
|
||||
- /* Turn off confirm spawn now */
|
||||
- m->confirm_spawn = false;
|
||||
-
|
||||
- /* No need to update ask password status when we're going non-interactive */
|
||||
- manager_close_ask_password(m);
|
||||
-
|
||||
- /* This is no longer the first boot */
|
||||
- manager_set_first_boot(m, false);
|
||||
-
|
||||
- if (dual_timestamp_is_set(&m->finish_timestamp))
|
||||
+ if (m->test_run)
|
||||
return;
|
||||
|
||||
- dual_timestamp_get(&m->finish_timestamp);
|
||||
-
|
||||
if (m->running_as == SYSTEMD_SYSTEM && detect_container(NULL) <= 0) {
|
||||
|
||||
/* Note that m->kernel_usec.monotonic is always at 0,
|
||||
@@ -2677,10 +2645,6 @@ void manager_check_finished(Manager *m) {
|
||||
NULL);
|
||||
}
|
||||
|
||||
- SET_FOREACH(u, m->startup_units, i)
|
||||
- if (u->cgroup_path)
|
||||
- cgroup_context_apply(unit_get_cgroup_context(u), unit_get_cgroup_mask(u), u->cgroup_path, manager_state(m));
|
||||
-
|
||||
bus_manager_send_finished(m, firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec);
|
||||
|
||||
sd_notifyf(false,
|
||||
@@ -2689,6 +2653,50 @@ void manager_check_finished(Manager *m) {
|
||||
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC));
|
||||
}
|
||||
|
||||
+void manager_check_finished(Manager *m) {
|
||||
+ Unit *u = NULL;
|
||||
+ Iterator i;
|
||||
+
|
||||
+ assert(m);
|
||||
+
|
||||
+ if (m->n_running_jobs == 0)
|
||||
+ m->jobs_in_progress_event_source = sd_event_source_unref(m->jobs_in_progress_event_source);
|
||||
+
|
||||
+ if (hashmap_size(m->jobs) > 0) {
|
||||
+
|
||||
+ if (m->jobs_in_progress_event_source)
|
||||
+ sd_event_source_set_time(m->jobs_in_progress_event_source, now(CLOCK_MONOTONIC) + JOBS_IN_PROGRESS_WAIT_USEC);
|
||||
+
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ manager_flip_auto_status(m, false);
|
||||
+
|
||||
+ /* Notify Type=idle units that we are done now */
|
||||
+ m->idle_pipe_event_source = sd_event_source_unref(m->idle_pipe_event_source);
|
||||
+ manager_close_idle_pipe(m);
|
||||
+
|
||||
+ /* Turn off confirm spawn now */
|
||||
+ m->confirm_spawn = false;
|
||||
+
|
||||
+ /* No need to update ask password status when we're going non-interactive */
|
||||
+ manager_close_ask_password(m);
|
||||
+
|
||||
+ /* This is no longer the first boot */
|
||||
+ manager_set_first_boot(m, false);
|
||||
+
|
||||
+ if (dual_timestamp_is_set(&m->finish_timestamp))
|
||||
+ return;
|
||||
+
|
||||
+ dual_timestamp_get(&m->finish_timestamp);
|
||||
+
|
||||
+ manager_notify_finished(m);
|
||||
+
|
||||
+ SET_FOREACH(u, m->startup_units, i)
|
||||
+ if (u->cgroup_path)
|
||||
+ cgroup_context_apply(unit_get_cgroup_context(u), unit_get_cgroup_mask(u), u->cgroup_path, manager_state(m));
|
||||
+}
|
||||
+
|
||||
static int create_generator_dir(Manager *m, char **generator, const char *name) {
|
||||
char *p;
|
||||
int r;
|
|
@ -1,67 +0,0 @@
|
|||
From 00464ad8a698fe7735737fab57420f8a44013890 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Severinsson <jon@severinsson.net>
|
||||
Date: Tue, 8 Jul 2014 18:29:46 +0200
|
||||
Subject: [PATCH] journal/compress: improve xz compression performance
|
||||
|
||||
The new lzma2 compression options at the top of compress_blob_xz are
|
||||
equivalent to using preset "0", exept for using a 1 MiB dictionary
|
||||
(the same as preset "1"). This makes the memory usage at most 7.5 MiB
|
||||
in the compressor, and 1 MiB in the decompressor, instead of the
|
||||
previous 92 MiB in the compressor and 8 MiB in the decompressor.
|
||||
|
||||
According to test-compress-benchmark this commit makes XZ compression
|
||||
20 times faster, with no increase in compressed data size.
|
||||
Using more realistic test data (an ELF binary rather than repeating
|
||||
ASCII letters 'a' through 'z' in order) it only provides a factor 10
|
||||
speedup, and at a cost if a 10% increase in compressed data size.
|
||||
But that is still a worthwhile trade-off.
|
||||
|
||||
According to test-compress-benchmark XZ compression is still 25 times
|
||||
slower than LZ4, but the compressed data is one eighth the size.
|
||||
Using more realistic test data XZ compression is only 18 times slower
|
||||
than LZ4, and the compressed data is only one quarter the size.
|
||||
|
||||
$ ./test-compress-benchmark
|
||||
XZ: compressed & decompressed 2535300963 bytes in 42.30s (57.15MiB/s), mean compresion 99.95%, skipped 3570 bytes
|
||||
LZ4: compressed & decompressed 2535303543 bytes in 1.60s (1510.60MiB/s), mean compresion 99.60%, skipped 990 bytes
|
||||
|
||||
(cherry picked from commit 1930eed2a7855d2df06ccf51f9e394428bf547e2)
|
||||
|
||||
Conflicts:
|
||||
src/journal/compress.c
|
||||
---
|
||||
src/journal/compress.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/journal/compress.c b/src/journal/compress.c
|
||||
index 1fc62ead2a..9c0b74c455 100644
|
||||
--- a/src/journal/compress.c
|
||||
+++ b/src/journal/compress.c
|
||||
@@ -30,6 +30,13 @@
|
||||
#include "util.h"
|
||||
|
||||
bool compress_blob(const void *src, uint64_t src_size, void *dst, uint64_t *dst_size) {
|
||||
+ static const lzma_options_lzma opt = {
|
||||
+ 1u << 20u, NULL, 0, LZMA_LC_DEFAULT, LZMA_LP_DEFAULT,
|
||||
+ LZMA_PB_DEFAULT, LZMA_MODE_FAST, 128, LZMA_MF_HC3, 4};
|
||||
+ static const lzma_filter filters[2] = {
|
||||
+ {LZMA_FILTER_LZMA2, (lzma_options_lzma*) &opt},
|
||||
+ {LZMA_VLI_UNKNOWN, NULL}
|
||||
+ };
|
||||
lzma_ret ret;
|
||||
size_t out_pos = 0;
|
||||
|
||||
@@ -41,8 +48,11 @@ bool compress_blob(const void *src, uint64_t src_size, void *dst, uint64_t *dst_
|
||||
/* Returns false if we couldn't compress the data or the
|
||||
* compressed result is longer than the original */
|
||||
|
||||
- ret = lzma_easy_buffer_encode(LZMA_PRESET_DEFAULT, LZMA_CHECK_NONE, NULL,
|
||||
- src, src_size, dst, &out_pos, src_size);
|
||||
+ if (src_size < 80)
|
||||
+ return -ENOBUFS;
|
||||
+
|
||||
+ ret = lzma_stream_buffer_encode((lzma_filter*) filters, LZMA_CHECK_NONE, NULL,
|
||||
+ src, src_size, dst, &out_pos, src_size - 1);
|
||||
if (ret != LZMA_OK)
|
||||
return false;
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
From 3c6a000d5c291f998dba2eb4c8e351f4603ca985 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 11:39:17 -0500
|
||||
Subject: [PATCH] unit: do not order timers.target before basic.target
|
||||
|
||||
Since commit 19f8d037833f2 'timer: order OnCalendar units after
|
||||
timer-sync.target if DefaultDependencies=no' timers might get a
|
||||
dependency on time-sync.target, which does not really belong in early
|
||||
boot. If ntp is enabled, time-sync.target might be delayed until a
|
||||
network connection is established.
|
||||
|
||||
It turns out that majority of timer units found in the wild do not
|
||||
need to be started in early boot. Out of the timer units available in
|
||||
Fedora 21, only systemd-readahead-done.timer and mdadm-last-resort@.timer
|
||||
should be started early, but they both have DefaultDependencies=no,
|
||||
so are not part of timers.target anyway. All the rest look like they
|
||||
will be fine with being started a bit later (and the majority even
|
||||
much later, since they run daily or weekly).
|
||||
|
||||
Let timers.target be pulled in by basic.target, but without the
|
||||
temporal dependency. This means timer units are started on a "best
|
||||
effort" schedule.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1158206
|
||||
(cherry picked from commit 3b0217036040a6013faeab4eb9da7469e3bbcfb3)
|
||||
|
||||
Conflicts:
|
||||
units/basic.target
|
||||
---
|
||||
units/basic.target | 4 +++-
|
||||
units/timers.target | 3 +++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/units/basic.target b/units/basic.target
|
||||
index b890d48bbc..abb63ec560 100644
|
||||
--- a/units/basic.target
|
||||
+++ b/units/basic.target
|
||||
@@ -8,6 +8,8 @@
|
||||
[Unit]
|
||||
Description=Basic System
|
||||
Documentation=man:systemd.special(7)
|
||||
+
|
||||
Requires=sysinit.target
|
||||
+After=sysinit.target
|
||||
Wants=sockets.target timers.target paths.target slices.target
|
||||
-After=sysinit.target sockets.target timers.target paths.target slices.target
|
||||
+After=sockets.target paths.target slices.target
|
||||
diff --git a/units/timers.target b/units/timers.target
|
||||
index 07fda3d9d0..251fa68065 100644
|
||||
--- a/units/timers.target
|
||||
+++ b/units/timers.target
|
||||
@@ -8,3 +8,6 @@
|
||||
[Unit]
|
||||
Description=Timers
|
||||
Documentation=man:systemd.special(7)
|
||||
+
|
||||
+DefaultDependencies=no
|
||||
+Conflicts=shutdown.target
|
|
@ -1,24 +0,0 @@
|
|||
From 6f977a8c14c4cec72a85f20d0986daa391dd3319 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Wed, 9 Jul 2014 13:20:05 +0200
|
||||
Subject: [PATCH] hostnamed: add a new chassis type for watches
|
||||
|
||||
(cherry picked from commit c49e59c1831f20fe02276d7bc6ba7d23d24c4ab3)
|
||||
---
|
||||
src/hostname/hostnamed.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
|
||||
index 14629dd3a9..8127b688c4 100644
|
||||
--- a/src/hostname/hostnamed.c
|
||||
+++ b/src/hostname/hostnamed.c
|
||||
@@ -144,7 +144,8 @@ static bool valid_chassis(const char *chassis) {
|
||||
"laptop\0"
|
||||
"server\0"
|
||||
"tablet\0"
|
||||
- "handset\0",
|
||||
+ "handset\0"
|
||||
+ "watch\0",
|
||||
chassis);
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
From 0ce3f7e212c826162b15f8b78b18a4646b791a6d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 21:45:42 -0500
|
||||
Subject: [PATCH] units: order sd-journal-flush after sd-remount-fs
|
||||
|
||||
Otherwise we could attempt to flush the journal while /var/log/ was
|
||||
still ro, and silently skip journal flushing.
|
||||
|
||||
The way that errors in flushing are handled should still be changed to
|
||||
be more transparent and robust.
|
||||
|
||||
(cherry picked from commit 1f1926aa5e836caa3bd6df43704aecd606135103)
|
||||
---
|
||||
units/systemd-journal-flush.service.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/units/systemd-journal-flush.service.in b/units/systemd-journal-flush.service.in
|
||||
index fa290897d6..98c91b4bc5 100644
|
||||
--- a/units/systemd-journal-flush.service.in
|
||||
+++ b/units/systemd-journal-flush.service.in
|
||||
@@ -11,6 +11,7 @@ Documentation=man:systemd-journald.service(8) man:journald.conf(5)
|
||||
DefaultDependencies=no
|
||||
Requires=systemd-journald.service
|
||||
After=systemd-journald.service
|
||||
+After=systemd-remount-fs.service
|
||||
Before=systemd-user-sessions.service systemd-tmpfiles-setup.service
|
||||
RequiresMountsFor=/var/log/journal
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
From 710348ce7349b224ba58bae765611455320f68d1 Mon Sep 17 00:00:00 2001
|
||||
From: Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Date: Wed, 9 Jul 2014 13:37:50 +0200
|
||||
Subject: [PATCH] hostnamed: update documentation with new "watch" chassis type
|
||||
|
||||
(cherry picked from commit efab8d0b0ebf6d715949b7af66fecaf5e5e5d77b)
|
||||
---
|
||||
man/hostnamectl.xml | 3 ++-
|
||||
man/machine-info.xml | 3 ++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/man/hostnamectl.xml b/man/hostnamectl.xml
|
||||
index 4e456eb8f9..001bfced03 100644
|
||||
--- a/man/hostnamectl.xml
|
||||
+++ b/man/hostnamectl.xml
|
||||
@@ -205,7 +205,8 @@
|
||||
<literal>laptop</literal>,
|
||||
<literal>server</literal>,
|
||||
<literal>tablet</literal>,
|
||||
- <literal>handset</literal>, as well as
|
||||
+ <literal>handset</literal>,
|
||||
+ <literal>watch</literal>, as well as
|
||||
the special chassis types
|
||||
<literal>vm</literal> and
|
||||
<literal>container</literal> for
|
||||
diff --git a/man/machine-info.xml b/man/machine-info.xml
|
||||
index 7448e68fd4..244e9b69cf 100644
|
||||
--- a/man/machine-info.xml
|
||||
+++ b/man/machine-info.xml
|
||||
@@ -138,7 +138,8 @@
|
||||
<literal>laptop</literal>,
|
||||
<literal>server</literal>,
|
||||
<literal>tablet</literal>,
|
||||
- <literal>handset</literal>, as well as
|
||||
+ <literal>handset</literal>,
|
||||
+ <literal>watch</literal>, as well as
|
||||
the special chassis types
|
||||
<literal>vm</literal> and
|
||||
<literal>container</literal> for
|
|
@ -0,0 +1,33 @@
|
|||
From 25bfe24d32faa1203d74ffb6bfbf732e10426ea3 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Schmidt <mschmidt@redhat.com>
|
||||
Date: Tue, 4 Nov 2014 20:28:08 +0100
|
||||
Subject: [PATCH] units: make systemd-journald.service Type=notify
|
||||
|
||||
It already calls sd_notify(), so it looks like an oversight.
|
||||
|
||||
Without it, its ordering to systemd-journal-flush.service is
|
||||
non-deterministic and the SIGUSR1 from flushing may kill journald before
|
||||
it has its signal handlers set up.
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=85871
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1159641
|
||||
(cherry picked from commit a87a38c20196a4aeb56b6ba71d688eefd0b21c30)
|
||||
|
||||
Conflicts:
|
||||
units/systemd-journald.service.in
|
||||
---
|
||||
units/systemd-journald.service.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
|
||||
index 4de38fad59..441d5b1f96 100644
|
||||
--- a/units/systemd-journald.service.in
|
||||
+++ b/units/systemd-journald.service.in
|
||||
@@ -14,6 +14,7 @@ After=systemd-journald.socket systemd-journald-dev-log.socket syslog.socket
|
||||
Before=sysinit.target
|
||||
|
||||
[Service]
|
||||
+Type=notify
|
||||
Sockets=systemd-journald.socket systemd-journald-dev-log.socket
|
||||
ExecStart=@rootlibexecdir@/systemd-journald
|
||||
Restart=always
|
|
@ -0,0 +1,229 @@
|
|||
From a48190c9f9b07f735d14743878955511e66206c4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 6 Nov 2014 16:44:06 -0500
|
||||
Subject: [PATCH] Revert "missing: remove fanotify"
|
||||
|
||||
This reverts commit c7e4a7bece7a5c4484d229dd5e8ff01a5d49c62e.
|
||||
---
|
||||
Makefile.am | 1 +
|
||||
configure.ac | 1 +
|
||||
src/shared/linux/fanotify.h | 98 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
src/shared/missing.h | 59 +++++++++++++++++++++++++++
|
||||
4 files changed, 159 insertions(+)
|
||||
create mode 100644 src/shared/linux/fanotify.h
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 11a3033253..6d869c12ad 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -741,6 +741,7 @@ noinst_LTLIBRARIES += \
|
||||
|
||||
libsystemd_shared_la_SOURCES = \
|
||||
src/shared/linux/auto_dev-ioctl.h \
|
||||
+ src/shared/linux/fanotify.h \
|
||||
src/shared/ioprio.h \
|
||||
src/shared/missing.h \
|
||||
src/shared/initreq.h \
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e63d3dc809..c2f8f7a548 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -306,6 +306,7 @@ RT_LIBS="$LIBS"
|
||||
AC_SUBST(RT_LIBS)
|
||||
LIBS="$save_LIBS"
|
||||
|
||||
+AC_CHECK_FUNCS([fanotify_init fanotify_mark])
|
||||
AC_CHECK_FUNCS([memfd_create])
|
||||
AC_CHECK_FUNCS([__secure_getenv secure_getenv])
|
||||
AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, LO_FLAGS_PARTSCAN],
|
||||
diff --git a/src/shared/linux/fanotify.h b/src/shared/linux/fanotify.h
|
||||
new file mode 100644
|
||||
index 0000000000..63531a6b4d
|
||||
--- /dev/null
|
||||
+++ b/src/shared/linux/fanotify.h
|
||||
@@ -0,0 +1,98 @@
|
||||
+#ifndef _LINUX_FANOTIFY_H
|
||||
+#define _LINUX_FANOTIFY_H
|
||||
+
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
+/* the following events that user-space can register for */
|
||||
+#define FAN_ACCESS 0x00000001 /* File was accessed */
|
||||
+#define FAN_MODIFY 0x00000002 /* File was modified */
|
||||
+#define FAN_CLOSE_WRITE 0x00000008 /* Unwrittable file closed */
|
||||
+#define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */
|
||||
+#define FAN_OPEN 0x00000020 /* File was opened */
|
||||
+
|
||||
+#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
|
||||
+
|
||||
+/* FIXME currently Q's have no limit.... */
|
||||
+#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
|
||||
+
|
||||
+#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
|
||||
+#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
|
||||
+
|
||||
+/* helper events */
|
||||
+#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
|
||||
+
|
||||
+/* flags used for fanotify_init() */
|
||||
+#define FAN_CLOEXEC 0x00000001
|
||||
+#define FAN_NONBLOCK 0x00000002
|
||||
+
|
||||
+#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK)
|
||||
+
|
||||
+/* flags used for fanotify_modify_mark() */
|
||||
+#define FAN_MARK_ADD 0x00000001
|
||||
+#define FAN_MARK_REMOVE 0x00000002
|
||||
+#define FAN_MARK_DONT_FOLLOW 0x00000004
|
||||
+#define FAN_MARK_ONLYDIR 0x00000008
|
||||
+#define FAN_MARK_MOUNT 0x00000010
|
||||
+#define FAN_MARK_IGNORED_MASK 0x00000020
|
||||
+#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
|
||||
+#define FAN_MARK_FLUSH 0x00000080
|
||||
+
|
||||
+#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
|
||||
+ FAN_MARK_REMOVE |\
|
||||
+ FAN_MARK_DONT_FOLLOW |\
|
||||
+ FAN_MARK_ONLYDIR |\
|
||||
+ FAN_MARK_MOUNT |\
|
||||
+ FAN_MARK_IGNORED_MASK |\
|
||||
+ FAN_MARK_IGNORED_SURV_MODIFY)
|
||||
+
|
||||
+/*
|
||||
+ * All of the events - we build the list by hand so that we can add flags in
|
||||
+ * the future and not break backward compatibility. Apps will get only the
|
||||
+ * events that they originally wanted. Be sure to add new events here!
|
||||
+ */
|
||||
+#define FAN_ALL_EVENTS (FAN_ACCESS |\
|
||||
+ FAN_MODIFY |\
|
||||
+ FAN_CLOSE |\
|
||||
+ FAN_OPEN)
|
||||
+
|
||||
+/*
|
||||
+ * All events which require a permission response from userspace
|
||||
+ */
|
||||
+#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
|
||||
+ FAN_ACCESS_PERM)
|
||||
+
|
||||
+#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\
|
||||
+ FAN_ALL_PERM_EVENTS |\
|
||||
+ FAN_Q_OVERFLOW)
|
||||
+
|
||||
+#define FANOTIFY_METADATA_VERSION 2
|
||||
+
|
||||
+struct fanotify_event_metadata {
|
||||
+ __u32 event_len;
|
||||
+ __u32 vers;
|
||||
+ __u64 mask;
|
||||
+ __s32 fd;
|
||||
+ __s32 pid;
|
||||
+} __attribute__ ((packed));
|
||||
+
|
||||
+struct fanotify_response {
|
||||
+ __s32 fd;
|
||||
+ __u32 response;
|
||||
+} __attribute__ ((packed));
|
||||
+
|
||||
+/* Legit userspace responses to a _PERM event */
|
||||
+#define FAN_ALLOW 0x01
|
||||
+#define FAN_DENY 0x02
|
||||
+
|
||||
+/* Helper functions to deal with fanotify_event_metadata buffers */
|
||||
+#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
|
||||
+
|
||||
+#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \
|
||||
+ (struct fanotify_event_metadata*)(((char *)(meta)) + \
|
||||
+ (meta)->event_len))
|
||||
+
|
||||
+#define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \
|
||||
+ (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \
|
||||
+ (long)(meta)->event_len <= (long)(len))
|
||||
+
|
||||
+#endif /* _LINUX_FANOTIFY_H */
|
||||
diff --git a/src/shared/missing.h b/src/shared/missing.h
|
||||
index bb4f8f23a8..c98d0273a3 100644
|
||||
--- a/src/shared/missing.h
|
||||
+++ b/src/shared/missing.h
|
||||
@@ -116,6 +116,12 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
+# ifndef __NR_fanotify_init
|
||||
+# define __NR_fanotify_init 300
|
||||
+# endif
|
||||
+# ifndef __NR_fanotify_mark
|
||||
+# define __NR_fanotify_mark 301
|
||||
+# endif
|
||||
# ifndef __NR_memfd_create
|
||||
# define __NR_memfd_create 319
|
||||
# endif
|
||||
@@ -124,16 +130,69 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
|
||||
# define __NR_memfd_create 385
|
||||
# endif
|
||||
#elif defined _MIPS_SIM
|
||||
+# if _MIPS_SIM == _MIPS_SIM_ABI32
|
||||
+# ifndef __NR_fanotify_init
|
||||
+# define __NR_fanotify_init 4336
|
||||
+# endif
|
||||
+# ifndef __NR_fanotify_mark
|
||||
+# define __NR_fanotify_mark 4337
|
||||
+# endif
|
||||
+# elif _MIPS_SIM == _MIPS_SIM_NABI32
|
||||
+# ifndef __NR_fanotify_init
|
||||
+# define __NR_fanotify_init 6300
|
||||
+# endif
|
||||
+# ifndef __NR_fanotify_mark
|
||||
+# define __NR_fanotify_mark 6301
|
||||
+# endif
|
||||
+# elif _MIPS_SIM == _MIPS_SIM_ABI64
|
||||
+# ifndef __NR_fanotify_init
|
||||
+# define __NR_fanotify_init 5295
|
||||
+# endif
|
||||
+# ifndef __NR_fanotify_mark
|
||||
+# define __NR_fanotify_mark 5296
|
||||
+# endif
|
||||
+# endif
|
||||
# ifndef __NR_memfd_create
|
||||
# warning "__NR_memfd_create not yet defined for MIPS"
|
||||
# define __NR_memfd_create 0xffffffff
|
||||
# endif
|
||||
#else
|
||||
+# ifndef __NR_fanotify_init
|
||||
+# define __NR_fanotify_init 338
|
||||
+# endif
|
||||
+# ifndef __NR_fanotify_mark
|
||||
+# define __NR_fanotify_mark 339
|
||||
+# endif
|
||||
# ifndef __NR_memfd_create
|
||||
# define __NR_memfd_create 356
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+#ifndef HAVE_FANOTIFY_INIT
|
||||
+static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags) {
|
||||
+ return syscall(__NR_fanotify_init, flags, event_f_flags);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+#ifndef HAVE_FANOTIFY_MARK
|
||||
+static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t mask,
|
||||
+ int dfd, const char *pathname) {
|
||||
+#if defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI32 || defined __powerpc__ && !defined __powerpc64__ \
|
||||
+ || defined __arm__ && !defined __aarch64__
|
||||
+ union {
|
||||
+ uint64_t _64;
|
||||
+ uint32_t _32[2];
|
||||
+ } _mask;
|
||||
+ _mask._64 = mask;
|
||||
+
|
||||
+ return syscall(__NR_fanotify_mark, fanotify_fd, flags,
|
||||
+ _mask._32[0], _mask._32[1], dfd, pathname);
|
||||
+#else
|
||||
+ return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, pathname);
|
||||
+#endif
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
#ifndef HAVE_MEMFD_CREATE
|
||||
static inline int memfd_create(const char *name, unsigned int flags) {
|
||||
return syscall(__NR_memfd_create, name, flags);
|
|
@ -1,51 +0,0 @@
|
|||
From 7a4ab10135c2b8fdeedb53c0585c67a0d6448ce6 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Sekletar <msekleta@redhat.com>
|
||||
Date: Tue, 8 Jul 2014 17:42:23 +0200
|
||||
Subject: [PATCH] units: make ExecStopPost action part of ExecStart
|
||||
|
||||
Currently after exiting rescue shell we isolate default target. User
|
||||
might want to isolate to some other target than default one. However
|
||||
issuing systemctl isolate command to desired target would bring system
|
||||
to default target as a consequence of running ExecStopPost action.
|
||||
|
||||
Having common ancestor for rescue shell and possible followup systemctl
|
||||
default command should fix this. If user exits rescue shell we will
|
||||
proceed with isolating default target, otherwise, on manual isolate,
|
||||
parent shell process is terminated and we don't isolate default target,
|
||||
but target chosen by user.
|
||||
|
||||
Suggested-by: Michal Schmidt <mschmidt@redhat.com>
|
||||
(cherry picked from commit d3381512282f2ca1c7669f77fb736a90fdce6982)
|
||||
---
|
||||
units/emergency.service.in | 3 +--
|
||||
units/rescue.service.m4.in | 3 +--
|
||||
2 files changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/units/emergency.service.in b/units/emergency.service.in
|
||||
index 94c090f654..91fc1bbf51 100644
|
||||
--- a/units/emergency.service.in
|
||||
+++ b/units/emergency.service.in
|
||||
@@ -17,8 +17,7 @@ Environment=HOME=/root
|
||||
WorkingDirectory=/root
|
||||
ExecStartPre=-/bin/plymouth quit
|
||||
ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.'
|
||||
-ExecStart=-/sbin/sulogin
|
||||
-ExecStopPost=@SYSTEMCTL@ --fail --no-block default
|
||||
+ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default"
|
||||
Type=idle
|
||||
StandardInput=tty-force
|
||||
StandardOutput=inherit
|
||||
diff --git a/units/rescue.service.m4.in b/units/rescue.service.m4.in
|
||||
index 552ef8981b..ef5436960f 100644
|
||||
--- a/units/rescue.service.m4.in
|
||||
+++ b/units/rescue.service.m4.in
|
||||
@@ -18,8 +18,7 @@ Environment=HOME=/root
|
||||
WorkingDirectory=/root
|
||||
ExecStartPre=-/bin/plymouth quit
|
||||
ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -xb" to view system logs. Type "systemctl reboot" to reboot.'
|
||||
-ExecStart=-/sbin/sulogin
|
||||
-ExecStopPost=-@SYSTEMCTL@ --fail --no-block default
|
||||
+ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default"
|
||||
Type=idle
|
||||
StandardInput=tty-force
|
||||
StandardOutput=inherit
|
|
@ -0,0 +1,26 @@
|
|||
From 67ada875bc0563d97e88f77732359d01ef28a404 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 4 Nov 2014 23:45:15 +0000
|
||||
Subject: [PATCH] udev: Fix parsing of udev.event-timeout kernel parameter.
|
||||
|
||||
(cherry picked from commit f671774f52838d35d78e62ddcb781b5b65b3373f)
|
||||
---
|
||||
src/udev/udevd.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
|
||||
index 2e6c71352f..193702cd28 100644
|
||||
--- a/src/udev/udevd.c
|
||||
+++ b/src/udev/udevd.c
|
||||
@@ -994,9 +994,9 @@ static void kernel_cmdline_options(struct udev *udev) {
|
||||
if (r < 0)
|
||||
log_warning("Invalid udev.exec-delay ignored: %s", opt + 16);
|
||||
} else if (startswith(opt, "udev.event-timeout=")) {
|
||||
- r = safe_atou64(opt + 16, &arg_event_timeout_usec);
|
||||
+ r = safe_atou64(opt + 19, &arg_event_timeout_usec);
|
||||
if (r < 0) {
|
||||
- log_warning("Invalid udev.event-timeout ignored: %s", opt + 16);
|
||||
+ log_warning("Invalid udev.event-timeout ignored: %s", opt + 19);
|
||||
break;
|
||||
}
|
||||
arg_event_timeout_usec *= USEC_PER_SEC;
|
|
@ -1,119 +0,0 @@
|
|||
From 15dbdbd90db21bea19e48194a485bbaaa9501b9b Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 7 Jul 2014 12:04:55 +0200
|
||||
Subject: [PATCH] util: don't consider tabs special in string_has_cc() anymore
|
||||
|
||||
Instead, take a list of exceptions to our usual CC check
|
||||
|
||||
(cherry picked from commit 6294aa76d818e831de4592b41a37e225fd0871f9)
|
||||
---
|
||||
src/hostname/hostnamed.c | 3 +--
|
||||
src/shared/env-util.c | 4 +++-
|
||||
src/shared/fileio.c | 2 +-
|
||||
src/shared/util.c | 19 ++++++++++---------
|
||||
src/shared/util.h | 2 +-
|
||||
5 files changed, 16 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
|
||||
index 8127b688c4..eaae1139fa 100644
|
||||
--- a/src/hostname/hostnamed.c
|
||||
+++ b/src/hostname/hostnamed.c
|
||||
@@ -551,8 +551,7 @@ static int set_machine_info(Context *c, sd_bus *bus, sd_bus_message *m, int prop
|
||||
|
||||
if (prop == PROP_ICON_NAME && !filename_is_safe(name))
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid icon name '%s'", name);
|
||||
- if (prop == PROP_PRETTY_HOSTNAME &&
|
||||
- (string_has_cc(name) || chars_intersect(name, "\t")))
|
||||
+ if (prop == PROP_PRETTY_HOSTNAME && string_has_cc(name, NULL))
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid pretty host name '%s'", name);
|
||||
if (prop == PROP_CHASSIS && !valid_chassis(name))
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid chassis '%s'", name);
|
||||
diff --git a/src/shared/env-util.c b/src/shared/env-util.c
|
||||
index b2e45531ab..20b208f63c 100644
|
||||
--- a/src/shared/env-util.c
|
||||
+++ b/src/shared/env-util.c
|
||||
@@ -78,7 +78,9 @@ bool env_value_is_valid(const char *e) {
|
||||
if (!utf8_is_valid(e))
|
||||
return false;
|
||||
|
||||
- if (string_has_cc(e))
|
||||
+ /* bash allows tabs in environment variables, and so should
|
||||
+ * we */
|
||||
+ if (string_has_cc(e, "\t"))
|
||||
return false;
|
||||
|
||||
/* POSIX says the overall size of the environment block cannot
|
||||
diff --git a/src/shared/fileio.c b/src/shared/fileio.c
|
||||
index fb1c1bcf9f..b1de5908c5 100644
|
||||
--- a/src/shared/fileio.c
|
||||
+++ b/src/shared/fileio.c
|
||||
@@ -738,7 +738,7 @@ static void write_env_var(FILE *f, const char *v) {
|
||||
p++;
|
||||
fwrite(v, 1, p-v, f);
|
||||
|
||||
- if (string_has_cc(p) || chars_intersect(p, WHITESPACE "\'\"\\`$")) {
|
||||
+ if (string_has_cc(p, NULL) || chars_intersect(p, WHITESPACE "\'\"\\`$")) {
|
||||
fputc('\"', f);
|
||||
|
||||
for (; *p; p++) {
|
||||
diff --git a/src/shared/util.c b/src/shared/util.c
|
||||
index d25ee6652f..d223ecf711 100644
|
||||
--- a/src/shared/util.c
|
||||
+++ b/src/shared/util.c
|
||||
@@ -5350,16 +5350,14 @@ bool filename_is_safe(const char *p) {
|
||||
bool string_is_safe(const char *p) {
|
||||
const char *t;
|
||||
|
||||
- assert(p);
|
||||
+ if (!p)
|
||||
+ return false;
|
||||
|
||||
for (t = p; *t; t++) {
|
||||
if (*t > 0 && *t < ' ')
|
||||
return false;
|
||||
|
||||
- if (*t == 127)
|
||||
- return false;
|
||||
-
|
||||
- if (strchr("\\\"\'", *t))
|
||||
+ if (strchr("\\\"\'\0x7f", *t))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -5367,16 +5365,19 @@ bool string_is_safe(const char *p) {
|
||||
}
|
||||
|
||||
/**
|
||||
- * Check if a string contains control characters.
|
||||
- * Spaces and tabs are not considered control characters.
|
||||
+ * Check if a string contains control characters. If 'ok' is non-NULL
|
||||
+ * it may be a string containing additional CCs to be considered OK.
|
||||
*/
|
||||
-bool string_has_cc(const char *p) {
|
||||
+bool string_has_cc(const char *p, const char *ok) {
|
||||
const char *t;
|
||||
|
||||
assert(p);
|
||||
|
||||
for (t = p; *t; t++) {
|
||||
- if (*t > 0 && *t < ' ' && *t != '\t')
|
||||
+ if (ok && strchr(ok, *t))
|
||||
+ return false;
|
||||
+
|
||||
+ if (*t > 0 && *t < ' ')
|
||||
return true;
|
||||
|
||||
if (*t == 127)
|
||||
diff --git a/src/shared/util.h b/src/shared/util.h
|
||||
index e23069c016..7124e51d90 100644
|
||||
--- a/src/shared/util.h
|
||||
+++ b/src/shared/util.h
|
||||
@@ -692,7 +692,7 @@ _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_
|
||||
bool filename_is_safe(const char *p) _pure_;
|
||||
bool path_is_safe(const char *p) _pure_;
|
||||
bool string_is_safe(const char *p) _pure_;
|
||||
-bool string_has_cc(const char *p) _pure_;
|
||||
+bool string_has_cc(const char *p, const char *ok) _pure_;
|
||||
|
||||
/**
|
||||
* Check if a string contains any glob patterns.
|
|
@ -0,0 +1,48 @@
|
|||
From dc2bcafb431344448b93f92a1f6749c9afb30398 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Guthrie <colin@mageia.org>
|
||||
Date: Sun, 2 Nov 2014 13:33:16 +0000
|
||||
Subject: [PATCH] manager: Ensure user's systemd runtime directory exists.
|
||||
|
||||
This mirrors code in dbus.c when creating the private socket and
|
||||
avoids error messages like:
|
||||
|
||||
systemd[1353]: bind(/run/user/603/systemd/notify) failed: No such file or directory
|
||||
systemd[1353]: Failed to fully start up daemon: No such file or directory
|
||||
|
||||
(cherry picked from commit 0c3f25e0c1f028d4da9cc5253abf0322230e6835)
|
||||
---
|
||||
src/core/manager.c | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/core/manager.c b/src/core/manager.c
|
||||
index ff29ae1d9d..47e23ba80e 100644
|
||||
--- a/src/core/manager.c
|
||||
+++ b/src/core/manager.c
|
||||
@@ -662,9 +662,11 @@ static int manager_setup_notify(Manager *m) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
- if (m->running_as == SYSTEMD_SYSTEM)
|
||||
+ if (m->running_as == SYSTEMD_SYSTEM) {
|
||||
m->notify_socket = strdup("/run/systemd/notify");
|
||||
- else {
|
||||
+ if (!m->notify_socket)
|
||||
+ return log_oom();
|
||||
+ } else {
|
||||
const char *e;
|
||||
|
||||
e = getenv("XDG_RUNTIME_DIR");
|
||||
@@ -674,9 +676,11 @@ static int manager_setup_notify(Manager *m) {
|
||||
}
|
||||
|
||||
m->notify_socket = strappend(e, "/systemd/notify");
|
||||
+ if (!m->notify_socket)
|
||||
+ return log_oom();
|
||||
+
|
||||
+ mkdir_parents_label(m->notify_socket, 0755);
|
||||
}
|
||||
- if (!m->notify_socket)
|
||||
- return log_oom();
|
||||
|
||||
strncpy(sa.un.sun_path, m->notify_socket, sizeof(sa.un.sun_path)-1);
|
||||
r = bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path));
|
|
@ -1,56 +0,0 @@
|
|||
From 10242a06bf0b1cd3bde58cada79c8a1aae5d8caa Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Fri, 11 Jul 2014 09:21:15 -0400
|
||||
Subject: [PATCH] util: fix has cc check and add test
|
||||
|
||||
---
|
||||
src/shared/util.c | 2 +-
|
||||
src/test/test-util.c | 15 +++++++++++++++
|
||||
2 files changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/shared/util.c b/src/shared/util.c
|
||||
index d223ecf711..03a5860a62 100644
|
||||
--- a/src/shared/util.c
|
||||
+++ b/src/shared/util.c
|
||||
@@ -5375,7 +5375,7 @@ bool string_has_cc(const char *p, const char *ok) {
|
||||
|
||||
for (t = p; *t; t++) {
|
||||
if (ok && strchr(ok, *t))
|
||||
- return false;
|
||||
+ continue;
|
||||
|
||||
if (*t > 0 && *t < ' ')
|
||||
return true;
|
||||
diff --git a/src/test/test-util.c b/src/test/test-util.c
|
||||
index 44921bd156..ed91a67d10 100644
|
||||
--- a/src/test/test-util.c
|
||||
+++ b/src/test/test-util.c
|
||||
@@ -731,6 +731,20 @@ static void test_filename_is_safe(void) {
|
||||
assert_se(filename_is_safe("o.o"));
|
||||
}
|
||||
|
||||
+static void test_string_has_cc(void) {
|
||||
+ assert_se(string_has_cc("abc\1", NULL));
|
||||
+ assert_se(string_has_cc("abc\x7f", NULL));
|
||||
+ assert_se(string_has_cc("abc\x7f", NULL));
|
||||
+ assert_se(string_has_cc("abc\t\x7f", "\t"));
|
||||
+ assert_se(string_has_cc("abc\t\x7f", "\t"));
|
||||
+ assert_se(string_has_cc("\x7f", "\t"));
|
||||
+ assert_se(string_has_cc("\x7f", "\t\a"));
|
||||
+
|
||||
+ assert_se(!string_has_cc("abc\t\t", "\t"));
|
||||
+ assert_se(!string_has_cc("abc\t\t\a", "\t\a"));
|
||||
+ assert_se(!string_has_cc("a\ab\tc", "\t\a"));
|
||||
+}
|
||||
+
|
||||
static void test_ascii_strlower(void) {
|
||||
char a[] = "AabBcC Jk Ii Od LKJJJ kkd LK";
|
||||
assert_se(streq(ascii_strlower(a), "aabbcc jk ii od lkjjj kkd lk"));
|
||||
@@ -937,6 +951,7 @@ int main(int argc, char *argv[]) {
|
||||
test_log2i();
|
||||
test_foreach_string();
|
||||
test_filename_is_safe();
|
||||
+ test_string_has_cc();
|
||||
test_ascii_strlower();
|
||||
test_files_same();
|
||||
test_is_valid_documentation_url();
|
|
@ -1,52 +0,0 @@
|
|||
From e17ff7ab5115b80f0d2bd4989cd31889bd54fbb1 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Wed, 9 Jul 2014 19:20:58 +0200
|
||||
Subject: [PATCH] sysusers: don't allow user names longer than UT_NAMESIZE
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
As pointed out by Miloslav Trmač it might be a good idea to make sure
|
||||
that usernames stay with in the utmp-defined limits.
|
||||
|
||||
(cherry picked from commit 932ad62b84165b0acf690ea34c4b8083657ae244)
|
||||
---
|
||||
man/sysusers.d.xml | 2 +-
|
||||
src/sysusers/sysusers.c | 4 ++++
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/man/sysusers.d.xml b/man/sysusers.d.xml
|
||||
index 549b3f6351..40f8715bc0 100644
|
||||
--- a/man/sysusers.d.xml
|
||||
+++ b/man/sysusers.d.xml
|
||||
@@ -142,7 +142,7 @@ m authd input</programlisting>
|
||||
<title>Name</title>
|
||||
|
||||
<para>The name field specifies the user or
|
||||
- group name. It should be be shorter than 256
|
||||
+ group name. It should be be shorter than 31
|
||||
characters and avoid any non-ASCII characters,
|
||||
and not begin with a numeric character. It is
|
||||
strongly recommended to pick user and group
|
||||
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
|
||||
index c0af69300a..f3ba8cf7b3 100644
|
||||
--- a/src/sysusers/sysusers.c
|
||||
+++ b/src/sysusers/sysusers.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <grp.h>
|
||||
#include <shadow.h>
|
||||
#include <getopt.h>
|
||||
+#include <utmp.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "hashmap.h"
|
||||
@@ -1095,6 +1096,9 @@ static bool valid_user_group_name(const char *u) {
|
||||
if ((size_t) (i-u) > (size_t) sz)
|
||||
return false;
|
||||
|
||||
+ if ((size_t) (i-u) > UT_NAMESIZE - 1)
|
||||
+ return false;
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
From c4b4b03e153f8449480977535eb70465b4320b12 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Guthrie <colin@mageia.org>
|
||||
Date: Wed, 5 Nov 2014 15:29:41 +0000
|
||||
Subject: [PATCH] udev hwdb: Change error message regarding missing hwdb.bin
|
||||
back to debug.
|
||||
|
||||
When used in an initramfs, it's expected that the hwdb.bin file is
|
||||
not present (it makes for a very large initramfs otherwise).
|
||||
|
||||
While it's nice to tell the user about this, as it's not strictly
|
||||
speaking an error we really shouldn't be so forceful in our
|
||||
reporting.
|
||||
|
||||
(cherry picked from commit 8232e39e7cf32071e11b3b04839e6c98fbc81d0f)
|
||||
---
|
||||
src/libudev/libudev-hwdb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c
|
||||
index a1cfc0bd5a..0716072d9a 100644
|
||||
--- a/src/libudev/libudev-hwdb.c
|
||||
+++ b/src/libudev/libudev-hwdb.c
|
||||
@@ -296,7 +296,7 @@ _public_ struct udev_hwdb *udev_hwdb_new(struct udev *udev) {
|
||||
}
|
||||
|
||||
if (!hwdb->f) {
|
||||
- udev_err(udev, "hwdb.bin does not exist, please run udevadm hwdb --update");
|
||||
+ udev_dbg(udev, "hwdb.bin does not exist, please run udevadm hwdb --update");
|
||||
udev_hwdb_unref(hwdb);
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
From 4ce940e9a436ef9d19bd52bd9c2f7ac24d1c842c Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 6 Nov 2014 15:20:29 +0100
|
||||
Subject: [PATCH] systemctl: when invokes as "reboot -f", sync()
|
||||
|
||||
We do this in the clean shutdown path in shutdown.c, hence we should do
|
||||
is for "reboot -f", too.
|
||||
|
||||
(cherry picked from commit 4a3ad39957399c4a30fc472a804e72907ecaa4f9)
|
||||
---
|
||||
src/systemctl/systemctl.c | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
||||
index 8481a9b20c..207a5e78dc 100644
|
||||
--- a/src/systemctl/systemctl.c
|
||||
+++ b/src/systemctl/systemctl.c
|
||||
@@ -6948,8 +6948,13 @@ done:
|
||||
|
||||
static int halt_now(enum action a) {
|
||||
|
||||
-/* Make sure C-A-D is handled by the kernel from this
|
||||
- * point on... */
|
||||
+ /* The kernel will automaticall flush ATA disks and suchlike
|
||||
+ * on reboot(), but the file systems need to be synce'd
|
||||
+ * explicitly in advance. */
|
||||
+ sync();
|
||||
+
|
||||
+ /* Make sure C-A-D is handled by the kernel from this point
|
||||
+ * on... */
|
||||
reboot(RB_ENABLE_CAD);
|
||||
|
||||
switch (a) {
|
|
@ -1,27 +0,0 @@
|
|||
From b374a6f62172bf5352cc1ad825ace44d78430e0c Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Wed, 9 Jul 2014 19:21:42 +0200
|
||||
Subject: [PATCH] sysusers: don't allow control characters in gecos fields
|
||||
|
||||
(cherry picked from commit 38c74dad1c3d605018e61074e0b80f6b9523b1c8)
|
||||
---
|
||||
src/sysusers/sysusers.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
|
||||
index f3ba8cf7b3..16ea0c9c57 100644
|
||||
--- a/src/sysusers/sysusers.c
|
||||
+++ b/src/sysusers/sysusers.c
|
||||
@@ -1107,7 +1107,11 @@ static bool valid_gecos(const char *d) {
|
||||
if (!utf8_is_valid(d))
|
||||
return false;
|
||||
|
||||
- if (strpbrk(d, ":\n"))
|
||||
+ if (string_has_cc(d, NULL))
|
||||
+ return false;
|
||||
+
|
||||
+ /* Colons are used as field separators, and hence not OK */
|
||||
+ if (strchr(d, ':'))
|
||||
return false;
|
||||
|
||||
return true;
|
|
@ -0,0 +1,42 @@
|
|||
From dd5e5ef3392a83525d23aa9a523e9d187fb7faaf Mon Sep 17 00:00:00 2001
|
||||
From: Michal Schmidt <mschmidt@redhat.com>
|
||||
Date: Thu, 6 Nov 2014 16:48:11 +0100
|
||||
Subject: [PATCH] shared: create files even if the SELinux policy has no
|
||||
context for them
|
||||
|
||||
The SELinux policy defines no context for some files. E.g.:
|
||||
$ matchpathcon /run/lock/subsys /dev/mqueue
|
||||
/run/lock/subsys <<none>>
|
||||
/dev/mqueue <<none>>
|
||||
|
||||
We still need to be able to create them.
|
||||
In this case selabel_lookup_raw() returns ENOENT. We should then skip
|
||||
setfscreatecon(), but still return success.
|
||||
It was broken since c34255bdb2 ("label: unify code to make directories,
|
||||
symlinks").
|
||||
|
||||
(cherry picked from commit 2d58aa4692e9fc47911bff5d064ba3e328c35369)
|
||||
---
|
||||
src/shared/selinux-util.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/shared/selinux-util.c b/src/shared/selinux-util.c
|
||||
index 1eddd17d27..6bd3bf1c80 100644
|
||||
--- a/src/shared/selinux-util.c
|
||||
+++ b/src/shared/selinux-util.c
|
||||
@@ -332,9 +332,13 @@ int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
|
||||
r = selabel_lookup_raw(label_hnd, &filecon, newpath, mode);
|
||||
}
|
||||
|
||||
- if (r < 0 && errno != ENOENT)
|
||||
+ /* No context specified by the policy? Proceed without setting it. */
|
||||
+ if (r < 0 && errno == ENOENT)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (r < 0)
|
||||
r = -errno;
|
||||
- else if (r == 0) {
|
||||
+ else {
|
||||
r = setfscreatecon(filecon);
|
||||
if (r < 0) {
|
||||
log_enforcing("Failed to set SELinux security context %s for %s: %m", filecon, path);
|
|
@ -1,122 +0,0 @@
|
|||
From e65cf4e9d68dd4526524b33709bd16afb95f374a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 10 Jul 2014 08:50:32 -0400
|
||||
Subject: [PATCH] sysusers: allow overrides in /etc and /run
|
||||
|
||||
An administrator might want to block a certain sysusers config file from
|
||||
being executed, e.g. to block the creation of a certain user.
|
||||
|
||||
Only a relatively short description is added in the man page, since
|
||||
overrides should be relatively rare.
|
||||
|
||||
(cherry picked from commit 938a560b7608e8906134ed7d717c3f5aa459a760)
|
||||
---
|
||||
man/sysusers.d.xml | 63 ++++++++++++++++++++++++++++++++++---------------
|
||||
src/sysusers/sysusers.c | 2 ++
|
||||
2 files changed, 46 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/man/sysusers.d.xml b/man/sysusers.d.xml
|
||||
index 40f8715bc0..00eb7ec942 100644
|
||||
--- a/man/sysusers.d.xml
|
||||
+++ b/man/sysusers.d.xml
|
||||
@@ -53,32 +53,28 @@
|
||||
<title>Description</title>
|
||||
|
||||
<para><command>systemd-sysusers</command> uses the
|
||||
- files from <filename>/usr/lib/sysusers.d/</filename>
|
||||
+ files from <filename>sysusers.d</filename> directory
|
||||
to create system users and groups at package
|
||||
- installation or boot time. This tool may be used for
|
||||
- allocating system users and groups only, it is not
|
||||
+ installation or boot time. This tool may be used to
|
||||
+ allocate system users and groups only, it is not
|
||||
useful for creating non-system users and groups, as it
|
||||
- accessed <filename>/etc/passwd</filename> and
|
||||
+ accesses <filename>/etc/passwd</filename> and
|
||||
<filename>/etc/group</filename> directly, bypassing
|
||||
- any more complex user database, for example any
|
||||
+ any more complex user databases, for example any
|
||||
database involving NIS or LDAP.</para>
|
||||
-
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
- <title>File Format</title>
|
||||
-
|
||||
- <para>Each file shall be named in the style of
|
||||
- <filename><replaceable>package</replaceable>.conf</filename>.</para>
|
||||
+ <title>Configuration Format</title>
|
||||
|
||||
- <para>All files are sorted by their filename in
|
||||
- lexicographic order, regardless of which of the
|
||||
- directories they reside in. If multiple files specify
|
||||
- the same user or group, the entry in the file with the
|
||||
- lexicographically earliest name will be applied, all
|
||||
- all other conflicting entries will be logged as
|
||||
- errors. Users and groups are
|
||||
- processed in the order they are listed.</para>
|
||||
+ <para>Each configuration file shall be named in the
|
||||
+ style of
|
||||
+ <filename><replaceable>package</replaceable>.conf</filename>
|
||||
+ or
|
||||
+ <filename><replaceable>package</replaceable>-<replaceable>part</replaceable>.conf</filename>.
|
||||
+ The second variant should be used when it is desirable
|
||||
+ to make it easy to override just this part of
|
||||
+ configuration.</para>
|
||||
|
||||
<para>The file format is one line per user or group
|
||||
containing name, ID and GECOS field description:</para>
|
||||
@@ -193,10 +189,39 @@ m authd input</programlisting>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
+ <title>Overriding vendor configuration</title>
|
||||
+
|
||||
+ <para>Note that <command>systemd-sysusers</command>
|
||||
+ will do nothing if the specified users or groups
|
||||
+ already exist, so normally there no reason to override
|
||||
+ <filename>sysusers.d</filename> vendor configuration,
|
||||
+ except to block certain users or groups from being
|
||||
+ created.</para>
|
||||
+
|
||||
+ <para>Files in <filename>/etc/sysusers.d</filename>
|
||||
+ override files with the same name in
|
||||
+ <filename>/usr/lib/sysusers.d</filename> and
|
||||
+ <filename>/run/sysusers.d</filename>. Files in
|
||||
+ <filename>/run/sysusers.d</filename> override files
|
||||
+ with the same name in
|
||||
+ <filename>/usr/lib/sysusers.d</filename>. The scheme is the same as for
|
||||
+ <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
|
||||
+ except for the directory name.</para>
|
||||
+
|
||||
+ <para>If the administrator wants to disable a
|
||||
+ configuration file supplied by the vendor, the
|
||||
+ recommended way is to place a symlink to
|
||||
+ <filename>/dev/null</filename> in
|
||||
+ <filename>/etc/sysusers.d/</filename> bearing the
|
||||
+ same filename.</para>
|
||||
+ </refsect1>
|
||||
+
|
||||
+ <refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
- <citerefentry><refentrytitle>systemd-sysusers</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||
+ <citerefentry><refentrytitle>systemd-sysusers</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
||||
+ <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
|
||||
index 16ea0c9c57..61c9bb5efb 100644
|
||||
--- a/src/sysusers/sysusers.c
|
||||
+++ b/src/sysusers/sysusers.c
|
||||
@@ -62,6 +62,8 @@ typedef struct Item {
|
||||
static char *arg_root = NULL;
|
||||
|
||||
static const char conf_file_dirs[] =
|
||||
+ "/etc/sysusers.d\0"
|
||||
+ "/run/sysusers.d\0"
|
||||
"/usr/local/lib/sysusers.d\0"
|
||||
"/usr/lib/sysusers.d\0"
|
||||
#ifdef HAVE_SPLIT_USR
|
|
@ -1,37 +0,0 @@
|
|||
From 634ddd73f790dd779e97edd1491178897858f7c0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 10 Jul 2014 22:34:43 -0400
|
||||
Subject: [PATCH] man: document x-systemd.device-timeout for crypttab
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=54210
|
||||
(cherry picked from commit dc5cd2b77288dc85c82cb95810cd14caee311e7e)
|
||||
---
|
||||
man/crypttab.xml | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/man/crypttab.xml b/man/crypttab.xml
|
||||
index 9dbf1546b1..d658a6ff20 100644
|
||||
--- a/man/crypttab.xml
|
||||
+++ b/man/crypttab.xml
|
||||
@@ -319,6 +319,21 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
+ <term><option>x-systemd.device-timeout=</option></term>
|
||||
+
|
||||
+ <listitem><para>Specifies how long
|
||||
+ systemd should wait for a device to
|
||||
+ show up before giving up on the
|
||||
+ entry. The argument is a time in
|
||||
+ seconds or explicitly specifified
|
||||
+ units of <literal>s</literal>,
|
||||
+ <literal>min</literal>,
|
||||
+ <literal>h</literal>,
|
||||
+ <literal>ms</literal>.
|
||||
+ </para></listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
<term><option>tmp</option></term>
|
||||
|
||||
<listitem><para>The encrypted block device will
|
|
@ -0,0 +1,67 @@
|
|||
From a59400d10830f01a5eb657d41d992df42cd8952e Mon Sep 17 00:00:00 2001
|
||||
From: Michal Schmidt <mschmidt@redhat.com>
|
||||
Date: Thu, 6 Nov 2014 22:24:13 +0100
|
||||
Subject: [PATCH] shutdown: fix arguments to /run/initramfs/shutdown
|
||||
|
||||
Our initrd interface specifies that the verb is in argv[1].
|
||||
This is where systemd passes it to systemd-shutdown, but getopt
|
||||
permutes argv[]. This confuses dracut's shutdown script:
|
||||
Shutdown called with argument '--log-level'. Rebooting!
|
||||
|
||||
getopt can be convinced to not permute argv[] by having '-' as the first
|
||||
character of optstring. Let's use it. This requires changing the way
|
||||
non-option arguments (in our case, the verb) are processed.
|
||||
|
||||
This fixes a bug where the system would reboot instead of powering off.
|
||||
|
||||
(cherry picked from commit 4b5d8d0f22ae61ceb45a25391354ba53b43ee992)
|
||||
---
|
||||
src/core/shutdown.c | 17 +++++++++++------
|
||||
1 file changed, 11 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
|
||||
index 20cf526ba2..03cfddc543 100644
|
||||
--- a/src/core/shutdown.c
|
||||
+++ b/src/core/shutdown.c
|
||||
@@ -75,7 +75,9 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
assert(argc >= 1);
|
||||
assert(argv);
|
||||
|
||||
- while ((c = getopt_long(argc, argv, "", options, NULL)) >= 0)
|
||||
+ /* "-" prevents getopt from permuting argv[] and moving the verb away
|
||||
+ * from argv[1]. Our interface to initrd promises it'll be there. */
|
||||
+ while ((c = getopt_long(argc, argv, "-", options, NULL)) >= 0)
|
||||
switch (c) {
|
||||
|
||||
case ARG_LOG_LEVEL:
|
||||
@@ -113,6 +115,13 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
break;
|
||||
|
||||
+ case '\001':
|
||||
+ if (!arg_verb)
|
||||
+ arg_verb = optarg;
|
||||
+ else
|
||||
+ log_error("Excess arguments, ignoring");
|
||||
+ break;
|
||||
+
|
||||
case '?':
|
||||
return -EINVAL;
|
||||
|
||||
@@ -120,15 +129,11 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
assert_not_reached("Unhandled option code.");
|
||||
}
|
||||
|
||||
- if (optind >= argc) {
|
||||
+ if (!arg_verb) {
|
||||
log_error("Verb argument missing.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- arg_verb = argv[optind];
|
||||
-
|
||||
- if (optind + 1 < argc)
|
||||
- log_error("Excess arguments, ignoring");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
From cdb7cc6960a3fcfe91129d4eaf73a0809d26611b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Fri, 16 Jan 2015 00:55:53 -0500
|
||||
Subject: [PATCH] Revert "build-sys: bump version number in preparation for
|
||||
release"
|
||||
|
||||
This reverts commit 9a4f7f5ef7a0895962d5c9b9e0bc8579fd792aef.
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c2f8f7a548..cf98c418ca 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -20,7 +20,7 @@
|
||||
AC_PREREQ([2.64])
|
||||
|
||||
AC_INIT([systemd],
|
||||
- [217],
|
||||
+ [216],
|
||||
[http://bugs.freedesktop.org/enter_bug.cgi?product=systemd],
|
||||
[systemd],
|
||||
[http://www.freedesktop.org/wiki/Software/systemd])
|
|
@ -1,224 +0,0 @@
|
|||
From ba838f7f9b3de1777f3528c0fe211f9bedbd2a8b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Fri, 11 Jul 2014 08:25:20 -0400
|
||||
Subject: [PATCH] shell-completion,man: beef up chassis completions and
|
||||
description
|
||||
|
||||
Parameters to hostnamectl command are not optional and should not be marked
|
||||
as such in the man page.
|
||||
|
||||
(cherry picked from commit 1ed774956406941d4812a3fb4493d2915f130f12)
|
||||
---
|
||||
man/hostnamectl.xml | 73 +++++++++++++++++++++------------------
|
||||
shell-completion/bash/hostnamectl | 3 ++
|
||||
shell-completion/zsh/_hostnamectl | 32 +++++++++++++++--
|
||||
shell-completion/zsh/_localectl | 4 +--
|
||||
4 files changed, 75 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/man/hostnamectl.xml b/man/hostnamectl.xml
|
||||
index 001bfced03..13e5bd57f2 100644
|
||||
--- a/man/hostnamectl.xml
|
||||
+++ b/man/hostnamectl.xml
|
||||
@@ -141,13 +141,14 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
- <term><command>set-hostname [NAME]</command></term>
|
||||
+ <term><command>set-hostname <replaceable>NAME</replaceable></command></term>
|
||||
|
||||
<listitem><para>Set the system
|
||||
- hostname. By default, this will alter
|
||||
- the pretty, the static, and the
|
||||
- transient hostname alike; however, if
|
||||
- one or more of
|
||||
+ hostname to
|
||||
+ <replaceable>NAME</replaceable>. By
|
||||
+ default, this will alter the pretty,
|
||||
+ the static, and the transient hostname
|
||||
+ alike; however, if one or more of
|
||||
<option>--static</option>,
|
||||
<option>--transient</option>,
|
||||
<option>--pretty</option> are used,
|
||||
@@ -168,55 +169,61 @@
|
||||
the hostname string is not done if
|
||||
only the transient and/or static host
|
||||
names are set, and the pretty host
|
||||
- name is left untouched. Pass the empty
|
||||
- string <literal></literal> as the
|
||||
- hostname to reset the selected
|
||||
- hostnames to their default (usually
|
||||
+ name is left untouched.</para>
|
||||
+
|
||||
+ <para>Pass the empty string
|
||||
+ <literal></literal> as the hostname to
|
||||
+ reset the selected hostnames to their
|
||||
+ default (usually
|
||||
<literal>localhost</literal>).</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
- <term><command>set-icon-name [NAME]</command></term>
|
||||
+ <term><command>set-icon-name <replaceable>NAME</replaceable></command></term>
|
||||
|
||||
<listitem><para>Set the system icon
|
||||
- name. The icon name is used by some
|
||||
- graphical applications to visualize
|
||||
- this host. The icon name should follow
|
||||
- the <ulink
|
||||
+ name to
|
||||
+ <replaceable>NAME</replaceable>. The
|
||||
+ icon name is used by some graphical
|
||||
+ applications to visualize this host.
|
||||
+ The icon name should follow the <ulink
|
||||
url="http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">Icon
|
||||
- Naming Specification</ulink>. Pass an
|
||||
- empty string to this operation to
|
||||
- reset the icon name to the default
|
||||
- value, which is determined from chassis
|
||||
- type (see below) and possibly other
|
||||
+ Naming Specification</ulink>.</para>
|
||||
+
|
||||
+ <para>Pass an empty string to reset
|
||||
+ the icon name to the default value,
|
||||
+ which is determined from chassis type
|
||||
+ (see below) and possibly other
|
||||
parameters.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
- <term><command>set-chassis [TYPE]</command></term>
|
||||
+ <term><command>set-chassis <replaceable>TYPE</replaceable></command></term>
|
||||
|
||||
- <listitem><para>Set the chassis
|
||||
- type. The chassis type is used by some
|
||||
+ <listitem><para>Set the chassis type
|
||||
+ to <replaceable>TYPE</replaceable>.
|
||||
+ The chassis type is used by some
|
||||
graphical applications to visualize
|
||||
- the host or alter user
|
||||
- interaction. Currently, the following
|
||||
- chassis types are defined:
|
||||
+ the host or alter user interaction.
|
||||
+ Currently, the following chassis types
|
||||
+ are defined:
|
||||
<literal>desktop</literal>,
|
||||
<literal>laptop</literal>,
|
||||
<literal>server</literal>,
|
||||
<literal>tablet</literal>,
|
||||
- <literal>handset</literal>,
|
||||
- <literal>watch</literal>, as well as
|
||||
+ <literal>handset</literal>,
|
||||
+ <literal>watch</literal>, as well as
|
||||
the special chassis types
|
||||
<literal>vm</literal> and
|
||||
<literal>container</literal> for
|
||||
virtualized systems that lack an
|
||||
- immediate physical chassis. Pass an
|
||||
- empty string to this operation to
|
||||
- reset the chassis type to the default
|
||||
- value which is determined from the
|
||||
- firmware and possibly other
|
||||
- parameters.</para></listitem>
|
||||
+ immediate physical chassis.</para>
|
||||
+
|
||||
+ <para>Pass an empty string to reset
|
||||
+ the chassis type to the default value
|
||||
+ which is determined from the firmware
|
||||
+ and possibly other parameters.</para>
|
||||
+ </listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
diff --git a/shell-completion/bash/hostnamectl b/shell-completion/bash/hostnamectl
|
||||
index 9c75da9e7f..22f8f06b69 100644
|
||||
--- a/shell-completion/bash/hostnamectl
|
||||
+++ b/shell-completion/bash/hostnamectl
|
||||
@@ -39,6 +39,7 @@ _hostnamectl() {
|
||||
[STANDALONE]='status'
|
||||
[ICONS]='set-icon-name'
|
||||
[NAME]='set-hostname'
|
||||
+ [CHASSIS]='set-chassis'
|
||||
)
|
||||
|
||||
for ((i=0; i < COMP_CWORD; i++)); do
|
||||
@@ -50,6 +51,8 @@ _hostnamectl() {
|
||||
|
||||
if [[ -z $verb ]]; then
|
||||
comps=${VERBS[*]}
|
||||
+ elif __contains_word "$verb" ${VERBS[CHASSIS]}; then
|
||||
+ comps='desktop laptop server tablet handset watch vm container'
|
||||
elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[ICONS]} ${VERBS[NAME]}; then
|
||||
comps=''
|
||||
fi
|
||||
diff --git a/shell-completion/zsh/_hostnamectl b/shell-completion/zsh/_hostnamectl
|
||||
index 7effa0489e..be8687609e 100644
|
||||
--- a/shell-completion/zsh/_hostnamectl
|
||||
+++ b/shell-completion/zsh/_hostnamectl
|
||||
@@ -1,5 +1,30 @@
|
||||
#compdef hostnamectl
|
||||
|
||||
+_hostnamectl_set-hostname() {
|
||||
+ if (( CURRENT <= 3 )); then
|
||||
+ _message "new hostname"
|
||||
+ else
|
||||
+ _message "no more options"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+_hostnamectl_set-icon-name() {
|
||||
+ if (( CURRENT <= 3 )); then
|
||||
+ _message "new icon name"
|
||||
+ else
|
||||
+ _message "no more options"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+_hostnamectl_set-chassis() {
|
||||
+ if (( CURRENT <= 3 )); then
|
||||
+ _chassis=( desktop laptop server tablet handset watch vm container )
|
||||
+ _describe chassis _chassis
|
||||
+ else
|
||||
+ _message "no more options"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
_hostnamectl_command() {
|
||||
local -a _hostnamectl_cmds
|
||||
_hostnamectl_cmds=(
|
||||
@@ -14,8 +39,11 @@ _hostnamectl_command() {
|
||||
local curcontext="$curcontext"
|
||||
cmd="${${_hostnamectl_cmds[(r)$words[1]:*]%%:*}}"
|
||||
if (( $#cmd )); then
|
||||
- [[ $cmd == status ]] && msg="no options" || msg="options for $cmd"
|
||||
- _message "$msg"
|
||||
+ if [[ $cmd == status ]]; then
|
||||
+ _message "no options"
|
||||
+ else
|
||||
+ _hostnamectl_$cmd
|
||||
+ fi
|
||||
else
|
||||
_message "unknown hostnamectl command: $words[1]"
|
||||
fi
|
||||
diff --git a/shell-completion/zsh/_localectl b/shell-completion/zsh/_localectl
|
||||
index 87432da1dc..d8af4d1863 100644
|
||||
--- a/shell-completion/zsh/_localectl
|
||||
+++ b/shell-completion/zsh/_localectl
|
||||
@@ -22,8 +22,8 @@ _localectl_set-locale() {
|
||||
|
||||
_localectl_set-keymap() {
|
||||
local -a _keymaps
|
||||
- _keymaps=( ${(f)"$(_call_program locales "$service" list-keymaps)"} )
|
||||
if (( CURRENT <= 3 )); then
|
||||
+ _keymaps=( ${(f)"$(_call_program locales "$service" list-keymaps)"} )
|
||||
_describe keymaps _keymaps
|
||||
else
|
||||
_message "no more options"
|
||||
@@ -77,7 +77,7 @@ _localectl_command() {
|
||||
if (( $+functions[_localectl_$cmd] )); then
|
||||
_localectl_$cmd
|
||||
else
|
||||
- _message "no more options"
|
||||
+ _message "unknown localectl command: $words[1]"
|
||||
fi
|
||||
fi
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
From 5c10861b9ec841727723b31b9bb21fd3f7e9f985 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Sun, 2 Nov 2014 19:08:06 -0500
|
||||
Subject: [PATCH] Accept StartTimeout* options for compatibility
|
||||
|
||||
Assignments of 0/none are ignored, all others are warned about.
|
||||
---
|
||||
src/core/main.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/core/main.c b/src/core/main.c
|
||||
index d48604e673..a9ca34d8cb 100644
|
||||
--- a/src/core/main.c
|
||||
+++ b/src/core/main.c
|
||||
@@ -623,6 +623,9 @@ static int config_parse_join_controllers(const char *unit,
|
||||
}
|
||||
|
||||
static int parse_config_file(void) {
|
||||
+ usec_t start_timeout_usec = 0;
|
||||
+ FailureAction start_timeout_action = FAILURE_ACTION_NONE;
|
||||
+ char *start_timeout_reboot_arg = NULL;
|
||||
|
||||
const ConfigTableItem items[] = {
|
||||
{ "Manager", "LogLevel", config_parse_level2, 0, NULL },
|
||||
@@ -670,6 +673,9 @@ static int parse_config_file(void) {
|
||||
{ "Manager", "DefaultCPUAccounting", config_parse_bool, 0, &arg_default_cpu_accounting },
|
||||
{ "Manager", "DefaultBlockIOAccounting", config_parse_bool, 0, &arg_default_blockio_accounting },
|
||||
{ "Manager", "DefaultMemoryAccounting", config_parse_bool, 0, &arg_default_memory_accounting },
|
||||
+ { "Manager", "StartTimeoutSec", config_parse_sec, 0, &start_timeout_usec },
|
||||
+ { "Manager", "StartTimeoutAction", config_parse_failure_action, 0, &start_timeout_action },
|
||||
+ { "Manager", "StartTimeoutRebootArgument",config_parse_string, 0, &start_timeout_reboot_arg },
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -681,6 +687,10 @@ static int parse_config_file(void) {
|
||||
config_item_table_lookup, items,
|
||||
false, false, true, NULL);
|
||||
|
||||
+ if (start_timeout_usec != 0 || start_timeout_action != FAILURE_ACTION_NONE)
|
||||
+ log_warning("StartTimeoutSec, StartTimeoutAction, StartTimeoutRebootArgument settings have\n"
|
||||
+ "been replaced by JobTimeoutSec, JobTimeoutAction, JobTimeoutReboot, ignoring.");
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
From 33def81ef9cbfd7827e5239c1389c571db600f98 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Gilbert <floppym@gentoo.org>
|
||||
Date: Fri, 4 Jul 2014 14:43:14 -0400
|
||||
Subject: [PATCH] Revert "build-sys: include PolicyKit files as part of
|
||||
distribution"
|
||||
|
||||
This reverts commit 0c26bfc3d21fdb3963f1248c237e2f1a33b5566d.
|
||||
|
||||
src/core/org.freedesktop.systemd1.policy.in.in depends on values which
|
||||
are specified at configure time, so we cannot ship the corresponding
|
||||
policy file in the tarball.
|
||||
|
||||
Since we need to regenerate one policy file, we might as well generate
|
||||
them all.
|
||||
|
||||
(cherry picked from commit 3ce142490907d31c33ac03d72554f92459192f92)
|
||||
---
|
||||
Makefile.am | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 7210ab70be..9525e748cf 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -5224,7 +5224,7 @@ units/user/%: units/%.m4
|
||||
$(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
|
||||
|
||||
if ENABLE_POLKIT
|
||||
-dist_polkitpolicy_DATA = \
|
||||
+nodist_polkitpolicy_DATA = \
|
||||
$(polkitpolicy_files) \
|
||||
$(polkitpolicy_in_in_files:.policy.in.in=.policy)
|
||||
endif
|
|
@ -1,27 +0,0 @@
|
|||
From 8147d2f97abd8460541fdb0ba961f3fac5ca86ae Mon Sep 17 00:00:00 2001
|
||||
From: Jon Severinsson <jon@severinsson.net>
|
||||
Date: Fri, 11 Jul 2014 14:37:36 +0200
|
||||
Subject: [PATCH] build-sys: Do not distribute generated emergency.service
|
||||
|
||||
It is already in nodist_systemunit_DATA and if it is
|
||||
shipped, it contains the hardcoded path to systemctl
|
||||
which will cause it to fail to start when
|
||||
rootprefix != prefix and rootbindir != bindir.
|
||||
|
||||
(cherry picked from commit 3864c28549d742427fdf33026e522e9f10a7e4ec)
|
||||
---
|
||||
Makefile.am | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 9525e748cf..025461b497 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -413,7 +413,6 @@ dist_sysctl_DATA = \
|
||||
dist_systemunit_DATA = \
|
||||
units/graphical.target \
|
||||
units/multi-user.target \
|
||||
- units/emergency.service \
|
||||
units/emergency.target \
|
||||
units/sysinit.target \
|
||||
units/basic.target \
|
|
@ -0,0 +1,41 @@
|
|||
From 7879d2f09c71f80b07c2b3e4263a84a2730bb825 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chapman <mike@very.puzzling.org>
|
||||
Date: Thu, 6 Nov 2014 19:47:02 +1100
|
||||
Subject: [PATCH] timer: reenable TIMER_ACTIVE timers when restarted
|
||||
|
||||
A timer configured with OnActiveSec will start its associated unit again
|
||||
if the timer is stopped, then started. However, if the timer unit is
|
||||
restarted -- with "systemctl restart", say -- this does not occur.
|
||||
|
||||
This commit ensures that TIMER_ACTIVE timers are re-enabled whenever the
|
||||
timer is started, even if that's within a restart job.
|
||||
|
||||
(cherry picked from commit 779042e772d2459f7649b34a164902dc456f1bab)
|
||||
---
|
||||
src/core/timer.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/core/timer.c b/src/core/timer.c
|
||||
index a3713e2140..5c4e9f995a 100644
|
||||
--- a/src/core/timer.c
|
||||
+++ b/src/core/timer.c
|
||||
@@ -521,6 +521,7 @@ fail:
|
||||
|
||||
static int timer_start(Unit *u) {
|
||||
Timer *t = TIMER(u);
|
||||
+ TimerValue *v;
|
||||
|
||||
assert(t);
|
||||
assert(t->state == TIMER_DEAD || t->state == TIMER_FAILED);
|
||||
@@ -530,6 +531,11 @@ static int timer_start(Unit *u) {
|
||||
|
||||
t->last_trigger = DUAL_TIMESTAMP_NULL;
|
||||
|
||||
+ /* Reenable all timers that depend on unit activation time */
|
||||
+ LIST_FOREACH(value, v, t->values)
|
||||
+ if (v->base == TIMER_ACTIVE)
|
||||
+ v->disabled = false;
|
||||
+
|
||||
if (t->stamp_path) {
|
||||
struct stat st;
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
From 9b5eabf5fc53bbeb385fdd9e651d96f35faa3dfc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Thu, 6 Nov 2014 21:37:44 -0500
|
||||
Subject: [PATCH] man: update bootup(7) for asynchronous timers.target
|
||||
|
||||
(cherry picked from commit d82ad85cd935f92d7b8357e4649fc6b55db54e1b)
|
||||
---
|
||||
man/bootup.xml | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/man/bootup.xml b/man/bootup.xml
|
||||
index ac6e9f70f7..0854b6c316 100644
|
||||
--- a/man/bootup.xml
|
||||
+++ b/man/bootup.xml
|
||||
@@ -145,7 +145,7 @@
|
||||
v v | v <emphasis>rescue.target</emphasis>
|
||||
timers.target paths.target | sockets.target
|
||||
| | | |
|
||||
- \__________________|_________________ | ___________________/
|
||||
+ v |_________________ | ___________________/
|
||||
\|/
|
||||
v
|
||||
basic.target
|
||||
@@ -174,6 +174,11 @@
|
||||
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>)
|
||||
or by symlinking <filename>default.target</filename>
|
||||
to them.</para>
|
||||
+
|
||||
+ <para><filename>timers.target</filename> is pulled-in
|
||||
+ by <filename>basic.target</filename> asynchronously.
|
||||
+ This allows timers units to depend on services which
|
||||
+ become only available later in boot.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue