new upstream release

This commit is contained in:
Lennart Poettering 2014-03-11 21:18:21 +01:00
parent dd42fcb046
commit 13fd1e4253
53 changed files with 8 additions and 3058 deletions

View File

@ -1,51 +0,0 @@
From 2d426f2ad06032979fa7a54d11b74be52b8ec047 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Tue, 25 Feb 2014 12:20:25 +0100
Subject: [PATCH] login: fix pos-array allocation
GREEDY_REALLOC takes a pointer to the real size, not the array-width as
argument. Therefore, our array is currently way to small to keep the seat
positions.
Introduce GREEDY_REALLOC0_T() as typed version of GREEDY_REALLOC and store
the array-width instead of array-size.
(cherry picked from commit a1937e679f76758635d295287398abe526de2522)
---
src/login/logind-seat.c | 2 +-
src/shared/util.h | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 631be5f..36ec7ed 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -475,7 +475,7 @@ void seat_claim_position(Seat *s, Session *session, unsigned int pos) {
if (seat_has_vts(s))
pos = session->vtnr;
- if (!GREEDY_REALLOC0(s->positions, s->position_count, pos + 1))
+ if (!GREEDY_REALLOC0_T(s->positions, s->position_count, pos + 1))
return;
seat_evict_position(s, session);
diff --git a/src/shared/util.h b/src/shared/util.h
index 9913fce..78b1444 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -723,6 +723,15 @@ void* greedy_realloc0(void **p, size_t *allocated, size_t need);
#define GREEDY_REALLOC0(array, allocated, need) \
greedy_realloc0((void**) &(array), &(allocated), sizeof((array)[0]) * (need))
+#define GREEDY_REALLOC0_T(array, count, need) \
+ ({ \
+ size_t _size = (count) * sizeof((array)[0]); \
+ void *_ptr = GREEDY_REALLOC0((array), _size, (need)); \
+ if (_ptr) \
+ (count) = _size / sizeof((array)[0]); \
+ _ptr; \
+ })
+
static inline void _reset_errno_(int *saved_errno) {
errno = *saved_errno;
}

View File

@ -1,51 +0,0 @@
From aa6c8bcd17b37634fc7e4d5d59b6b9d93625b4a3 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Tue, 25 Feb 2014 13:08:24 +0100
Subject: [PATCH] login: set pos-slot to fallback on pos-eviction
If we evict a session position, we open the position slot for future
sessions. However, there might already be another session on the same
position if both were started on the same VT. This is currently done if
gdm spawns the session on its own Xserver.
Hence, look for such a session on pos-eviction and claim the new slot
immediately.
(cherry picked from commit 3e6b205f81e743c7354ccbc69eb45afbdbebe2dc)
---
src/login/logind-seat.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 36ec7ed..96cf08e 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -459,6 +459,7 @@ int seat_stop_sessions(Seat *s, bool force) {
}
void seat_evict_position(Seat *s, Session *session) {
+ Session *iter;
unsigned int pos = session->pos;
session->pos = 0;
@@ -466,8 +467,19 @@ void seat_evict_position(Seat *s, Session *session) {
if (!pos)
return;
- if (pos < s->position_count && s->positions[pos] == session)
+ if (pos < s->position_count && s->positions[pos] == session) {
s->positions[pos] = NULL;
+
+ /* There might be another session claiming the same
+ * position (eg., during gdm->session transition), so lets look
+ * for it and set it on the free slot. */
+ LIST_FOREACH(sessions_by_seat, iter, s->sessions) {
+ if (iter->pos == pos) {
+ s->positions[pos] = iter;
+ break;
+ }
+ }
+ }
}
void seat_claim_position(Seat *s, Session *session, unsigned int pos) {

View File

@ -1,33 +0,0 @@
From 0d0b9805baaed3e4e584916bbff710fec6cb1e8b Mon Sep 17 00:00:00 2001
From: "Jasper St. Pierre" <jstpierre@mecheye.net>
Date: Fri, 21 Feb 2014 18:23:17 -0500
Subject: [PATCH] login: Allow calling org.freedesktop.login1.Seat.SwitchTo
(cherry picked from commit 9c413373d2112055a0142ef522bf95af9b491b4a)
---
src/login/org.freedesktop.login1.conf | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/login/org.freedesktop.login1.conf b/src/login/org.freedesktop.login1.conf
index d677f61..1318328 100644
--- a/src/login/org.freedesktop.login1.conf
+++ b/src/login/org.freedesktop.login1.conf
@@ -141,6 +141,18 @@
send_member="ActivateSession"/>
<allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Seat"
+ send_member="SwitchTo"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Seat"
+ send_member="SwitchToPrevious"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Seat"
+ send_member="SwitchToNext"/>
+
+ <allow send_destination="org.freedesktop.login1"
send_interface="org.freedesktop.login1.Session"
send_member="Activate"/>

View File

@ -1,20 +0,0 @@
From d0550e668858e1af94e2746062931680dc15b555 Mon Sep 17 00:00:00 2001
From: Tomasz Torcz <tomek@pipebreaker.pl>
Date: Tue, 25 Feb 2014 12:43:55 +0100
Subject: [PATCH] fix typo in iDRAC network interface name: irdac->idrac
(cherry picked from commit b3e4387351c835766f96796a20d94971afea7d3b)
---
hwdb/20-net-ifname.hwdb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hwdb/20-net-ifname.hwdb b/hwdb/20-net-ifname.hwdb
index 29d2633..2408dc1 100644
--- a/hwdb/20-net-ifname.hwdb
+++ b/hwdb/20-net-ifname.hwdb
@@ -2,4 +2,4 @@
# Dell iDRAC Virtual USB NIC
usb:v413CpA102*
- ID_NET_NAME_FROM_DATABASE=irdac
+ ID_NET_NAME_FROM_DATABASE=idrac

View File

@ -1,88 +0,0 @@
From a980c3fa6bee1b4f0185d9d317c1bbf30ce6b832 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 25 Feb 2014 20:11:04 -0500
Subject: [PATCH] Replace /var/run with /run in remaining places
/run was already used almost everywhere, fix the remaining places
for consistency.
(cherry picked from commit 41a55c46ab8fb4ef6727434227071321fc762cce)
---
man/daemon.xml | 2 +-
man/runlevel.xml | 2 +-
man/tmpfiles.d.xml | 4 ++--
src/libsystemd/sd-bus/sd-bus.c | 4 ++--
src/systemctl/systemctl.c | 4 ++--
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/man/daemon.xml b/man/daemon.xml
index 88dd082..fd29ba7 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -149,7 +149,7 @@
write the daemon PID (as returned by
<function>getpid()</function>) to a
PID file, for example
- <filename>/var/run/foobar.pid</filename>
+ <filename>/run/foobar.pid</filename>
(for a hypothetical daemon "foobar")
to ensure that the daemon cannot be
started more than once. This must be
diff --git a/man/runlevel.xml b/man/runlevel.xml
index 976753a..4db06dc 100644
--- a/man/runlevel.xml
+++ b/man/runlevel.xml
@@ -124,7 +124,7 @@
<variablelist>
<varlistentry>
- <term><filename>/var/run/utmp</filename></term>
+ <term><filename>/run/utmp</filename></term>
<listitem><para>The utmp database
<command>runlevel</command> reads the
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
index 812129f..0a006d1 100644
--- a/man/tmpfiles.d.xml
+++ b/man/tmpfiles.d.xml
@@ -441,8 +441,8 @@ r! /tmp/.X[0-9]*-lock</programlisting>
<title>/etc/tmpfiles.d/screen.conf example</title>
<para><command>screen</command> needs two directories created at boot with specific modes and ownership.</para>
- <programlisting>d /var/run/screens 1777 root root 10d
-d /var/run/uscreens 0755 root root 10d12h</programlisting>
+ <programlisting>d /run/screens 1777 root root 10d
+d /run/uscreens 0755 root root 10d12h</programlisting>
</example>
<example>
<title>/etc/tmpfiles.d/abrt.conf example</title>
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 20f540d..1318272 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -794,8 +794,8 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid)
machine = NULL;
b->sockaddr.un.sun_family = AF_UNIX;
- strncpy(b->sockaddr.un.sun_path, "/var/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path));
- b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + sizeof("/var/run/dbus/system_bus_socket") - 1;
+ strncpy(b->sockaddr.un.sun_path, "/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path));
+ b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + strlen("/run/dbus/system_bus_socket");
return 0;
}
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 34d7079..8692716 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3758,8 +3758,8 @@ static int show_one(
streq(verb, "status")) {
/* According to LSB: "program not running" */
/* 0: program is running or service is OK
- * 1: program is dead and /var/run pid file exists
- * 2: program is dead and /var/lock lock file exists
+ * 1: program is dead and /run PID file exists
+ * 2: program is dead and /run/lock lock file exists
* 3: program is not running
* 4: program or service status is unknown
*/

View File

@ -1,59 +0,0 @@
From ab64c275efac13ed8fb255e4b2ccf1c287aa0bc6 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 26 Feb 2014 02:47:43 +0100
Subject: [PATCH] Revert back to /var/run at a couple of problems
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This partially reverts 41a55c46ab8fb4ef6727434227071321fc762cce
Some specifications we want to stay compatibility actually document
/var/run, not /run, and we should stay compatible with that. In order to
make sure our D-Bus implementation works on any system, regardless if
running systemd or not, we should always use /var/run which is the
only path mandated by the D-Bus spec.
Similar, glibc hardcodes the utmp location to /var/run, and this is
exposed in _UTMP_PATH in limits.h, hence let's stay in sync with this
public API, too.
We simply do not support systems where /var/run is not a symlink → /run.
Hence both are equivalent. Staying compatible with upstream
specifications hence weighs more than cleaning up superficial
appearance.
(cherry picked from commit df1e02046144f41176c32ed011369fd8dba36b76)
---
man/runlevel.xml | 2 +-
src/libsystemd/sd-bus/sd-bus.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/runlevel.xml b/man/runlevel.xml
index 4db06dc..976753a 100644
--- a/man/runlevel.xml
+++ b/man/runlevel.xml
@@ -124,7 +124,7 @@
<variablelist>
<varlistentry>
- <term><filename>/run/utmp</filename></term>
+ <term><filename>/var/run/utmp</filename></term>
<listitem><para>The utmp database
<command>runlevel</command> reads the
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 1318272..636715f 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -794,8 +794,8 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid)
machine = NULL;
b->sockaddr.un.sun_family = AF_UNIX;
- strncpy(b->sockaddr.un.sun_path, "/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path));
- b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + strlen("/run/dbus/system_bus_socket");
+ strncpy(b->sockaddr.un.sun_path, "/var/run/dbus/system_bus_socket", sizeof(b->sockaddr.un.sun_path));
+ b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + strlen("/var/run/dbus/system_bus_socket");
return 0;
}

View File

@ -1,28 +0,0 @@
From 10acd244847eb8689e79efbf95475aef8818bb51 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 26 Feb 2014 02:54:37 +0100
Subject: [PATCH] =?UTF-8?q?README:=20document=20that=20/var/run=20must=20b?=
=?UTF-8?q?e=20a=20symlink=20=E2=86=92=20/run?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
(cherry picked from commit 47bc23c18cbc87471dc832534c8565625e4a9d16)
---
README | 3 +++
1 file changed, 3 insertions(+)
diff --git a/README b/README
index b918132..7a227e7 100644
--- a/README
+++ b/README
@@ -190,6 +190,9 @@ WARNINGS:
about this, since this kind of file system setup is not really
supported anymore by the basic set of Linux OS components.
+ systemd requires that the /run mount point exists. systemd also
+ requires that /var/run is a a symlink → /run.
+
For more information on this issue consult
http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken

View File

@ -1,63 +0,0 @@
From d5194bbb174d0b9a87e81d465644624ab455bbf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 25 Feb 2014 21:26:31 -0500
Subject: [PATCH] Use /var/run/dbus/system_bus_socket for the D-Bus socket
(cherry picked from commit 1ae383a8a3ae4824453e297352fda603d2d3fd5e)
---
man/systemd-bus-proxyd@.service.xml | 2 +-
src/libsystemd/sd-bus/PORTING-DBUS1 | 2 +-
src/shared/def.h | 2 +-
units/systemd-bus-proxyd.socket | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/man/systemd-bus-proxyd@.service.xml b/man/systemd-bus-proxyd@.service.xml
index 75a3c8b..3a5930d 100644
--- a/man/systemd-bus-proxyd@.service.xml
+++ b/man/systemd-bus-proxyd@.service.xml
@@ -59,7 +59,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<para><filename>systemd-bus-proxyd.socket</filename> will launch
<filename>systemd-bus-proxyd@.service</filename> for connections
to the classic D-Bus socket in
- <filename>/run/dbus/system_bus_socket</filename>.</para>
+ <filename>/var/run/dbus/system_bus_socket</filename>.</para>
<para><filename>systemd-bus-proxyd@.service</filename> is launched
for an existing D-Bus connection and will use
diff --git a/src/libsystemd/sd-bus/PORTING-DBUS1 b/src/libsystemd/sd-bus/PORTING-DBUS1
index 90d184b7..0253a42 100644
--- a/src/libsystemd/sd-bus/PORTING-DBUS1
+++ b/src/libsystemd/sd-bus/PORTING-DBUS1
@@ -536,7 +536,7 @@ parameter.
Client libraries should use the following connection string when
connecting to the system bus:
- kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket
+ kernel:path=/dev/kdbus/0-system/bus;unix:path=/var/run/dbus/system_bus_socket
This will ensure that kdbus is preferred over the legacy AF_UNIX
socket, but compatibility is kept. For the user bus use:
diff --git a/src/shared/def.h b/src/shared/def.h
index 7777756..aa489d8 100644
--- a/src/shared/def.h
+++ b/src/shared/def.h
@@ -61,7 +61,7 @@
"/usr/lib/kbd/keymaps/\0"
#endif
-#define UNIX_SYSTEM_BUS_PATH "unix:path=/run/dbus/system_bus_socket"
+#define UNIX_SYSTEM_BUS_PATH "unix:path=/var/run/dbus/system_bus_socket"
#define KERNEL_SYSTEM_BUS_PATH "kernel:path=/dev/kdbus/0-system/bus"
#ifdef ENABLE_KDBUS
diff --git a/units/systemd-bus-proxyd.socket b/units/systemd-bus-proxyd.socket
index 406e15b..6c42d38 100644
--- a/units/systemd-bus-proxyd.socket
+++ b/units/systemd-bus-proxyd.socket
@@ -9,5 +9,5 @@
Description=Legacy D-Bus Protocol Compatibility Socket
[Socket]
-ListenStream=/run/dbus/system_bus_socket
+ListenStream=/var/run/dbus/system_bus_socket
Accept=yes

View File

@ -1,68 +0,0 @@
From f230c64b5ad069b271f163da3142df52eab1202b Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 26 Feb 2014 04:27:50 +0100
Subject: [PATCH] mount: don't send out PropertiesChanged message if actually
nothing got changed
(cherry picked from commit ff5f34d08c191c326c41a083745522383ac86cae)
---
src/core/mount.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index a0cea1e..75b133b 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1388,7 +1388,7 @@ static int mount_add_one(
_cleanup_free_ char *e = NULL, *w = NULL, *o = NULL, *f = NULL;
bool load_extras = false;
MountParameters *p;
- bool delete;
+ bool delete, changed = false;
Unit *u;
int r;
@@ -1456,6 +1456,7 @@ static int mount_add_one(
}
unit_add_to_load_queue(u);
+ changed = true;
} else {
delete = false;
@@ -1474,6 +1475,7 @@ static int mount_add_one(
/* Load in the extras later on, after we
* finished initialization of the unit */
load_extras = true;
+ changed = true;
}
}
@@ -1485,10 +1487,16 @@ static int mount_add_one(
}
p = &MOUNT(u)->parameters_proc_self_mountinfo;
+
+ changed = changed ||
+ !streq_ptr(p->options, options) ||
+ !streq_ptr(p->what, what) ||
+ !streq_ptr(p->fstype, fstype);
+
if (set_flags) {
MOUNT(u)->is_mounted = true;
MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo;
- MOUNT(u)->just_changed = !streq_ptr(p->options, o);
+ MOUNT(u)->just_changed = changed;
}
MOUNT(u)->from_proc_self_mountinfo = true;
@@ -1511,7 +1519,8 @@ static int mount_add_one(
goto fail;
}
- unit_add_to_dbus_queue(u);
+ if (changed)
+ unit_add_to_dbus_queue(u);
return 0;

View File

@ -1,49 +0,0 @@
From 3a144cfb90e6c0c6586a976138fc8e472b90bbaf Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 26 Feb 2014 04:28:37 +0100
Subject: [PATCH] mount: don't fire PropertiesChanged signals for mounts that
are stopped
(cherry picked from commit aef831369cd2a7a1bd4a58dd96ff8628ed6a85f9)
---
src/core/mount.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index 75b133b..68b2e83 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1676,20 +1676,20 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
Mount *mount = MOUNT(u);
if (!mount->is_mounted) {
- /* This has just been unmounted. */
mount->from_proc_self_mountinfo = false;
switch (mount->state) {
case MOUNT_MOUNTED:
+ /* This has just been unmounted by
+ * somebody else, follow the state
+ * change. */
mount_enter_dead(mount, MOUNT_SUCCESS);
break;
default:
- mount_set_state(mount, mount->state);
break;
-
}
} else if (mount->just_mounted || mount->just_changed) {
@@ -1700,6 +1700,9 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
case MOUNT_DEAD:
case MOUNT_FAILED:
+ /* This has just been mounted by
+ * somebody else, follow the state
+ * change. */
mount_enter_mounted(mount, MOUNT_SUCCESS);
break;

View File

@ -1,40 +0,0 @@
From 494bf9d6d22406676c63822cbf941214fed3111c Mon Sep 17 00:00:00 2001
From: Uoti Urpala <uoti.urpala@pp1.inet.fi>
Date: Thu, 20 Feb 2014 03:00:09 +0200
Subject: [PATCH] logs-show: fix corrupt output with empty messages
If a message had zero length, journalctl would print no newline, and
two output lines would be concatenated. Fix. The problem was
introduced in commit 31f7bf199452 ("logs-show: print multiline
messages"). Affected short and verbose output modes.
Before fix:
Feb 09 21:16:17 glyph dhclient[1323]: Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit
after:
Feb 09 21:16:17 glyph dhclient[1323]:
Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit
(cherry picked from commit 47d80904a1f72d559962cc5ad32fffd46672a34a)
---
src/shared/logs-show.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 61c3652..12d4a1c 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -124,6 +124,11 @@ static bool print_multiline(FILE *f, unsigned prefix, unsigned n_columns, Output
}
}
+ /* A special case: make sure that we print a newline when
+ the message is empty. */
+ if (message_len == 0)
+ fputs("\n", f);
+
for (pos = message;
pos < message + message_len;
pos = end + 1, line++) {

View File

@ -1,29 +0,0 @@
From 0c4b94ed59075c38da2aa30d162fc9f963d419aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 26 Feb 2014 23:01:43 -0500
Subject: [PATCH] journalctl: refuse extra arguments with --verify and similar
Positional arguments only make sense with the default action.
For other actions, complain instead of ignoring them silently.
(cherry picked from commit 0b6b7c2004317da48e5bbd3078c5662d8f0061b6)
---
src/journal/journalctl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index a328ba1..0619b25 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -658,6 +658,11 @@ static int parse_argv(int argc, char *argv[]) {
return -EINVAL;
}
+ if (arg_action != ACTION_SHOW && optind < argc) {
+ log_error("Extraneous arguments starting with '%s'", argv[optind]);
+ return -EINVAL;
+ }
+
return 1;
}

View File

@ -1,52 +0,0 @@
From 2388edd10d9aab9c0f3817e73addd3dc0bc870bf Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 27 Feb 2014 11:06:37 +0100
Subject: [PATCH] cdrom_id: use the old MMC fallback
https://bugzilla.redhat.com/show_bug.cgi?id=1038015
The problem seems to be that the your virtual DVD is emulating a really
old DVD device, and doing it kind of strangely.
> dracut:# /lib/udev/cdrom_id --debug /dev/sr0
> probing: '/dev/sr0'
> INQUIRY: [IMM ][Virtual CD/DVD ][0316]
> GET CONFIGURATION failed with SK=5h/ASC=24h/ACQ=00h
So your virtual drive rejects the GET CONFIGURATION command as illegal.
Other pre-MMC2 drives that don't accept this command usually return the
error
SK=5h,ASC=20h (invalid/unsupported command code), in which case cdrom_id
tries an older method, and then ID_CDROM_MEDIA_TRACK_COUNT_DATA gets set
and all the /dev/disk/by-label (etc) links get set up.
The virtual drive returns the error SK=5h,ASC=24h (invalid field in
Command Descriptor Block), which cdrom_id doesn't handle, so it gives up
and the links never get made.
The ideal solution would be to make the IMM to emulate a device that's
less than 15 years old, but I'm not going to hold my breath waiting for
that.
So probably cdrom_id should also use the old MMC fallback when the error
is SK=5h,ASC=24h, and then all of this would work as expected.
Suggested-by:Luca Miccini <lmiccini@redhat.com>
(cherry picked from commit a14f14976094650e17d39f3a7d15a1c68c93c333)
---
src/udev/cdrom_id/cdrom_id.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c
index 93467c2..33b2bc3 100644
--- a/src/udev/cdrom_id/cdrom_id.c
+++ b/src/udev/cdrom_id/cdrom_id.c
@@ -556,7 +556,7 @@ static int cd_profiles(struct udev *udev, int fd)
if ((err != 0)) {
info_scsi_cmd_err(udev, "GET CONFIGURATION", err);
/* handle pre-MMC2 drives which do not support GET CONFIGURATION */
- if (SK(err) == 0x5 && ASC(err) == 0x20) {
+ if (SK(err) == 0x5 && (ASC(err) == 0x20 || ASC(err) == 0x24)) {
log_debug("drive is pre-MMC2 and does not support 46h get configuration command");
log_debug("trying to work around the problem");
ret = cd_profiles_old_mmc(udev, fd);

View File

@ -1,25 +0,0 @@
From 107e2ed29711c813a34a07e4ce626f98c3607534 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 27 Feb 2014 11:19:09 +0100
Subject: [PATCH] udev/rules: setup tty permissions and group for sclp_line,
ttysclp and 3270/tty
(cherry picked from commit c594cccee264cfd98f183ae6ec289b11e70f2d6c)
---
rules/50-udev-default.rules | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules
index 679dfdf..0bccf67 100644
--- a/rules/50-udev-default.rules
+++ b/rules/50-udev-default.rules
@@ -15,6 +15,9 @@ ACTION!="add", GOTO="default_permissions_end"
SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666"
SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666"
SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620"
+SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620"
+SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620"
+SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620"
SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"

View File

@ -1,55 +0,0 @@
From ff02c36bfc811fc7ecbcaebdbc3bc4bebb5f19ab Mon Sep 17 00:00:00 2001
From: Henrik Grindal Bakken <hgb@ifi.uio.no>
Date: Thu, 27 Feb 2014 21:19:13 +0100
Subject: [PATCH] architecture: Add tilegx
Add Tilera's TILE-GX processor family support.
(cherry picked from commit 46eea341c36f0caf0bdd5b2274a1ef7cb4e83e97)
---
src/shared/architecture.c | 3 +++
src/shared/architecture.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/src/shared/architecture.c b/src/shared/architecture.c
index ceba492..fcdb3d5 100644
--- a/src/shared/architecture.c
+++ b/src/shared/architecture.c
@@ -112,6 +112,8 @@ Architecture uname_architecture(void) {
{ "sh", ARCHITECTURE_SH },
#elif defined(__m68k__)
{ "m68k", ARCHITECTURE_M68K },
+#elif defined(__tilegx__)
+ { "tilegx", ARCHITECTURE_TILEGX },
#else
#error "Please register your architecture here!"
#endif
@@ -158,6 +160,7 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = {
[ARCHITECTURE_SH] = "sh",
[ARCHITECTURE_SH64] = "sh64",
[ARCHITECTURE_M68K] = "m68k",
+ [ARCHITECTURE_TILEGX] = "tilegx",
};
DEFINE_STRING_TABLE_LOOKUP(architecture, Architecture);
diff --git a/src/shared/architecture.h b/src/shared/architecture.h
index 3183645..e589a91 100644
--- a/src/shared/architecture.h
+++ b/src/shared/architecture.h
@@ -47,6 +47,7 @@ typedef enum Architecture {
ARCHITECTURE_SH,
ARCHITECTURE_SH64,
ARCHITECTURE_M68K,
+ ARCHITECTURE_TILEGX,
_ARCHITECTURE_MAX,
_ARCHITECTURE_INVALID = -1
} Architecture;
@@ -107,6 +108,8 @@ Architecture uname_architecture(void);
# define native_architecture() ARCHITECTURE_SH
#elif defined(__m68k__)
# define native_architecture() ARCHITECTURE_M68K
+#elif defined(__tilegx__)
+# define native_architecture() ARCHITECTURE_TILEGX
#else
#error "Please register your architecture here!"
#endif

View File

@ -1,30 +0,0 @@
From 0b37b2b7a3fe8e8f96f368848ff46db325a59e70 Mon Sep 17 00:00:00 2001
From: Tero Roponen <tero.roponen@gmail.com>
Date: Tue, 25 Feb 2014 17:19:35 +0200
Subject: [PATCH] nspawn: fix detection of missing /proc/self/loginuid
Running 'systemd-nspawn -D /srv/Fedora/' gave me this error:
Failed to read /proc/self/loginuid: No such file or directory
Container Fedora failed with error code 1.
This patch fixes the problem.
(cherry picked from commit 13e8ceb84e56907d73b6b07418deb37faaf0e66d)
---
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 de74a43..84b7276 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1341,7 +1341,7 @@ static int reset_audit_loginuid(void) {
return 0;
r = read_one_line_file("/proc/self/loginuid", &p);
- if (r == -EEXIST)
+ if (r == -ENOENT)
return 0;
if (r < 0) {
log_error("Failed to read /proc/self/loginuid: %s", strerror(-r));

View File

@ -1,142 +0,0 @@
From 3300150b370b2a58522d55d7ff17632e5dd58af8 Mon Sep 17 00:00:00 2001
From: Thomas Andersen <phomes@localhost.localdomain>
Date: Sat, 1 Mar 2014 03:27:49 +0100
Subject: [PATCH] bash: add completion for systemd-nspawn
(cherry picked from commit 0d6883b6a870b66c8c70e43695d22de96aab68e7)
---
Makefile.am | 1 +
shell-completion/bash/systemd-nspawn | 112 +++++++++++++++++++++++++++++++++++
2 files changed, 113 insertions(+)
create mode 100644 shell-completion/bash/systemd-nspawn
diff --git a/Makefile.am b/Makefile.am
index 529b525..8e6c392 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -353,6 +353,7 @@ dist_bashcompletion_DATA = \
shell-completion/bash/systemctl \
shell-completion/bash/systemd-analyze \
shell-completion/bash/systemd-delta \
+ shell-completion/bash/systemd-nspawn \
shell-completion/bash/systemd-run \
shell-completion/bash/udevadm \
shell-completion/bash/kernel-install
diff --git a/shell-completion/bash/systemd-nspawn b/shell-completion/bash/systemd-nspawn
new file mode 100644
index 0000000..5b2ac82
--- /dev/null
+++ b/shell-completion/bash/systemd-nspawn
@@ -0,0 +1,112 @@
+# systemd-nspawn(1) completion -*- shell-script -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2014 Thomas H.P. Andersen
+#
+# 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
+# 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/>.
+
+__contains_word() {
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
+}
+
+__get_users() {
+ local a b
+ loginctl list-users --no-legend --no-pager | { while read a b; do echo " $b"; done; };
+}
+
+__get_slices() {
+ local a b
+ systemctl list-units -t slice --no-legend --no-pager | { while read a b; do echo " $a"; done; };
+}
+
+_systemd_nspawn() {
+ local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
+ local i verb comps
+
+ local -A OPTS=(
+ [STANDALONE]='-h --help --version --private-network -b --boot --read-only -q --quiet --share-system --keep-unit --network-veth -j'
+ [ARG]='-D --directory -u --user --uuid --capability --drop-capability --link-journal --bind --bind-ro -M --machine
+ -S --slice --setenv -Z --selinux-context -L --selinux-apifs-context --register --network-interface --network-bridge
+ --personality'
+ )
+
+ _init_completion || return
+
+ if __contains_word "$prev" ${OPTS[ARG]}; then
+ case $prev in
+ --directory|-D)
+ comps=$(compgen -A directory -- "$cur" )
+ ;;
+ --user|-u)
+ comps=$( __get_users )
+ ;;
+ --uuid)
+ comps=''
+ ;;
+ --capability)
+ comps='CAP_BLOCK_SUSPEND CAP_IPC_LOCK CAP_MAC_ADMIN CAP_MAC_OVERRIDE CAP_SYS_MODULE CAP_SYS_PACCT CAP_SYS_RAWIO
+ CAP_SYS_TIME CAP_SYSLOG CAP_WAKE_ALARM CAP_NET_ADMIN'
+ ;;
+ --drop-capability)
+ comps='CAP_AUDIT_CONTROL CAP_AUDIT_WRITE CAP_CHOWN CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_FSETID
+ CAP_IPC_OWNER CAP_KILL CAP_LEASE CAP_LINUX_IMMUTABLE CAP_MKNOD CAP_NET_ADMIN CAP_NET_BIND_SERVICE
+ CAP_NET_BROADCAST CAP_NET_RAW CAP_SETFCAP CAP_SETGID CAP_SETPCAP CAP_SETUID CAP_SYS_ADMIN CAP_SYS_BOOT
+ CAP_SYS_CHROOT CAP_SYS_NICE CAP_SYS_PTRACE CAP_SYS_RESOURCE CAP_SYS_TTY_CONFIG'
+ ;;
+ --link-journal)
+ comps='no auto guest host'
+ ;;
+ --bind|--bind-ro)
+ comps=''
+ ;;
+ --machine|-M)
+ comps=''
+ ;;
+ --slice|-S)
+ comps=$( __get_slices )
+ ;;
+ --setenv)
+ comps=''
+ ;;
+ --selinux-context|-Z)
+ comps=''
+ ;;
+ --selinux-apifs-context|-L)
+ comps=''
+ ;;
+ --register)
+ comps='yes no'
+ ;;
+ --network-interface)
+ comps=''
+ ;;
+ --network-bridge)
+ comps=''
+ ;;
+ --personality)
+ comps='x86 x86-64'
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
+ return 0
+ fi
+
+ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
+}
+
+complete -F _systemd_nspawn systemd-nspawn

