SHA256
1
0
forked from pool/systemd
Dr. Werner Fink 2014-09-01 14:28:08 +00:00 committed by Git OBS Bridge
parent d7dbf74ce5
commit 4b5dfe5dff
10 changed files with 271 additions and 0 deletions

View File

@ -0,0 +1,30 @@
Based on ec15977a3cd82eff6c94bb13db72195f7cd512e8 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Fri, 29 Aug 2014 20:35:15 -0400
Subject: [PATCH] completion: filter templates from restartable units
Since c6a373a2634854, we might encounter unit templates via the
'list-units' verb. These aren't restartable (and we throw errors), so
make sure they're filtered out of the completion options.
fixes downstream bug: https://bugs.archlinux.org/task/41719
---
shell-completion/bash/systemctl.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git shell-completion/bash/systemctl.in shell-completion/bash/systemctl.in
index 64b15df..0150018 100644
--- shell-completion/bash/systemctl
+++ shell-completion/bash/systemctl
@@ -182,7 +182,7 @@ _systemctl () {
comps=$( __filter_units_by_property $mode CanStart yes \
$( __get_all_units $mode \
| while read -r line; do \
- [[ "$line" =~ \.(device|snapshot|socket|timer)$ ]] || echo " $line"; \
+ [[ "$line" =~ @\.|\.(device|snapshot|socket|timer)$ ]] || echo " $line"; \
done ))
compopt -o filenames
--
1.7.9.2

View File

@ -0,0 +1,29 @@
Based on 6ad3b2b62cbe34cc02ee98deb5f48047f5e42d26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 30 Aug 2014 17:22:42 -0400
Subject: [PATCH] systemd: fix error message
---
src/core/dbus-manager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- src/core/dbus-manager.c
+++ src/core/dbus-manager.c 2014-09-01 12:51:33.266735961 +0000
@@ -1114,7 +1114,7 @@ static int method_switch_root(sd_bus *bu
return r;
if (m->running_as != SYSTEMD_SYSTEM)
- return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "KExec is only supported for system managers.");
+ return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Root switching is only supported by system manager.");
r = sd_bus_message_read(message, "ss", &root, &init);
if (r < 0)
@@ -1125,7 +1125,7 @@ static int method_switch_root(sd_bus *bu
/* Safety check */
if (isempty(init)) {
- if (! path_is_os_tree(root))
+ if (!path_is_os_tree(root))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Specified switch root path %s does not seem to be an OS tree. /etc/os-release is missing.", root);
} else {
_cleanup_free_ char *p = NULL;

View File

@ -0,0 +1,68 @@
From 8e07fc41f86d41e68c5663b2a3c620a0adedcc11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 31 Aug 2014 00:42:27 -0400
Subject: [PATCH] Quote unit names in suggested systemctl commandlines
The fact that unit names have to be quoted can be a bit surprising.
Show quotes in the hint commandline, but only after checking that this
is necessary, since quotes are visually heavy and usually not needed.
https://bugs.freedesktop.org/show_bug.cgi?id=82832
---
src/core/job.c | 11 +++++++++--
src/systemctl/systemctl.c | 14 ++++++++++++--
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git src/core/job.c src/core/job.c
index 5e4987f..ef5dbce 100644
--- src/core/job.c
+++ src/core/job.c
@@ -632,11 +632,18 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) {
unit_status_printf(u, ANSI_GREEN_ON " OK " ANSI_HIGHLIGHT_OFF, format);
break;
- case JOB_FAILED:
+ case JOB_FAILED: {
+ bool quotes;
+
+ quotes = chars_intersect(u->id, SHELL_NEED_QUOTES);
+
manager_flip_auto_status(u->manager, true);
unit_status_printf(u, ANSI_HIGHLIGHT_RED_ON "FAILED" ANSI_HIGHLIGHT_OFF, format);
- manager_status_printf(u->manager, false, NULL, "See 'systemctl status %s' for details.", u->id);
+ manager_status_printf(u->manager, false, NULL,
+ "See \"systemctl status %s%s%s\" for details.",
+ quotes ? "'" : "", u->id, quotes ? "'" : "");
break;
+ }
case JOB_DEPENDENCY:
manager_flip_auto_status(u->manager, true);
diff --git src/systemctl/systemctl.c src/systemctl/systemctl.c
index 6534819..de43c87 100644
--- src/systemctl/systemctl.c
+++ src/systemctl/systemctl.c
@@ -2351,8 +2351,18 @@ static int check_wait_response(WaitData *d) {
log_error("Job for %s canceled.", strna(d->name));
else if (streq(d->result, "dependency"))
log_error("A dependency job for %s failed. See 'journalctl -xn' for details.", strna(d->name));
- else if (!streq(d->result, "done") && !streq(d->result, "skipped"))
- log_error("Job for %s failed. See 'systemctl status %s' and 'journalctl -xn' for details.", strna(d->name), strna(d->name));
+ else if (!streq(d->result, "done") && !streq(d->result, "skipped")) {
+ if (d->name) {
+ bool quotes;
+
+ quotes = chars_intersect(d->name, SHELL_NEED_QUOTES);
+
+ log_error("Job for %s failed. See \"systemctl status %s%s%s\" and \"journalctl -xn\" for details.",
+ d->name,
+ quotes ? "'" : "", d->name, quotes ? "'" : "");
+ } else
+ log_error("Job failed. See \"journalctl -xn\" for details.");
+ }
}
if (streq(d->result, "timeout"))
--
1.7.9.2

View File

@ -0,0 +1,24 @@
From 9e60277835e61597011358afcdbfb3dd712ce128 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Sun, 31 Aug 2014 23:13:12 +0200
Subject: [PATCH] config-parser: fix mem leak
---
src/shared/conf-parser.c | 1 +
1 file changed, 1 insertion(+)
diff --git src/shared/conf-parser.c src/shared/conf-parser.c
index 439cfc5..ee6de65 100644
--- src/shared/conf-parser.c
+++ src/shared/conf-parser.c
@@ -710,6 +710,7 @@ int config_parse_strv(const char *unit,
if (!utf8_is_valid(n)) {
log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
+ free(n);
continue;
}
--
1.7.9.2

View File

@ -0,0 +1,23 @@
Based on 13f493dc9ace9861c1f27c4d37e8cd6d52fe6a32 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Sun, 31 Aug 2014 23:34:01 +0200
Subject: [PATCH] login: fix mem leak
---
src/login/logind-session.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- src/login/logind-session.c
+++ src/login/logind-session.c 2014-09-01 12:59:27.870235647 +0000
@@ -1101,8 +1101,10 @@ int session_set_controller(Session *s, c
* If logind crashes/restarts, we restore the controller during restart
* or reset the VT in case it crashed/exited, too. */
r = session_mute_vt(s);
- if (r < 0)
+ if (r < 0) {
+ free(t);
return r;
+ }
session_swap_controller(s, t);

View File

@ -0,0 +1,39 @@
From 2e92633dbae52f5ac9b7b2e068935990d475d2cd Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Sat, 30 Aug 2014 11:36:32 +0200
Subject: [PATCH] udev: bump event timeout to 60 seconds
---
src/udev/udevadm-test.c | 2 +-
src/udev/udevd.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git src/udev/udevadm-test.c src/udev/udevadm-test.c
index 8486049..809adb6 100644
--- src/udev/udevadm-test.c
+++ src/udev/udevadm-test.c
@@ -136,7 +136,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) {
goto out;
}
- udev_event_execute_rules(event, 30 * USEC_PER_SEC, rules, &sigmask_orig);
+ udev_event_execute_rules(event, 60 * USEC_PER_SEC, rules, &sigmask_orig);
udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
diff --git src/udev/udevd.c src/udev/udevd.c
index 9c2b0d5..e72c5b2 100644
--- src/udev/udevd.c
+++ src/udev/udevd.c
@@ -73,7 +73,7 @@ static bool reload;
static int children;
static int children_max;
static int exec_delay;
-static usec_t event_timeout_usec = 30 * USEC_PER_SEC;
+static usec_t event_timeout_usec = 60 * USEC_PER_SEC;
static sigset_t sigmask_orig;
static UDEV_LIST(event_list);
static UDEV_LIST(worker_list);
--
1.7.9.2

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon Sep 1 13:00:29 UTC 2014 - werner@suse.de
- Add upstream patches
0001-completion-filter-templates-from-restartable-units.patch
0002-systemd-fix-error-message.patch
0003-Quote-unit-names-in-suggested-systemctl-commandlines.patch
0004-config-parser-fix-mem-leak.patch
0005-login-fix-mem-leak.patch
1065-udev-bump-event-timeout-to-60-seconds.patch
-------------------------------------------------------------------
Fri Aug 29 14:14:06 UTC 2014 - werner@suse.de

View File

@ -816,6 +816,16 @@ Patch392: 0003-sd-journal-properly-convert-object-size-on-big-endia.patch
Patch393: 0004-sd-journal-verify-that-object-start-with-the-field-n.patch
# PATCH-FIX-UPSTREAM added at 2014/08/29
Patch394: 0001-nspawn-fix-network-interface.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch395: 0001-completion-filter-templates-from-restartable-units.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch396: 0002-systemd-fix-error-message.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch397: 0003-Quote-unit-names-in-suggested-systemctl-commandlines.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch398: 0004-config-parser-fix-mem-leak.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch399: 0005-login-fix-mem-leak.patch
# UDEV PATCHES
# ============
@ -951,6 +961,8 @@ Patch1062: 1062-rules-set-default-permissions-for-GenWQE-devices.patch
Patch1063: 1063-udev-path_id-suppress-ID_PATH-for-devices-with-an-un.patch
# PATCH-FIX-UPSTREAM 1064-udev-hwdb-do-not-look-at-usb_device-parents.patch
Patch1064: 1064-udev-hwdb-do-not-look-at-usb_device-parents.patch
# PATCH-FIX-UPSTREAM 1065-udev-bump-event-timeout-to-60-seconds.patch
Patch1065: 1065-udev-bump-event-timeout-to-60-seconds.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB
@ -1504,6 +1516,11 @@ cp %{SOURCE7} m4/
%patch392 -p0
%patch393 -p0
%patch394 -p0
%patch395 -p0
%patch396 -p0
%patch397 -p0
%patch398 -p0
%patch399 -p0
# udev patches
%patch1001 -p1
@ -1591,6 +1608,7 @@ cp %{SOURCE7} m4/
%patch1062 -p1
%patch1063 -p0
%patch1064 -p0
%patch1065 -p0
# remove patch backups
find -name '*.orig' -exec rm -f '{}' \+

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon Sep 1 13:00:29 UTC 2014 - werner@suse.de
- Add upstream patches
0001-completion-filter-templates-from-restartable-units.patch
0002-systemd-fix-error-message.patch
0003-Quote-unit-names-in-suggested-systemctl-commandlines.patch
0004-config-parser-fix-mem-leak.patch
0005-login-fix-mem-leak.patch
1065-udev-bump-event-timeout-to-60-seconds.patch
-------------------------------------------------------------------
Fri Aug 29 14:14:06 UTC 2014 - werner@suse.de

View File

@ -811,6 +811,16 @@ Patch392: 0003-sd-journal-properly-convert-object-size-on-big-endia.patch
Patch393: 0004-sd-journal-verify-that-object-start-with-the-field-n.patch
# PATCH-FIX-UPSTREAM added at 2014/08/29
Patch394: 0001-nspawn-fix-network-interface.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch395: 0001-completion-filter-templates-from-restartable-units.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch396: 0002-systemd-fix-error-message.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch397: 0003-Quote-unit-names-in-suggested-systemctl-commandlines.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch398: 0004-config-parser-fix-mem-leak.patch
# PATCH-FIX-UPSTREAM added at 2014/09/01
Patch399: 0005-login-fix-mem-leak.patch
# UDEV PATCHES
# ============
@ -946,6 +956,8 @@ Patch1062: 1062-rules-set-default-permissions-for-GenWQE-devices.patch
Patch1063: 1063-udev-path_id-suppress-ID_PATH-for-devices-with-an-un.patch
# PATCH-FIX-UPSTREAM 1064-udev-hwdb-do-not-look-at-usb_device-parents.patch
Patch1064: 1064-udev-hwdb-do-not-look-at-usb_device-parents.patch
# PATCH-FIX-UPSTREAM 1065-udev-bump-event-timeout-to-60-seconds.patch
Patch1065: 1065-udev-bump-event-timeout-to-60-seconds.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB
@ -1499,6 +1511,11 @@ cp %{SOURCE7} m4/
%patch392 -p0
%patch393 -p0
%patch394 -p0
%patch395 -p0
%patch396 -p0
%patch397 -p0
%patch398 -p0
%patch399 -p0
# udev patches
%patch1001 -p1
@ -1586,6 +1603,7 @@ cp %{SOURCE7} m4/
%patch1062 -p1
%patch1063 -p0
%patch1064 -p0
%patch1065 -p0
# remove patch backups
find -name '*.orig' -exec rm -f '{}' \+