View File

@ -1,86 +0,0 @@
From 8523c2a84f3d8a8b163a17aad5c55cb0234ebff2 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Sat, 1 Mar 2014 23:08:38 +0100
Subject: [PATCH] add bash completion for systemd-cgls
(cherry picked from commit abdab4f602745952030a37b1521cd0374d51d3ea)
---
Makefile.am | 1 +
shell-completion/bash/systemd-cgls | 56 ++++++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+)
create mode 100644 shell-completion/bash/systemd-cgls
diff --git a/Makefile.am b/Makefile.am
index 8e6c392..0b83823 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -352,6 +352,7 @@ dist_bashcompletion_DATA = \
shell-completion/bash/journalctl \
shell-completion/bash/systemctl \
shell-completion/bash/systemd-analyze \
+ shell-completion/bash/systemd-cgls \
shell-completion/bash/systemd-delta \
shell-completion/bash/systemd-nspawn \
shell-completion/bash/systemd-run \
diff --git a/shell-completion/bash/systemd-cgls b/shell-completion/bash/systemd-cgls
new file mode 100644
index 0000000..0570438
--- /dev/null
+++ b/shell-completion/bash/systemd-cgls
@@ -0,0 +1,56 @@
+# systemd-cgls(1) completion -*- shell-script -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2014 Thomas H.P. Andersen
+#
+# 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
+# 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/>.
+
+__contains_word() {
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
+}
+
+__get_machines() {
+ local a b
+ machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; };
+}
+
+_systemd_cgls() {
+ local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
+ local i verb comps
+
+ local -A OPTS=(
+ [STANDALONE]='-h --help --version --all -l --full -k --no-pager'
+ [ARG]='-M --machine'
+ )
+
+ _init_completion || return
+
+ if __contains_word "$prev" ${OPTS[ARG]}; then
+ case $prev in
+ --machine|-M)
+ comps=$( __get_machines )
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
+ return 0
+ fi
+
+ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
+}
+
+complete -F _systemd_cgls systemd-cgls

View File

@ -1,27 +0,0 @@
From a63a8b12c107215fa8b84ca792e84bc2789e6163 Mon Sep 17 00:00:00 2001
From: Marcel Holtmann <marcel@holtmann.org>
Date: Sun, 2 Mar 2014 10:02:10 -0800
Subject: [PATCH] hwdb: Update database of Bluetooth company identifiers
(cherry picked from commit e525326bd07ebf3cabcfd730bc479166723f2d44)
---
hwdb/20-bluetooth-vendor-product.hwdb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb
index db3bc24..0335a71 100644
--- a/hwdb/20-bluetooth-vendor-product.hwdb
+++ b/hwdb/20-bluetooth-vendor-product.hwdb
@@ -902,3 +902,12 @@ bluetooth:v0129*
bluetooth:v012A*
ID_VENDOR_FROM_DATABASE=Changzhou Yongse Infotech Co., Ltd
+
+bluetooth:v012B*
+ ID_VENDOR_FROM_DATABASE=SportIQ
+
+bluetooth:v012C*
+ ID_VENDOR_FROM_DATABASE=TEMEC Instruments B.V.
+
+bluetooth:v012D*
+ ID_VENDOR_FROM_DATABASE=Sony Corporation

View File

@ -1,156 +0,0 @@
From 4cae8946d581a6ecf0b26e154bf9c00e390024b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 2 Mar 2014 00:05:16 -0500
Subject: [PATCH] Allow fractional parts in disk sizes
It seems natural to be able to say SystemMaxUsage=1.5G.
https://bugzilla.redhat.com/show_bug.cgi?id=1047568
(cherry picked from commit 9480794b277b5ce33e467578ed669996df576bb9)
---
src/shared/util.c | 24 ++++++++++++++++++++++--
src/test/test-util.c | 42 +++++++++++++++++++++++++++++++++++++-----
2 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 5cb598c..3164515 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -2198,6 +2198,8 @@ int parse_size(const char *t, off_t base, off_t *size) {
p = t;
do {
long long l;
+ unsigned long long l2;
+ double frac = 0;
char *e;
unsigned i;
@@ -2213,14 +2215,32 @@ int parse_size(const char *t, off_t base, off_t *size) {
if (e == p)
return -EINVAL;
+ if (*e == '.') {
+ e++;
+ if (*e >= '0' && *e <= '9') {
+ char *e2;
+
+ /* strotoull itself would accept space/+/- */
+ l2 = strtoull(e, &e2, 10);
+
+ if (errno == ERANGE)
+ return -errno;
+
+ /* Ignore failure. E.g. 10.M is valid */
+ frac = l2;
+ for (; e < e2; e++)
+ frac /= 10;
+ }
+ }
+
e += strspn(e, WHITESPACE);
for (i = 0; i < n_entries; i++)
if (startswith(e, table[i].suffix)) {
unsigned long long tmp;
- if ((unsigned long long) l > ULLONG_MAX / table[i].factor)
+ if ((unsigned long long) l + (frac > 0) > ULLONG_MAX / table[i].factor)
return -ERANGE;
- tmp = l * table[i].factor;
+ tmp = l * table[i].factor + (unsigned long long) (frac * table[i].factor);
if (tmp > ULLONG_MAX - r)
return -ERANGE;
diff --git a/src/test/test-util.c b/src/test/test-util.c
index b718206..74f83a2 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -30,6 +30,7 @@
#include "strv.h"
#include "def.h"
#include "fileio.h"
+#include "conf-parser.h"
static void test_streq_ptr(void) {
assert_se(streq_ptr(NULL, NULL));
@@ -441,17 +442,32 @@ static void test_parse_size(void) {
assert_se(parse_size("111", 1024, &bytes) == 0);
assert_se(bytes == 111);
+ assert_se(parse_size("111.4", 1024, &bytes) == 0);
+ assert_se(bytes == 111);
+
assert_se(parse_size(" 112 B", 1024, &bytes) == 0);
assert_se(bytes == 112);
- assert_se(parse_size("3 K", 1024, &bytes) == 0);
+ assert_se(parse_size(" 112.6 B", 1024, &bytes) == 0);
+ assert_se(bytes == 112);
+
+ assert_se(parse_size("3.5 K", 1024, &bytes) == 0);
+ assert_se(bytes == 3*1024 + 512);
+
+ assert_se(parse_size("3. K", 1024, &bytes) == 0);
+ assert_se(bytes == 3*1024);
+
+ assert_se(parse_size("3.0 K", 1024, &bytes) == 0);
assert_se(bytes == 3*1024);
- assert_se(parse_size(" 4 M 11K", 1024, &bytes) == 0);
- assert_se(bytes == 4*1024*1024 + 11 * 1024);
+ assert_se(parse_size("3. 0 K", 1024, &bytes) == 0);
+ assert_se(bytes == 3);
- assert_se(parse_size("3B3G", 1024, &bytes) == 0);
- assert_se(bytes == 3ULL*1024*1024*1024 + 3);
+ assert_se(parse_size(" 4 M 11.5K", 1024, &bytes) == 0);
+ assert_se(bytes == 4*1024*1024 + 11 * 1024 + 512);
+
+ assert_se(parse_size("3B3.5G", 1024, &bytes) == 0);
+ assert_se(bytes == 3ULL*1024*1024*1024 + 512*1024*1024 + 3);
assert_se(parse_size("3B3G4T", 1024, &bytes) == 0);
assert_se(bytes == (4ULL*1024 + 3)*1024*1024*1024 + 3);
@@ -464,6 +480,10 @@ static void test_parse_size(void) {
assert_se(parse_size("12X", 1024, &bytes) == -EINVAL);
+ assert_se(parse_size("12.5X", 1024, &bytes) == -EINVAL);
+
+ assert_se(parse_size("12.5e3", 1024, &bytes) == -EINVAL);
+
assert_se(parse_size("1024E", 1024, &bytes) == -ERANGE);
assert_se(parse_size("-1", 1024, &bytes) == -ERANGE);
assert_se(parse_size("-1024E", 1024, &bytes) == -ERANGE);
@@ -473,6 +493,14 @@ static void test_parse_size(void) {
assert_se(parse_size("-10B 20K", 1024, &bytes) == -ERANGE);
}
+static void test_config_parse_iec_off(void) {
+ off_t offset = 0;
+ assert_se(config_parse_iec_off(NULL, "/this/file", 11, "Section", 22, "Size", 0, "4M", &offset, NULL) == 0);
+ assert_se(offset == 4 * 1024 * 1024);
+
+ assert_se(config_parse_iec_off(NULL, "/this/file", 11, "Section", 22, "Size", 0, "4.5M", &offset, NULL) == 0);
+}
+
static void test_strextend(void) {
_cleanup_free_ char *str = strdup("0123");
strextend(&str, "456", "78", "9", NULL);
@@ -589,6 +617,9 @@ static void test_writing_tmpfile(void) {
}
int main(int argc, char *argv[]) {
+ log_parse_environment();
+ log_open();
+
test_streq_ptr();
test_first_word();
test_close_many();
@@ -618,6 +649,7 @@ int main(int argc, char *argv[]) {
test_get_process_comm();
test_protect_errno();
test_parse_size();
+ test_config_parse_iec_off();
test_strextend();
test_strrep();
test_split_pair();

View File

@ -1,70 +0,0 @@
From 6b4293393eb0a15e4f73ba9f08554178ccc4c222 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Sun, 2 Mar 2014 22:58:18 +0100
Subject: [PATCH] add bash completion for systemd-cgtop
(cherry picked from commit d9256bac4da4241cb5d97960c899390839f2c6e5)
---
Makefile.am | 1 +
shell-completion/bash/systemd-cgtop | 40 +++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
create mode 100644 shell-completion/bash/systemd-cgtop
diff --git a/Makefile.am b/Makefile.am
index 0b83823..9cabd1d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -353,6 +353,7 @@ dist_bashcompletion_DATA = \
shell-completion/bash/systemctl \
shell-completion/bash/systemd-analyze \
shell-completion/bash/systemd-cgls \
+ shell-completion/bash/systemd-cgtop \
shell-completion/bash/systemd-delta \
shell-completion/bash/systemd-nspawn \
shell-completion/bash/systemd-run \
diff --git a/shell-completion/bash/systemd-cgtop b/shell-completion/bash/systemd-cgtop
new file mode 100644
index 0000000..d7ea42d
--- /dev/null
+++ b/shell-completion/bash/systemd-cgtop
@@ -0,0 +1,40 @@
+# systemd-cgtop(1) completion -*- shell-script -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2014 Thomas H.P. Andersen
+#
+# 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
+# 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/>.
+
+__contains_word() {
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
+}
+
+_systemd_cgtop() {
+ local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
+ local comps
+
+ local -A OPTS=(
+ [STANDALONE]='-h --help --version -p -t -c -m -i -b --batch -n --iterations -d --delay'
+ )
+
+ _init_completion || return
+
+ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
+}
+
+complete -F _systemd_cgtop systemd-cgtop

View File

@ -1,27 +0,0 @@
From 877c2fccf76afdd7364040f9b859c8d84226b9cc Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Sun, 2 Mar 2014 23:37:39 -0500
Subject: [PATCH] Fix systemd-stdio-bridge symlink
The symlink is created in bindir (/usr/bin), and points to a binary
which lives in rootlibexecdir (/lib/systemd or /usr/lib/systemd). A
relative symlink does not work here.
(cherry picked from commit 8100c1a8f58b2fb5d97e156420a7e16562e93bc4)
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 9cabd1d..bc5e719 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1955,7 +1955,7 @@ systemd_bus_proxyd_LDADD = \
bus-proxyd-install-hook:
$(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
- $(AM_V_LN)$(LN_S) -f ../lib/systemd/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
+ $(AM_V_LN)$(LN_S) -f $(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
bus-proxyd-uninstall-hook:
rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge

View File

@ -1,52 +0,0 @@
From f0eb7735d8cdf44ebf7064613add363ddda329b0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 3 Mar 2014 17:11:39 +0100
Subject: [PATCH] execute: free directory path if we fail to remove it because
we cannot allocate a thread
(cherry picked from commit 98b47d54ce946ad3524f84eb38d2413498a333dc)
---
src/core/execute.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/core/execute.c b/src/core/execute.c
index a328fc2..bb06507 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -2579,6 +2579,8 @@ static void *remove_tmpdir_thread(void *p) {
}
void exec_runtime_destroy(ExecRuntime *rt) {
+ int r;
+
if (!rt)
return;
@@ -2588,13 +2590,25 @@ void exec_runtime_destroy(ExecRuntime *rt) {
if (rt->tmp_dir) {
log_debug("Spawning thread to nuke %s", rt->tmp_dir);
- asynchronous_job(remove_tmpdir_thread, rt->tmp_dir);
+
+ r = asynchronous_job(remove_tmpdir_thread, rt->tmp_dir);
+ if (r < 0) {
+ log_warning("Failed to nuke %s: %s", rt->tmp_dir, strerror(-r));
+ free(rt->tmp_dir);
+ }
+
rt->tmp_dir = NULL;
}
if (rt->var_tmp_dir) {
log_debug("Spawning thread to nuke %s", rt->var_tmp_dir);
- asynchronous_job(remove_tmpdir_thread, rt->var_tmp_dir);
+
+ r = asynchronous_job(remove_tmpdir_thread, rt->var_tmp_dir);
+ if (r < 0) {
+ log_warning("Failed to nuke %s: %s", rt->var_tmp_dir, strerror(-r));
+ free(rt->var_tmp_dir);
+ }
+
rt->var_tmp_dir = NULL;
}

View File

@ -1,55 +0,0 @@
From 1ec5be9a85b46c697fc87405038427eaf9bebe1b Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Mon, 3 Mar 2014 22:01:42 +0100
Subject: [PATCH] update bash completion for systemd-analyze
(cherry picked from commit 64ae7f1864d54f38d62e258322a7ea9756c7284b)
---
shell-completion/bash/systemd-analyze | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
index 6afcd96..5575beb 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/shell-completion/bash/systemd-analyze
@@ -25,10 +25,19 @@ __contains_word () {
done
}
+__get_machines() {
+ local a b
+ machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; };
+}
+
_systemd_analyze() {
local i verb comps
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
- local OPTS='--help --version --system --user --from-pattern --to-pattern --order --require'
+
+ local -A OPTS=(
+ [STANDALONE]='--help --version --system --user --from-pattern --to-pattern --order --require --no-pager'
+ [ARG]='-H --host -M --machine'
+ )
local -A VERBS=(
[STANDALONE]='time blame plot dump'
@@ -47,6 +56,19 @@ _systemd_analyze() {
fi
done
+ if __contains_word "$prev" ${OPTS[ARG]}; then
+ case $prev in
+ --host|-H)
+ comps=$(compgen -A hostname)
+ ;;
+ --machine|-M)
+ comps=$( __get_machines )
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
+ return 0
+ fi
+
if [[ -z $verb && $cur = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0

View File

@ -1,70 +0,0 @@
From 191479e0e4fb43f667ce743e82aac8bcccfbd6e1 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Mon, 3 Mar 2014 22:16:04 +0100
Subject: [PATCH] add bash completion for systemd-detect-virt
(cherry picked from commit 3bfe58cbd4a9b1d2520f425f95de718f3a583d39)
---
Makefile.am | 1 +
shell-completion/bash/systemd-detect-virt | 40 +++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
create mode 100644 shell-completion/bash/systemd-detect-virt
diff --git a/Makefile.am b/Makefile.am
index bc5e719..834ed6f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -355,6 +355,7 @@ dist_bashcompletion_DATA = \
shell-completion/bash/systemd-cgls \
shell-completion/bash/systemd-cgtop \
shell-completion/bash/systemd-delta \
+ shell-completion/bash/systemd-detect-virt \
shell-completion/bash/systemd-nspawn \
shell-completion/bash/systemd-run \
shell-completion/bash/udevadm \
diff --git a/shell-completion/bash/systemd-detect-virt b/shell-completion/bash/systemd-detect-virt
new file mode 100644
index 0000000..df06c29
--- /dev/null
+++ b/shell-completion/bash/systemd-detect-virt
@@ -0,0 +1,40 @@
+# systemd-detect-virt(1) completion -*- shell-script -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2014 Thomas H.P. Andersen
+#
+# 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
+# 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/>.
+
+__contains_word() {
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
+}
+
+_systemd_detect_virt() {
+ local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
+ local i verb comps
+
+ local -A OPTS=(
+ [STANDALONE]='-h --help --version -c --container -v --vm -q --quiet'
+ )
+
+ _init_completion || return
+
+ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
+}
+
+complete -F _systemd_detect_virt systemd-detect-virt

View File

@ -1,123 +0,0 @@
From 799f37dd06946958dfed2aec54788c5e81bf340a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 4 Mar 2014 09:50:26 -0500
Subject: [PATCH] Do not print invalid UTF-8 in error messages
Inexplicably, 550a40ec ('core: do not print invalid utf-8 in error
messages') only fixed two paths. Convert all of them now.
(cherry picked from commit b5d742138f71e87312541a89aac5657015f50f48)
Conflicts:
src/core/load-fragment.c
src/shared/conf-parser.c
---
src/core/load-fragment.c | 11 +++--------
src/shared/conf-parser.c | 6 ++----
src/shared/conf-parser.h | 6 ++++++
src/shared/fileio.c | 9 ++++++---
4 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 82aed1e..027ec5f 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -535,9 +535,7 @@ int config_parse_exec(const char *unit,
}
if (!utf8_is_valid(path)) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Path is not UTF-8 clean, ignoring assignment: %s",
- rvalue);
+ log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
r = 0;
goto fail;
}
@@ -552,9 +550,7 @@ int config_parse_exec(const char *unit,
}
if (!utf8_is_valid(c)) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Path is not UTF-8 clean, ignoring assignment: %s",
- rvalue);
+ log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
r = 0;
goto fail;
}
@@ -1959,8 +1955,7 @@ int config_parse_unit_requires_mounts_for(
return log_oom();
if (!utf8_is_valid(n)) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Path is not UTF-8 clean, ignoring assignment: %s", rvalue);
+ log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
continue;
}
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index cfa669b..b6aa856 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -656,8 +656,7 @@ int config_parse_path(const char *unit,
assert(data);
if (!utf8_is_valid(rvalue)) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Path is not UTF-8 clean, ignoring assignment: %s", rvalue);
+ log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
return 0;
}
@@ -725,8 +724,7 @@ int config_parse_strv(const char *unit,
return log_oom();
if (!utf8_is_valid(n)) {
- log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "String is not UTF-8 clean, ignoring: %s", rvalue);
+ log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
continue;
}
diff --git a/src/shared/conf-parser.h b/src/shared/conf-parser.h
index 4ccdadd..7e1c493 100644
--- a/src/shared/conf-parser.h
+++ b/src/shared/conf-parser.h
@@ -124,6 +124,12 @@ int log_syntax_internal(const char *unit, int level,
config_file, config_line, \
error, __VA_ARGS__)
+#define log_invalid_utf8(unit, level, config_file, config_line, error, rvalue) { \
+ _cleanup_free_ char *__p = utf8_escape_invalid(rvalue); \
+ log_syntax(unit, level, config_file, config_line, error, \
+ "String is not UTF-8 clean, ignoring assignment: %s", __p); \
+ }
+
#define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \
int function(const char *unit, \
const char *filename, \
diff --git a/src/shared/fileio.c b/src/shared/fileio.c
index 0d3f2e9..fcd1b8a 100644
--- a/src/shared/fileio.c
+++ b/src/shared/fileio.c
@@ -598,15 +598,18 @@ static int load_env_file_push(const char *filename, unsigned line,
int r;
if (!utf8_is_valid(key)) {
+ _cleanup_free_ char *t = utf8_escape_invalid(key);
+
log_error("%s:%u: invalid UTF-8 for key '%s', ignoring.",
- filename, line, key);
+ filename, line, t);
return -EINVAL;
}
if (value && !utf8_is_valid(value)) {
- /* FIXME: filter UTF-8 */
+ _cleanup_free_ char *t = utf8_escape_invalid(value);
+
log_error("%s:%u: invalid UTF-8 value for key %s: '%s', ignoring.",
- filename, line, key, value);
+ filename, line, key, t);
return -EINVAL;
}

View File

@ -1,53 +0,0 @@
From b4fb5c323dc77954867e0d896dce03edd094617a Mon Sep 17 00:00:00 2001
From: Umut Tezduyar Lindskog <umut.tezduyar@axis.com>
Date: Tue, 4 Mar 2014 13:58:35 +0100
Subject: [PATCH] architecture: Add cris
(cherry picked from commit 86bafac9540ba9e111ccba2fdf4161fe3a67cd3b)
---
src/shared/architecture.c | 3 +++
src/shared/architecture.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/src/shared/architecture.c b/src/shared/architecture.c
index fcdb3d5..9e0c3ef 100644
--- a/src/shared/architecture.c
+++ b/src/shared/architecture.c
@@ -114,6 +114,8 @@ Architecture uname_architecture(void) {
{ "m68k", ARCHITECTURE_M68K },
#elif defined(__tilegx__)
{ "tilegx", ARCHITECTURE_TILEGX },
+#elif defined(__cris__)
+ { "cris", ARCHITECTURE_CRIS },
#else
#error "Please register your architecture here!"
#endif
@@ -161,6 +163,7 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = {
[ARCHITECTURE_SH64] = "sh64",
[ARCHITECTURE_M68K] = "m68k",
[ARCHITECTURE_TILEGX] = "tilegx",
+ [ARCHITECTURE_CRIS] = "cris",
};
DEFINE_STRING_TABLE_LOOKUP(architecture, Architecture);
diff --git a/src/shared/architecture.h b/src/shared/architecture.h
index e589a91..20e848b 100644
--- a/src/shared/architecture.h
+++ b/src/shared/architecture.h
@@ -48,6 +48,7 @@ typedef enum Architecture {
ARCHITECTURE_SH64,
ARCHITECTURE_M68K,
ARCHITECTURE_TILEGX,
+ ARCHITECTURE_CRIS,
_ARCHITECTURE_MAX,
_ARCHITECTURE_INVALID = -1
} Architecture;
@@ -110,6 +111,8 @@ Architecture uname_architecture(void);
# define native_architecture() ARCHITECTURE_M68K
#elif defined(__tilegx__)
# define native_architecture() ARCHITECTURE_TILEGX
+#elif defined(__cris__)
+# define native_architecture() ARCHITECTURE_CRIS
#else
#error "Please register your architecture here!"
#endif

View File

@ -1,87 +0,0 @@
From 7f197e46c944bdb43fa1cedbd97708ac2ea72558 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Tue, 4 Mar 2014 23:16:30 +0100
Subject: [PATCH] add bash completion for systemd-cat
(cherry picked from commit 207017017db91232189226bfcf29e61926310a9b)
---
Makefile.am | 1 +
shell-completion/bash/systemd-cat | 57 +++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
create mode 100644 shell-completion/bash/systemd-cat
diff --git a/Makefile.am b/Makefile.am
index 834ed6f..7187b8d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -352,6 +352,7 @@ dist_bashcompletion_DATA = \
shell-completion/bash/journalctl \
shell-completion/bash/systemctl \
shell-completion/bash/systemd-analyze \
+ shell-completion/bash/systemd-cat \
shell-completion/bash/systemd-cgls \
shell-completion/bash/systemd-cgtop \
shell-completion/bash/systemd-delta \
diff --git a/shell-completion/bash/systemd-cat b/shell-completion/bash/systemd-cat
new file mode 100644
index 0000000..8d84042
--- /dev/null
+++ b/shell-completion/bash/systemd-cat
@@ -0,0 +1,57 @@
+# systemd-cat(1) completion -*- shell-script -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2014 Thomas H.P. Andersen
+#
+# 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
+# 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/>.
+
+__contains_word() {
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
+}
+
+_systemd_cat() {
+ local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
+ local i verb comps
+
+ local -A OPTS=(
+ [STANDALONE]='-h --help --version'
+ [ARG]='-t --identifier -p --priority --level-prefix'
+ )
+
+ _init_completion || return
+
+ if __contains_word "$prev" ${OPTS[ARG]}; then
+ case $prev in
+ --identifier|-t)
+ comps=''
+ ;;
+ --priority|-p)
+ comps='emerg alert crit err warning notice info debug'
+ ;;
+ --level-prefix)
+ comps='yes no'
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
+ return 0
+ fi
+
+ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
+}
+
+complete -F _systemd_cat systemd-cat

View File

@ -1,111 +0,0 @@
From 4c626a758f12c2e5862b185de8ae954e0bd795d7 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 5 Mar 2014 03:37:48 +0100
Subject: [PATCH] man: document missing options of systemd-run
(cherry picked from commit 981ee551945f4e00de52fcbb7780fd7476bcd47e)
---
man/systemd-run.xml | 71 ++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 60 insertions(+), 11 deletions(-)
diff --git a/man/systemd-run.xml b/man/systemd-run.xml
index 064195a..dc44186 100644
--- a/man/systemd-run.xml
+++ b/man/systemd-run.xml
@@ -109,9 +109,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<varlistentry>
<term><option>--description=</option></term>
- <listitem><para>Provide description for the unit. If not
- specified, the command itself will be used as a description.
- See <varname>Description=</varname> in
+ <listitem><para>Provide description for the service or scope
+ unit. If not specified, the command itself will be used as a
+ description. See <varname>Description=</varname> in
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
</varlistentry>
@@ -128,10 +128,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<varlistentry>
<term><option>--remain-after-exit</option></term>
- <listitem><para>After the service's process has terminated, keep
- the service around until it is explicitly stopped. This is
- useful to collect runtime information about the service after
- it finished running. Also see
+ <listitem><para>After the service or scope process has
+ terminated, keep the service around until it is explicitly
+ stopped. This is useful to collect runtime information about
+ the service after it finished running. Also see
<varname>RemainAfterExit=</varname> in
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
@@ -141,15 +141,64 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<varlistentry>
<term><option>--send-sighup</option></term>
- <listitem><para>When terminating the scope unit, send a SIGHUP
- immediately after SIGTERM. This is useful to indicate to
- shells and shell-like processes that the connection has been
- severed. Also see <varname>SendSIGHUP=</varname> in
+ <listitem><para>When terminating the scope or service unit,
+ send a SIGHUP immediately after SIGTERM. This is useful to
+ indicate to shells and shell-like processes that the
+ connection has been severed. Also see
+ <varname>SendSIGHUP=</varname> in
<citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--service-type=</option></term>
+
+ <listitem><para>Sets the service type. Also see
+ <varname>Type=</varname> in
+ <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This
+ option has no effect in conjunction with
+ <option>--scope</option>. Defaults to
+ <constant>simple</constant>.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--uid=</option></term>
+ <term><option>--gid=</option></term>
+
+ <listitem><para>Runs the service process under the UNIX user
+ and group. Also see <varname>User=</varname> and
+ <varname>Group=</varname> in
+ <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This
+ option has no effect in conjunction with
+ <option>--scope</option>.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--nice=</option></term>
+
+ <listitem><para>Runs the service process with the specified
+ nice level. Also see <varname>Nice=</varname> in
+ <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This
+ option has no effect in conjunction with
+ <option>--scope</option>.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--setenv=</option></term>
+
+ <listitem><para>Runs the service process with the specified
+ environment variables set. Also see
+ <varname>Environment=</varname> in
+ <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This
+ option has no effect in conjunction with
+ <option>--scope</option>.</para>
+ </listitem>
+ </varlistentry>
+
<xi:include href="user-system-options.xml" xpointer="user" />
<xi:include href="user-system-options.xml" xpointer="system" />
<xi:include href="user-system-options.xml" xpointer="host" />

View File

@ -1,32 +0,0 @@
From 37c3628037acb728660222ad836047c8bb81363f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 5 Mar 2014 03:38:36 +0100
Subject: [PATCH] systemd-run: add some extra safety checks
(cherry picked from commit 1ac67edb7c4d31a287fa98c0b554ae98bd34e71b)
---
src/run/run.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/run/run.c b/src/run/run.c
index 885d881..7f08c41 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -37,7 +37,7 @@ static const char *arg_description = NULL;
static const char *arg_slice = NULL;
static bool arg_send_sighup = false;
static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
-static char *arg_host = NULL;
+static const char *arg_host = NULL;
static bool arg_user = false;
static const char *arg_service_type = NULL;
static const char *arg_exec_user = NULL;
@@ -183,7 +183,7 @@ static int parse_argv(int argc, char *argv[]) {
case ARG_NICE:
r = safe_atoi(optarg, &arg_nice);
- if (r < 0) {
+ if (r < 0 || arg_nice < PRIO_MIN || arg_nice >= PRIO_MAX) {
log_error("Failed to parse nice value");
return -EINVAL;
}

View File

@ -1,68 +0,0 @@
From c77f203a510d27ab08729454bc865547c6111d02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 27 Feb 2014 00:07:29 -0500
Subject: [PATCH] journal: assume that next entry is after previous entry
With a corrupted file, we can get in a situation where two entries
in the entry array point to the same object. Then journal_file_next_entry
will find the first one using generic_arrray_bisect, and try to move to
the second one, but since the address is the same, generic_array_get will
return the first one. journal_file_next_entry ends up in an infinite loop.
https://bugzilla.redhat.com/show_bug.cgi?id=1047039
(cherry picked from commit fb099c8d2af6620db2709e826a258089d10cdfe8)
---
src/journal/journal-file.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 23c4d28..c27289c 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1359,7 +1359,7 @@ int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st
}
typedef struct ChainCacheItem {
- uint64_t first; /* the array at the begin of the chain */
+ uint64_t first; /* the array at the beginning of the chain */
uint64_t array; /* the cached array */
uint64_t begin; /* the first item in the cached array */
uint64_t total; /* the total number of items in all arrays before this one in the chain */
@@ -1945,7 +1945,7 @@ int journal_file_next_entry(
direction_t direction,
Object **ret, uint64_t *offset) {
- uint64_t i, n;
+ uint64_t i, n, ofs;
int r;
assert(f);
@@ -1986,10 +1986,24 @@ int journal_file_next_entry(
}
/* And jump to it */
- return generic_array_get(f,
- le64toh(f->header->entry_array_offset),
- i,
- ret, offset);
+ r = generic_array_get(f,
+ le64toh(f->header->entry_array_offset),
+ i,
+ ret, &ofs);
+ if (r <= 0)
+ return r;
+
+ if (p > 0 &&
+ (direction == DIRECTION_DOWN ? ofs <= p : ofs >= p)) {
+ log_debug("%s: entry array corrupted at entry %"PRIu64,
+ f->path, i);
+ return -EBADMSG;
+ }
+
+ if (offset)
+ *offset = ofs;
+
+ return 1;
}
int journal_file_skip_entry(

View File

@ -1,73 +0,0 @@
From c360d2f3141cdc8ec67cddef3df99e4045b6c6d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 27 Feb 2014 00:11:54 -0500
Subject: [PATCH] journal: forget file after encountering an error
If we encounter an inconsistency in a file, let's just
ignore it. Otherwise, after previous patch, we would try,
and fail, to use this file in every invocation of sd_journal_next
or sd_journal_previous that happens afterwards.
(cherry picked from commit a9a245c128af6c0418085062c60251bc51fa4a94)
---
src/journal/sd-journal.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 3740a9a..2dbfda0 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -51,6 +51,8 @@
#define DEFAULT_DATA_THRESHOLD (64*1024)
+static void remove_file_real(sd_journal *j, JournalFile *f);
+
static bool journal_pid_changed(sd_journal *j) {
assert(j);
@@ -885,6 +887,7 @@ static int real_journal_next(sd_journal *j, direction_t direction) {
r = next_beyond_location(j, f, direction, &o, &p);
if (r < 0) {
log_debug("Can't iterate through %s, ignoring: %s", f->path, strerror(-r));
+ remove_file_real(j, f);
continue;
} else if (r == 0)
continue;
@@ -1339,7 +1342,7 @@ static int add_file(sd_journal *j, const char *prefix, const char *filename) {
}
static int remove_file(sd_journal *j, const char *prefix, const char *filename) {
- char *path;
+ _cleanup_free_ char *path;
JournalFile *f;
assert(j);
@@ -1351,10 +1354,17 @@ static int remove_file(sd_journal *j, const char *prefix, const char *filename)
return -ENOMEM;
f = hashmap_get(j->files, path);
- free(path);
if (!f)
return 0;
+ remove_file_real(j, f);
+ return 0;
+}
+
+static void remove_file_real(sd_journal *j, JournalFile *f) {
+ assert(j);
+ assert(f);
+
hashmap_remove(j->files, f->path);
log_debug("File %s removed.", f->path);
@@ -1372,8 +1382,6 @@ static int remove_file(sd_journal *j, const char *prefix, const char *filename)
journal_file_close(f);
j->current_invalidate_counter ++;
-
- return 0;
}
static int add_directory(sd_journal *j, const char *prefix, const char *dirname) {

View File

@ -1,100 +0,0 @@
From dd935122a989eeb31a0ab4d42ad5381f1f48446e Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 6 Mar 2014 02:19:42 +0100
Subject: [PATCH] core: correctly unregister PIDs from PID hashtables
(cherry picked from commit bd44e61b0480712ec5585ff7b0295362a5f9dd36)
---
src/core/unit.c | 42 ++++++++++++++++++------------------------
1 file changed, 18 insertions(+), 24 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 1bbcb39..5a5592c 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1703,11 +1703,11 @@ int unit_watch_pid(Unit *u, pid_t pid) {
/* Watch a specific PID. We only support one or two units
* watching each PID for now, not more. */
- r = hashmap_ensure_allocated(&u->manager->watch_pids1, trivial_hash_func, trivial_compare_func);
+ r = set_ensure_allocated(&u->pids, trivial_hash_func, trivial_compare_func);
if (r < 0)
return r;
- r = set_ensure_allocated(&u->pids, trivial_hash_func, trivial_compare_func);
+ r = hashmap_ensure_allocated(&u->manager->watch_pids1, trivial_hash_func, trivial_compare_func);
if (r < 0)
return r;
@@ -1736,7 +1736,17 @@ void unit_unwatch_pid(Unit *u, pid_t pid) {
set_remove(u->pids, LONG_TO_PTR(pid));
}
-static int watch_pids_in_path(Unit *u, const char *path) {
+void unit_unwatch_all_pids(Unit *u) {
+ assert(u);
+
+ while (!set_isempty(u->pids))
+ unit_unwatch_pid(u, PTR_TO_LONG(set_first(u->pids)));
+
+ set_free(u->pids);
+ u->pids = NULL;
+}
+
+static int unit_watch_pids_in_path(Unit *u, const char *path) {
_cleanup_closedir_ DIR *d = NULL;
_cleanup_fclose_ FILE *f = NULL;
int ret = 0, r;
@@ -1774,7 +1784,7 @@ static int watch_pids_in_path(Unit *u, const char *path) {
if (!p)
return -ENOMEM;
- r = watch_pids_in_path(u, p);
+ r = unit_watch_pids_in_path(u, p);
if (r < 0 && ret >= 0)
ret = r;
}
@@ -1787,31 +1797,15 @@ static int watch_pids_in_path(Unit *u, const char *path) {
return ret;
}
-
int unit_watch_all_pids(Unit *u) {
assert(u);
- if (!u->cgroup_path)
- return -ENOENT;
-
/* Adds all PIDs from our cgroup to the set of PIDs we watch */
- return watch_pids_in_path(u, u->cgroup_path);
-}
-
-void unit_unwatch_all_pids(Unit *u) {
- Iterator i;
- void *e;
-
- assert(u);
-
- SET_FOREACH(e, u->pids, i) {
- hashmap_remove_value(u->manager->watch_pids1, e, u);
- hashmap_remove_value(u->manager->watch_pids2, e, u);
- }
+ if (!u->cgroup_path)
+ return -ENOENT;
- set_free(u->pids);
- u->pids = NULL;
+ return unit_watch_pids_in_path(u, u->cgroup_path);
}
void unit_tidy_watch_pids(Unit *u, pid_t except1, pid_t except2) {
@@ -1829,7 +1823,7 @@ void unit_tidy_watch_pids(Unit *u, pid_t except1, pid_t except2) {
continue;
if (!pid_is_unwaited(pid))
- set_remove(u->pids, e);
+ unit_unwatch_pid(u, pid);
}
}

View File

@ -1,23 +0,0 @@
From b7bc83734b75499d3bf9d5446adcb43818796da5 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 6 Mar 2014 04:52:31 +0100
Subject: [PATCH] logind: fix reference to systemd-user-sessions.service
(cherry picked from commit 646e392e10924454576f10b072f78d7676422816)
---
src/login/logind-session.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 548f049..3700522 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -490,7 +490,7 @@ static int session_start_scope(Session *s) {
if (!scope)
return log_oom();
- r = manager_start_scope(s->manager, scope, s->leader, s->user->slice, description, "systemd-logind.service", "systemd-user-session.service", &error, &job);
+ r = manager_start_scope(s->manager, scope, s->leader, s->user->slice, description, "systemd-logind.service", "systemd-user-sessions.service", &error, &job);
if (r < 0) {
log_error("Failed to start session scope %s: %s %s",
scope, bus_error_message(&error, r), error.name);

View File

@ -1,33 +0,0 @@
From bc447bbd474ed77da1a9cce0dcf85fb4f0e7cb35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 6 Mar 2014 08:10:19 -0500
Subject: [PATCH] man: update link to LSB
https://bugzilla.redhat.com/show_bug.cgi?id=1073402
(cherry picked from commit 27d14fb331ba8144f99f4da2d13f15cf5c8b8a9f)
---
man/daemon.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/daemon.xml b/man/daemon.xml
index fd29ba7..ab58d08 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -252,7 +252,7 @@
detect service errors and problems. It
is recommended to follow the exit code
scheme as defined in the <ulink
- url="http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html">LSB
+ url="http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html">LSB
recommendations for SysV init
scripts</ulink>.</para></listitem>
@@ -395,7 +395,7 @@
exclusively on boot (and manually by the
administrator) via SysV init scripts, as
detailed in the <ulink
- url="http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html">LSB
+ url="http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html">LSB
Linux Standard Base Core
Specification</ulink>. This method of
activation is supported ubiquitously on Linux

View File

@ -1,27 +0,0 @@
From 7117b40be2484d2f318c14d42b8c1f47d44a4465 Mon Sep 17 00:00:00 2001
From: Zachary Cook <zachcook1991@gmail.com>
Date: Thu, 6 Mar 2014 03:49:49 -0500
Subject: [PATCH] man: systemd-bootchart - fix spacing in command
Use the same formatting as the systemd-analyze man page, so that man shows a space.
(cherry picked from commit 82ed60080d327d7301fcd55f5a1f8511f894b9d5)
---
man/systemd-bootchart.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/systemd-bootchart.xml b/man/systemd-bootchart.xml
index d0adaad..1715d5d 100644
--- a/man/systemd-bootchart.xml
+++ b/man/systemd-bootchart.xml
@@ -78,8 +78,8 @@
in which order, and where possible problems
exist in the startup sequence of the system.
It is essentially a more detailed version of
- the <command>systemd-analyze</command>
- <command>plot</command> function.
+ the <command>systemd-analyze plot</command>
+ function.
</para>
<para>
Of course, bootchart can also be used at any

View File

@ -1,25 +0,0 @@
From a478182ddc3abcacd006ecef8de8829c3ec51b13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 6 Mar 2014 23:54:13 -0500
Subject: [PATCH] man: add missing comma
marcosf0> missing comma in udevadm "see also" section
(cherry picked from commit 7d06ef0a5cd2f0a4e021d3d12f3841cce529e0f2)
---
man/udevadm.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/udevadm.xml b/man/udevadm.xml
index a3f8d54..21d1443 100644
--- a/man/udevadm.xml
+++ b/man/udevadm.xml
@@ -594,7 +594,7 @@
<title>See Also</title>
<para><citerefentry>
<refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
- </citerefentry>
+ </citerefentry>,
<citerefentry>
<refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
</citerefentry></para>

View File

@ -1,38 +0,0 @@
From 66f231f4c71dfb11dc4552cb337571d3e3019c81 Mon Sep 17 00:00:00 2001
From: Armin K <krejzi@email.com>
Date: Tue, 4 Mar 2014 16:23:41 +0100
Subject: [PATCH] build-sys: Don't distribute generated udev rule
It contains hardcoded path to systemd-sysctl executable which
is /usr/lib/systemd/systemd-sysctl on latest stable release and
as such it will complain at runtime if rootprefix != prefix
[zj: readd the file to nodist_udevrules_DATA]
(cherry picked from commit e2eb18d56b14eeb405706970f0460d8539cdcf23)
---
Makefile.am | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 7187b8d..8093526 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2518,7 +2518,6 @@ dist_network_DATA = \
network/80-container-host0.network
dist_udevrules_DATA += \
- rules/99-systemd.rules \
rules/42-usb-hid-pm.rules \
rules/50-udev-default.rules \
rules/60-drm.rules \
@@ -2535,6 +2534,9 @@ dist_udevrules_DATA += \
rules/80-net-setup-link.rules \
rules/95-udev-late.rules
+nodist_udevrules_DATA += \
+ rules/99-systemd.rules
+
dist_udevhwdb_DATA = \
hwdb/20-pci-vendor-model.hwdb \
hwdb/20-pci-classes.hwdb \

View File

@ -1,37 +0,0 @@
From 50ab7a793277bd976ea68c1d74b999ce483af50b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20B=C3=A4chler?= <thomas@archlinux.org>
Date: Fri, 7 Mar 2014 01:50:34 +0100
Subject: [PATCH] units: Do not unescape instance name in
systemd-backlight@.service
The instance name is never escaped in the udev rule, but unescaped in the unit.
This results in the following error message on Asus boards:
Failed to get backlight or LED device 'backlight:eeepc/wmi': No such file or directory
(cherry picked from commit 6c49212741253dae05b89d22374186f092ef1e5a)
---
units/systemd-backlight@.service.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/units/systemd-backlight@.service.in b/units/systemd-backlight@.service.in
index 5caa5d5..e945d87 100644
--- a/units/systemd-backlight@.service.in
+++ b/units/systemd-backlight@.service.in
@@ -6,7 +6,7 @@
# (at your option) any later version.
[Unit]
-Description=Load/Save Screen Backlight Brightness of %I
+Description=Load/Save Screen Backlight Brightness of %i
Documentation=man:systemd-backlight@.service(8)
DefaultDependencies=no
RequiresMountsFor=/var/lib/systemd/backlight
@@ -17,5 +17,5 @@ Before=sysinit.target shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart=@rootlibexecdir@/systemd-backlight load %I
-ExecStop=@rootlibexecdir@/systemd-backlight save %I
+ExecStart=@rootlibexecdir@/systemd-backlight load %i
+ExecStop=@rootlibexecdir@/systemd-backlight save %i

View File

@ -1,310 +0,0 @@
From d66226bce64620543d21675ae610ecfeb9395e2a Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 6 Mar 2014 02:19:06 +0100
Subject: [PATCH] util: add timeout to generator execution
(cherry picked from commit aa62a8936f5983770e90b791083d55107659f7a1)
---
src/core/manager.c | 2 +-
src/core/shutdown.c | 2 +-
src/shared/util.c | 162 ++++++++++++++++++++++++++++------------------------
src/shared/util.h | 2 +-
src/sleep/sleep.c | 14 +++--
5 files changed, 99 insertions(+), 83 deletions(-)
diff --git a/src/core/manager.c b/src/core/manager.c
index f5801b4..7c7f088 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -2654,7 +2654,7 @@ void manager_run_generators(Manager *m) {
argv[4] = NULL;
RUN_WITH_UMASK(0022)
- execute_directory(generator_path, d, (char**) argv);
+ execute_directory(generator_path, d, DEFAULT_TIMEOUT_USEC, (char**) argv);
finish:
trim_generator_dir(m, &m->generator_unit_path);
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index c751030..7ef671a 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -368,7 +368,7 @@ int main(int argc, char *argv[]) {
arguments[0] = NULL;
arguments[1] = arg_verb;
arguments[2] = NULL;
- execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, arguments);
+ execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, DEFAULT_TIMEOUT_USEC, arguments);
if (!in_container && !in_initrd() &&
access("/run/initramfs/shutdown", X_OK) == 0) {
diff --git a/src/shared/util.c b/src/shared/util.c
index 3164515..0d64ede 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3681,111 +3681,123 @@ bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {
return endswith(de->d_name, suffix);
}
-void execute_directory(const char *directory, DIR *d, char *argv[]) {
- DIR *_d = NULL;
- struct dirent *de;
- Hashmap *pids = NULL;
+void execute_directory(const char *directory, DIR *d, usec_t timeout, char *argv[]) {
+ pid_t executor_pid;
+ int r;
assert(directory);
- /* Executes all binaries in a directory in parallel and
- * waits for them to finish. */
+ /* Executes all binaries in a directory in parallel and waits
+ * for them to finish. Optionally a timeout is applied. */
- if (!d) {
- if (!(_d = opendir(directory))) {
+ executor_pid = fork();
+ if (executor_pid < 0) {
+ log_error("Failed to fork: %m");
+ return;
- if (errno == ENOENT)
- return;
+ } else if (executor_pid == 0) {
+ _cleanup_hashmap_free_free_ Hashmap *pids = NULL;
+ _cleanup_closedir_ DIR *_d = NULL;
+ struct dirent *de;
+ sigset_t ss;
- log_error("Failed to enumerate directory %s: %m", directory);
- return;
- }
+ /* We fork this all off from a child process so that
+ * we can somewhat cleanly make use of SIGALRM to set
+ * a time limit */
- d = _d;
- }
+ reset_all_signal_handlers();
- if (!(pids = hashmap_new(trivial_hash_func, trivial_compare_func))) {
- log_error("Failed to allocate set.");
- goto finish;
- }
+ assert_se(sigemptyset(&ss) == 0);
+ assert_se(sigprocmask(SIG_SETMASK, &ss, NULL) == 0);
- while ((de = readdir(d))) {
- char *path;
- pid_t pid;
- int k;
+ assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0);
- if (!dirent_is_file(de))
- continue;
+ if (!d) {
+ d = _d = opendir(directory);
+ if (!d) {
+ if (errno == ENOENT)
+ _exit(EXIT_SUCCESS);
- if (asprintf(&path, "%s/%s", directory, de->d_name) < 0) {
- log_oom();
- continue;
+ log_error("Failed to enumerate directory %s: %m", directory);
+ _exit(EXIT_FAILURE);
+ }
}
- if ((pid = fork()) < 0) {
- log_error("Failed to fork: %m");
- free(path);
- continue;
+ pids = hashmap_new(NULL, NULL);
+ if (!pids) {
+ log_oom();
+ _exit(EXIT_FAILURE);
}
- if (pid == 0) {
- char *_argv[2];
- /* Child */
+ FOREACH_DIRENT(de, d, break) {
+ _cleanup_free_ char *path = NULL;
+ pid_t pid;
- if (!argv) {
- _argv[0] = path;
- _argv[1] = NULL;
- argv = _argv;
- } else
- argv[0] = path;
+ if (!dirent_is_file(de))
+ continue;
- execv(path, argv);
+ if (asprintf(&path, "%s/%s", directory, de->d_name) < 0) {
+ log_oom();
+ _exit(EXIT_FAILURE);
+ }
- log_error("Failed to execute %s: %m", path);
- _exit(EXIT_FAILURE);
- }
+ pid = fork();
+ if (pid < 0) {
+ log_error("Failed to fork: %m");
+ continue;
+ } else if (pid == 0) {
+ char *_argv[2];
- log_debug("Spawned %s as %lu", path, (unsigned long) pid);
+ assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0);
- if ((k = hashmap_put(pids, UINT_TO_PTR(pid), path)) < 0) {
- log_error("Failed to add PID to set: %s", strerror(-k));
- free(path);
- }
- }
+ if (!argv) {
+ _argv[0] = path;
+ _argv[1] = NULL;
+ argv = _argv;
+ } else
+ argv[0] = path;
- while (!hashmap_isempty(pids)) {
- pid_t pid = PTR_TO_UINT(hashmap_first_key(pids));
- siginfo_t si = {};
- char *path;
+ execv(path, argv);
+ log_error("Failed to execute %s: %m", path);
+ _exit(EXIT_FAILURE);
+ }
- if (waitid(P_PID, pid, &si, WEXITED) < 0) {
- if (errno == EINTR)
- continue;
+ log_debug("Spawned %s as " PID_FMT ".", path, pid);
- log_error("waitid() failed: %m");
- goto finish;
+ r = hashmap_put(pids, UINT_TO_PTR(pid), path);
+ if (r < 0) {
+ log_oom();
+ _exit(EXIT_FAILURE);
+ }
+
+ path = NULL;
}
- if ((path = hashmap_remove(pids, UINT_TO_PTR(si.si_pid)))) {
- if (!is_clean_exit(si.si_code, si.si_status, NULL)) {
- if (si.si_code == CLD_EXITED)
- log_error("%s exited with exit status %i.", path, si.si_status);
- else
- log_error("%s terminated by signal %s.", path, signal_to_string(si.si_status));
- } else
- log_debug("%s exited successfully.", path);
+ /* Abort execution of this process after the
+ * timout. We simply rely on SIGALRM as default action
+ * terminating the process, and turn on alarm(). */
+
+ if (timeout != (usec_t) -1)
+ alarm((timeout + USEC_PER_SEC - 1) / USEC_PER_SEC);
+
+ while (!hashmap_isempty(pids)) {
+ _cleanup_free_ char *path = NULL;
+ pid_t pid;
+
+ pid = PTR_TO_UINT(hashmap_first_key(pids));
+ assert(pid > 0);
- free(path);
+ path = hashmap_remove(pids, UINT_TO_PTR(pid));
+ assert(path);
+
+ wait_for_terminate_and_warn(path, pid);
}
- }
-finish:
- if (_d)
- closedir(_d);
+ _exit(EXIT_SUCCESS);
+ }
- if (pids)
- hashmap_free_free(pids);
+ wait_for_terminate_and_warn(directory, executor_pid);
}
int kill_and_sigcont(pid_t pid, int sig) {
diff --git a/src/shared/util.h b/src/shared/util.h
index 78b1444..aeb359b 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -473,7 +473,7 @@ bool tty_is_console(const char *tty) _pure_;
int vtnr_from_tty(const char *tty);
const char *default_term_for_tty(const char *tty);
-void execute_directory(const char *directory, DIR *_d, char *argv[]);
+void execute_directory(const char *directory, DIR *_d, usec_t timeout, char *argv[]);
int kill_and_sigcont(pid_t pid, int sig);
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index 8da050c..94bcb29 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -25,14 +25,15 @@
#include <string.h>
#include <getopt.h>
-#include "systemd/sd-id128.h"
-#include "systemd/sd-messages.h"
+#include "sd-id128.h"
+#include "sd-messages.h"
#include "log.h"
#include "util.h"
#include "strv.h"
#include "fileio.h"
#include "build.h"
#include "sleep-config.h"
+#include "def.h"
static char* arg_verb = NULL;
@@ -41,9 +42,12 @@ static int write_mode(char **modes) {
char **mode;
STRV_FOREACH(mode, modes) {
- int k = write_string_file("/sys/power/disk", *mode);
+ int k;
+
+ k = write_string_file("/sys/power/disk", *mode);
if (k == 0)
return 0;
+
log_debug("Failed to write '%s' to /sys/power/disk: %s",
*mode, strerror(-k));
if (r == 0)
@@ -106,7 +110,7 @@ static int execute(char **modes, char **states) {
arguments[1] = (char*) "pre";
arguments[2] = arg_verb;
arguments[3] = NULL;
- execute_directory(SYSTEM_SLEEP_PATH, NULL, arguments);
+ execute_directory(SYSTEM_SLEEP_PATH, NULL, DEFAULT_TIMEOUT_USEC, arguments);
log_struct(LOG_INFO,
MESSAGE_ID(SD_MESSAGE_SLEEP_START),
@@ -125,7 +129,7 @@ static int execute(char **modes, char **states) {
NULL);
arguments[1] = (char*) "post";
- execute_directory(SYSTEM_SLEEP_PATH, NULL, arguments);
+ execute_directory(SYSTEM_SLEEP_PATH, NULL, DEFAULT_TIMEOUT_USEC, arguments);
return r;
}

View File

@ -1,28 +0,0 @@
From acf94f3de1060fad3fc8434ccf12b66835cfba83 Mon Sep 17 00:00:00 2001
From: Daniel Mack <zonque@gmail.com>
Date: Fri, 7 Mar 2014 11:41:18 +0100
Subject: [PATCH] core/busname: add lookup string for
BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT
When a busname unit enters BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT, the
serialization will not be able to look up the result as string via
busname_result_to_string(). This leads to an assertion trap during
daemon-reexec.
(cherry picked from commit 36d239dbdaf94ba2d96bb60ac45ecfc58624b1eb)
---
src/core/busname.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/core/busname.c b/src/core/busname.c
index 4c34538..237011a 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -548,6 +548,7 @@ DEFINE_STRING_TABLE_LOOKUP(busname_state, BusNameState);
static const char* const busname_result_table[_BUSNAME_RESULT_MAX] = {
[BUSNAME_SUCCESS] = "success",
[BUSNAME_FAILURE_RESOURCES] = "resources",
+ [BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT] = "failed-permanent",
};
DEFINE_STRING_TABLE_LOOKUP(busname_result, BusNameResult);

View File

@ -1,23 +0,0 @@
From bca84126f2b46068aa0d98c3e35245d6ace9b9dc Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 7 Mar 2014 17:29:16 +0100
Subject: [PATCH] busname: don't drop 'service' from the result string
(cherry picked from commit 700ff4d97311902a440109a2c081731ab6ae8a20)
---
src/core/busname.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/busname.c b/src/core/busname.c
index 237011a..bca2145 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -548,7 +548,7 @@ DEFINE_STRING_TABLE_LOOKUP(busname_state, BusNameState);
static const char* const busname_result_table[_BUSNAME_RESULT_MAX] = {
[BUSNAME_SUCCESS] = "success",
[BUSNAME_FAILURE_RESOURCES] = "resources",
- [BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT] = "failed-permanent",
+ [BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT] = "service-failed-permanent",
};
DEFINE_STRING_TABLE_LOOKUP(busname_result, BusNameResult);

View File

@ -1,44 +0,0 @@
From b1fc5bc6e56e6b2abd5e1f0782654d22f1220dc5 Mon Sep 17 00:00:00 2001
From: Daniel Mack <zonque@gmail.com>
Date: Fri, 7 Mar 2014 14:43:59 +0100
Subject: [PATCH] manager: flush memory stream before using the buffer
When the manager receives a SIGUSR2 signal, it opens a memory stream
with open_memstream(), uses the returned file handle for logging, and
dumps the logged content with log_dump().
However, the char* buffer is only safe to use after the file handle has
been flushed with fflush, as the man pages states:
When the stream is closed (fclose(3)) or flushed (fflush(3)), the
locations pointed to by ptr and sizeloc are updated to contain,
respectively, a pointer to the buffer and the current size of the
buffer.
These values remain valid only as long as the caller performs no
further output on the stream. If further output is performed, then the
stream must again be flushed before trying to access these variables.
Without that call, dump remains NULL and the daemon crashes in
log_dump().
(cherry picked from commit b2cdc6664ef6b56e47d38649d69b9943d9f9f5d0)
---
src/core/manager.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/core/manager.c b/src/core/manager.c
index 7c7f088..ee92f1b 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1618,6 +1618,11 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t
break;
}
+ if (fflush(f)) {
+ log_warning("Failed to flush status stream");
+ break;
+ }
+
log_dump(LOG_INFO, dump);
break;
}

View File

@ -1,34 +0,0 @@
From d1df055e24f9daaeda39ee8a57429849c78f71d4 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Sat, 8 Mar 2014 01:08:30 +0100
Subject: [PATCH] networkd: link - degrade failed UP to warning
Something else may still bring the link up, so don't enter failed state prematurely.
(cherry picked from commit 76800848f281c3705c9364fd3e888153d94aaf34)
---
src/network/networkd-link.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 1f495b3..5831d83 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -790,15 +790,13 @@ static int link_up_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
return 1;
r = sd_rtnl_message_get_errno(m);
- if (r < 0) {
- log_struct_link(LOG_ERR, link,
+ if (r < 0)
+ log_struct_link(LOG_WARNING, link,
"MESSAGE=%s: could not bring up interface: %s",
link->ifname, strerror(-r),
"ERRNO=%d", -r,
NULL);
- link_enter_failed(link);
return 1;
- }
link_update_flags(link, link->flags | IFF_UP);

View File

@ -1,36 +0,0 @@
From c0229d82761b6c4874acf7a37023b363cd85ec35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 8 Mar 2014 11:57:28 -0500
Subject: [PATCH] networkd: fix confusion from missing braces
Fixup for 76800848f281c3 'networkd: link - degrade failed UP to warning'.
(cherry picked from commit 58b129170ca6acacffd853b6c8fbec9fce2c2163)
---
src/network/networkd-link.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 5831d83..305ce23 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -790,16 +790,14 @@ static int link_up_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
return 1;
r = sd_rtnl_message_get_errno(m);
- if (r < 0)
+ if (r >= 0)
+ link_update_flags(link, link->flags | IFF_UP);
+ else
log_struct_link(LOG_WARNING, link,
"MESSAGE=%s: could not bring up interface: %s",
link->ifname, strerror(-r),
"ERRNO=%d", -r,
NULL);
- return 1;
-
- link_update_flags(link, link->flags | IFF_UP);
-
return 1;
}

View File

@ -1,34 +0,0 @@
From 30711a3651f5b31cb67422bf8197e05d557dbe23 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Sat, 8 Mar 2014 17:32:53 -0500
Subject: [PATCH] fix off by one error in array index assertion
Since the index is already post-incremented when the array is appended
to, this assertion can be wrongly reached when the array is at capacity
(with the NULL terminator). The bug is reproducible on shutdown with
the following settings in /etc/systemd/system.conf:
LogTarget=journal-or-kmsg
LogColor=yes
LogLocation=yes
Reported by Thermi on IRC.
(cherry picked from commit 26abdc73a212b90f7c4b71808a1028d2e87ab09f)
---
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 4e24f85..15bf684 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1940,7 +1940,7 @@ finish:
if (log_get_show_location())
command_line[pos++] = "--log-location";
- assert(pos + 1 < ELEMENTSOF(command_line));
+ assert(pos < ELEMENTSOF(command_line));
if (arm_reboot_watchdog && arg_shutdown_watchdog > 0) {
char *e;

View File

@ -1,53 +0,0 @@
From 33fc27712a13b7502804a2a3016ce490a89e000d Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Mon, 10 Mar 2014 08:54:22 +0100
Subject: [PATCH] input_id: Recognize buttonless joystick types
Input devices like rudders or pedals are joystick-like; they don't have
buttons, but axes like RX, THROTTLE, or RUDDER. These don't interfere with
other device types with absolute axes (touch screens, touchpads, and
accelerometers), so it's fairly safe to mark them as ID_INPUT_JOYSTICK and thus
hand out dynamic ACLs to the user.
https://bugs.freedesktop.org/show_bug.cgi?id=70734
(cherry picked from commit 2658624399b22a9c4a345a22c69886dc9417f801)
---
src/udev/udev-builtin-input_id.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c
index 828b349..3b2e897 100644
--- a/src/udev/udev-builtin-input_id.c
+++ b/src/udev/udev-builtin-input_id.c
@@ -116,16 +116,27 @@ static void test_pointers (struct udev_device *dev,
udev_builtin_add_property(dev, test, "ID_INPUT_TABLET", "1");
else if (test_bit (BTN_TOOL_FINGER, bitmask_key) && !test_bit (BTN_TOOL_PEN, bitmask_key))
is_touchpad = 1;
- else if (test_bit (BTN_TRIGGER, bitmask_key) ||
- test_bit (BTN_A, bitmask_key) ||
- test_bit (BTN_1, bitmask_key))
- udev_builtin_add_property(dev, test, "ID_INPUT_JOYSTICK", "1");
else if (test_bit (BTN_MOUSE, bitmask_key))
/* This path is taken by VMware's USB mouse, which has
* absolute axes, but no touch/pressure button. */
is_mouse = 1;
else if (test_bit (BTN_TOUCH, bitmask_key))
udev_builtin_add_property(dev, test, "ID_INPUT_TOUCHSCREEN", "1");
+ /* joysticks don't necessarily have to have buttons; e. g.
+ * rudders/pedals are joystick-like, but buttonless; they have
+ * other fancy axes */
+ else if (test_bit (BTN_TRIGGER, bitmask_key) ||
+ test_bit (BTN_A, bitmask_key) ||
+ test_bit (BTN_1, bitmask_key) ||
+ test_bit (ABS_RX, bitmask_abs) ||
+ test_bit (ABS_RY, bitmask_abs) ||
+ test_bit (ABS_RZ, bitmask_abs) ||
+ test_bit (ABS_THROTTLE, bitmask_abs) ||
+ test_bit (ABS_RUDDER, bitmask_abs) ||
+ test_bit (ABS_WHEEL, bitmask_abs) ||
+ test_bit (ABS_GAS, bitmask_abs) ||
+ test_bit (ABS_BRAKE, bitmask_abs))
+ udev_builtin_add_property(dev, test, "ID_INPUT_JOYSTICK", "1");
}
if (test_bit (EV_REL, bitmask_ev) &&

View File

@ -1,41 +0,0 @@
From 10ff861167dc4b03ad9e515141f535845fcfd38a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 10 Mar 2014 08:25:15 -0400
Subject: [PATCH] logind: fix policykit checks
(cherry picked from commit 055d406624cb9e01963558767420b71e5f75d2d3)
---
src/login/logind-dbus.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index fc89531..18d4a56 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1477,6 +1477,8 @@ static int method_do_shutdown_or_sleep(
action_multiple_sessions, interactive, error, method, m);
if (r < 0)
return r;
+ if (r == 0)
+ return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
}
if (blocked) {
@@ -1484,6 +1486,8 @@ static int method_do_shutdown_or_sleep(
action_ignore_inhibit, interactive, error, method, m);
if (r < 0)
return r;
+ if (r == 0)
+ return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
}
if (!multiple_sessions && !blocked) {
@@ -1491,6 +1495,8 @@ static int method_do_shutdown_or_sleep(
action, interactive, error, method, m);
if (r < 0)
return r;
+ if (r == 0)
+ return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
}
r = bus_manager_shutdown_or_sleep_now_or_later(m, unit_name, w, error);

View File

@ -1,76 +0,0 @@
From 91dd24f207a5cb93227d4a7d364f033bfd572a31 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 10 Mar 2014 21:36:01 +0100
Subject: [PATCH] nspawn: don't try mknod() of /dev/console with the correct
major/minor
We overmount /dev/console with an external pty anyway, hence there's no
point in using the real major/minor when we create the node to
overmount. Instead, use the one of /dev/null now.
This fixes a race against the cgroup device controller setup we are
using. In case /dev/console was create before the cgroup policy was
applied all was good, but if created in the opposite order the mknod()
would fail, since creating /dev/console is not allowed by it. Creating
/dev/null instances is however permitted, and hence use it.
(cherry picked from commit eb0f0863f5af48865fb4569e2076d5f9e2313995)
---
src/nspawn/nspawn.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 84b7276..091307b 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -852,23 +852,19 @@ static int setup_ptmx(const char *dest) {
}
static int setup_dev_console(const char *dest, const char *console) {
+ _cleanup_umask_ mode_t u;
+ const char *to;
struct stat st;
- _cleanup_free_ char *to = NULL;
int r;
- _cleanup_umask_ mode_t u;
assert(dest);
assert(console);
u = umask(0000);
- if (stat(console, &st) < 0) {
- log_error("Failed to stat %s: %m", console);
+ if (stat("/dev/null", &st) < 0) {
+ log_error("Failed to stat /dev/null: %m");
return -errno;
-
- } else if (!S_ISCHR(st.st_mode)) {
- log_error("/dev/console is not a char device");
- return -EIO;
}
r = chmod_and_chown(console, 0600, 0, 0);
@@ -877,16 +873,15 @@ static int setup_dev_console(const char *dest, const char *console) {
return r;
}
- if (asprintf(&to, "%s/dev/console", dest) < 0)
- return log_oom();
-
/* We need to bind mount the right tty to /dev/console since
* ptys can only exist on pts file systems. To have something
- * to bind mount things on we create a device node first, that
- * has the right major/minor (note that the major minor
- * doesn't actually matter here, since we mount it over
- * anyway). */
+ * to bind mount things on we create a device node first, and
+ * use /dev/null for that since we the cgroups device policy
+ * allows us to create that freely, while we cannot create
+ * /dev/console. (Note that the major minor doesn't actually
+ * matter here, since we mount it over anyway). */
+ to = strappenda(dest, "/dev/console");
if (mknod(to, (st.st_mode & ~07777) | 0600, st.st_rdev) < 0) {
log_error("mknod() for /dev/console failed: %m");
return -errno;

View File

@ -1,38 +0,0 @@
From fb197dbb1cfdd13c1ec7cc7efc27e10627f74ec1 Mon Sep 17 00:00:00 2001
From: Samuli Suominen <ssuominen@gentoo.org>
Date: Sat, 8 Mar 2014 09:49:29 +0200
Subject: [PATCH] build-sys: Find the tools for users with no /sbin:/usr/sbin
in PATH since some systems still make the distiction between bin and sbin.
(cherry picked from commit 2d0efdf1af5ff77441228854343c61d42a89840c)
---
configure.ac | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7920d6c..b275ccb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,16 +65,16 @@ AC_PROG_CC_C99
AC_PATH_PROG([M4], [m4])
AC_PATH_PROG([XSLTPROC], [xsltproc])
-AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon])
-AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck])
+AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon], [$PATH:/usr/sbin:/sbin])
+AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck], [$PATH:/usr/sbin:/sbin])
-AC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap])
+AC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap], [$PATH:/usr/sbin:/sbin])
-AC_PATH_PROG([KILL], [kill], [/usr/bin/kill])
+AC_PATH_PROG([KILL], [kill], [/usr/bin/kill], [$PATH:/usr/sbin:/sbin])
-AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod])
+AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
-AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec])
+AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
M4_DEFINES=

View File

@ -1,29 +0,0 @@
From 28be65e12016d365783ac9646bf588ec68352b75 Mon Sep 17 00:00:00 2001
From: Peter Rajnoha <prajnoha@redhat.com>
Date: Mon, 10 Mar 2014 22:58:14 +0100
Subject: [PATCH] rules: mark loop device as SYSTEMD_READY=0 if no file is
attached
Check existence of loop/backing_file in sysfs and mark loop devices with
SYSTEMD_READY if missing. Such loop files is uninitialized and it's not
ready for use yet (there's no file attached).
(cherry picked from commit ebc54302d7fc70927d5dc119e178ff03f6a911ed)
---
rules/99-systemd.rules.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
index 021359a..04a59c4 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -22,6 +22,9 @@ SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_T
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
+# Ignore loop devices that don't have any file attached
+SUBSYSTEM=="block", KERNEL=="loop[0-9]*", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0"
+
# Ignore nbd devices in the "add" event, with "change" the nbd is ready
ACTION=="add", SUBSYSTEM=="block", KERNEL=="nbd*", ENV{SYSTEMD_READY}="0"

View File

@ -1 +1 @@
03efddf8c9eca36d4d590f9967e7e818 systemd-210.tar.xz a6d7c06ad1d87b1aaae9442c192f5b88 systemd-211.tar.xz

View File

@ -15,8 +15,8 @@
Name: systemd Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 210 Version: 211
Release: 8%{?gitcommit:.git%{gitcommit}}%{?dist} Release: 1%{?gitcommit:.git%{gitcommit}}%{?dist}
# For a breakdown of the licensing, see README # For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+ License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager Summary: A System and Service Manager
@ -36,60 +36,9 @@ Source4: listen.conf
# Prevent accidental removal of the systemd package # Prevent accidental removal of the systemd package
Source6: yum-protect-systemd.conf Source6: yum-protect-systemd.conf
# Patch series is available from http://cgit.freedesktop.org/systemd/systemd-stable/log/?h=v210-stable # Patch series is available from http://cgit.freedesktop.org/systemd/systemd-stable/log/?h=v211-stable
# GIT_DIR=~/src/systemd/.git git format-patch-ab -M -N --no-signature v210..v210-stable # GIT_DIR=~/src/systemd/.git git format-patch-ab -M -N --no-signature v211..v211-stable
# i=1; for p in 0*patch;do printf "Patch%03d: %s\n" $i $p; ((i++));done # i=1; for p in 0*patch;do printf "Patch%03d: %s\n" $i $p; ((i++));done
Patch001: 0001-login-fix-pos-array-allocation.patch
Patch002: 0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch
Patch003: 0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch
Patch004: 0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch
Patch005: 0005-Replace-var-run-with-run-in-remaining-places.patch
Patch006: 0006-Revert-back-to-var-run-at-a-couple-of-problems.patch
Patch007: 0007-README-document-that-var-run-must-be-a-symlink-run.patch
Patch008: 0008-Use-var-run-dbus-system_bus_socket-for-the-D-Bus-soc.patch
Patch009: 0009-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch
Patch010: 0010-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch
Patch011: 0011-logs-show-fix-corrupt-output-with-empty-messages.patch
Patch012: 0012-journalctl-refuse-extra-arguments-with-verify-and-si.patch
Patch013: 0013-cdrom_id-use-the-old-MMC-fallback.patch
Patch014: 0014-udev-rules-setup-tty-permissions-and-group-for-sclp_.patch
Patch015: 0015-architecture-Add-tilegx.patch
Patch016: 0016-nspawn-fix-detection-of-missing-proc-self-loginuid.patch
Patch017: 0017-bash-add-completion-for-systemd-nspawn.patch
Patch018: 0018-add-bash-completion-for-systemd-cgls.patch
Patch019: 0019-hwdb-Update-database-of-Bluetooth-company-identifier.patch
Patch020: 0020-Allow-fractional-parts-in-disk-sizes.patch
Patch021: 0021-add-bash-completion-for-systemd-cgtop.patch
Patch022: 0022-Fix-systemd-stdio-bridge-symlink.patch
Patch023: 0023-execute-free-directory-path-if-we-fail-to-remove-it-.patch
Patch024: 0024-update-bash-completion-for-systemd-analyze.patch
Patch025: 0025-add-bash-completion-for-systemd-detect-virt.patch
Patch026: 0026-Do-not-print-invalid-UTF-8-in-error-messages.patch
Patch027: 0027-architecture-Add-cris.patch
Patch028: 0028-add-bash-completion-for-systemd-cat.patch
Patch029: 0029-man-document-missing-options-of-systemd-run.patch
Patch030: 0030-systemd-run-add-some-extra-safety-checks.patch
Patch031: 0031-journal-assume-that-next-entry-is-after-previous-ent.patch
Patch032: 0032-journal-forget-file-after-encountering-an-error.patch
Patch033: 0033-core-correctly-unregister-PIDs-from-PID-hashtables.patch
Patch034: 0034-logind-fix-reference-to-systemd-user-sessions.servic.patch
Patch035: 0035-man-update-link-to-LSB.patch
Patch036: 0036-man-systemd-bootchart-fix-spacing-in-command.patch
Patch037: 0037-man-add-missing-comma.patch
Patch038: 0038-build-sys-Don-t-distribute-generated-udev-rule.patch
Patch039: 0039-units-Do-not-unescape-instance-name-in-systemd-backl.patch
Patch040: 0040-util-add-timeout-to-generator-execution.patch
Patch041: 0041-core-busname-add-lookup-string-for-BUSNAME_FAILURE_S.patch
Patch042: 0042-busname-don-t-drop-service-from-the-result-string.patch
Patch043: 0043-manager-flush-memory-stream-before-using-the-buffer.patch
Patch044: 0044-networkd-link-degrade-failed-UP-to-warning.patch
Patch045: 0045-networkd-fix-confusion-from-missing-braces.patch
Patch046: 0046-fix-off-by-one-error-in-array-index-assertion.patch
Patch047: 0047-input_id-Recognize-buttonless-joystick-types.patch
Patch048: 0048-logind-fix-policykit-checks.patch
Patch049: 0049-nspawn-don-t-try-mknod-of-dev-console-with-the-corre.patch
Patch050: 0050-build-sys-Find-the-tools-for-users-with-no-sbin-usr-.patch
Patch051: 0051-rules-mark-loop-device-as-SYSTEMD_READY-0-if-no-file.patch
# kernel-install patch for grubby, drop if grubby is obsolete # kernel-install patch for grubby, drop if grubby is obsolete
Patch1000: kernel-install-grubby.patch Patch1000: kernel-install-grubby.patch
@ -767,6 +716,9 @@ getent passwd systemd-journal-gateway >/dev/null 2>&1 || useradd -r -l -u 191 -g
%{_datadir}/systemd/gatewayd %{_datadir}/systemd/gatewayd
%changelog %changelog
* Tue Mar 11 2014 Lennart Poettering <lpoetter@redhat.com> - 211-1
- New upstream release
* Mon Mar 10 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 210-8 * Mon Mar 10 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 210-8
- Fix logind unpriviledged reboot issue and a few other minor fixes - Fix logind unpriviledged reboot issue and a few other minor fixes
- Limit generator execution time - Limit generator execution time