[systemd/f15] Cherry-picked a bunch of upstream patches
Michal Schmidt
michich at fedoraproject.org
Mon Jul 4 19:43:30 UTC 2011
commit bbf564a0ee254ee3ec22e7da833b08e8cbf31ac3
Author: Michal Schmidt <mschmidt at redhat.com>
Date: Mon Jul 4 21:30:09 2011 +0200
Cherry-picked a bunch of upstream patches
Fixes: BZ#633774, BZ#708886, BZ#712710, BZ#716663
Partially fixes: BZ#624149
other small fixes
...-t-choke-when-systemd-was-compiled-with-a.patch | 72 ++++++++++++++++++
0001-execute-fix-PAM-error-checking.patch | 25 ++++++
...ager-consider-the-active-job-when-merging.patch | 38 +++++++++
...lude-full-systemctl-status-command-line-i.patch | 33 ++++++++
...ent-actually-really-don-t-access-unalloca.patch | 30 +++++++
...ent-make-sure-not-to-access-unallocated-m.patch | 38 +++++++++
...-shutdown-accept-minutes-argument-without.patch | 35 +++++++++
...int-the-standard-wall-message-even-when-t.patch | 74 ++++++++++++++++++
0001-shutdown-respect-the-dry-run-option-k.patch | 80 ++++++++++++++++++++
0001-swap-ignore-missing-proc-swaps.patch | 27 +++++++
...ystemadm-report-GLib.Error-only-to-stderr.patch | 29 +++++++
...dd-SYSTEMD_PAGER-for-setting-the-pager-to.patch | 54 +++++++++++++
...n-t-exit-with-an-error-code-if-we-cannot-.patch | 44 +++++++++++
0001-umount-ignore-missing-proc-swaps.patch | 27 +++++++
...oading-symlinked-template-units-properly-.patch | 60 +++++++++++++++
...e-dev-hugepages.automount-and-dev-mqueue..patch | 38 +++++++++
systemd.spec | 40 ++++++++++-
17 files changed, 743 insertions(+), 1 deletions(-)
---
diff --git a/0001-execute-don-t-choke-when-systemd-was-compiled-with-a.patch b/0001-execute-don-t-choke-when-systemd-was-compiled-with-a.patch
new file mode 100644
index 0000000..36c4b3e
--- /dev/null
+++ b/0001-execute-don-t-choke-when-systemd-was-compiled-with-a.patch
@@ -0,0 +1,72 @@
+From ae556c210942cb6986c6d77b58505b5daa66bbe2 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 28 Jun 2011 13:33:56 +0200
+Subject: [PATCH] execute: don't choke when systemd was compiled with a
+ different CAP_LAST_CAP then what it is run with
+
+---
+ src/execute.c | 12 ++++++++----
+ src/nspawn.c | 4 ++--
+ 2 files changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/src/execute.c b/src/execute.c
+index a62f9db..b00ccde 100644
+--- a/src/execute.c
++++ b/src/execute.c
+@@ -957,9 +957,12 @@ static int do_capability_bounding_set_drop(uint64_t drop) {
+ }
+ }
+
+- for (i = 0; i <= CAP_LAST_CAP; i++)
++ for (i = 0; i <= MAX(63LU, (unsigned long) CAP_LAST_CAP); i++)
+ if (drop & ((uint64_t) 1ULL << (uint64_t) i)) {
+ if (prctl(PR_CAPBSET_DROP, i) < 0) {
++ if (errno == EINVAL)
++ break;
++
+ r = -errno;
+ goto finish;
+ }
+@@ -1754,13 +1757,14 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
+ (c->secure_bits & SECURE_NOROOT_LOCKED) ? "noroot-locked" : "");
+
+ if (c->capability_bounding_set_drop) {
++ unsigned long l;
+ fprintf(f, "%sCapabilityBoundingSet:", prefix);
+
+- for (i = 0; i <= CAP_LAST_CAP; i++)
+- if (!(c->capability_bounding_set_drop & ((uint64_t) 1ULL << (uint64_t) i))) {
++ for (l = 0; l <= (unsigned long) CAP_LAST_CAP; l++)
++ if (!(c->capability_bounding_set_drop & ((uint64_t) 1ULL << (uint64_t) l))) {
+ char *t;
+
+- if ((t = cap_to_name(i))) {
++ if ((t = cap_to_name(l))) {
+ fprintf(f, " %s", t);
+ cap_free(t);
+ }
+diff --git a/src/nspawn.c b/src/nspawn.c
+index b5908d6..1ade6e2 100644
+--- a/src/nspawn.c
++++ b/src/nspawn.c
+@@ -332,7 +332,7 @@ static int drop_capabilities(void) {
+
+ unsigned long l;
+
+- for (l = 0; l <= MAX(63LU, (unsigned long) CAP_LAST_CAP); l ++) {
++ for (l = 0; l <= MAX(63LU, (unsigned long) CAP_LAST_CAP); l++) {
+ unsigned i;
+
+ for (i = 0; i < ELEMENTSOF(retain); i++)
+@@ -347,7 +347,7 @@ static int drop_capabilities(void) {
+ /* If this capability is not known, EINVAL
+ * will be returned, let's ignore this. */
+ if (errno == EINVAL)
+- continue;
++ break;
+
+ log_error("PR_CAPBSET_DROP failed: %m");
+ return -errno;
+--
+1.7.4.4
+
diff --git a/0001-execute-fix-PAM-error-checking.patch b/0001-execute-fix-PAM-error-checking.patch
new file mode 100644
index 0000000..6e0a5a5
--- /dev/null
+++ b/0001-execute-fix-PAM-error-checking.patch
@@ -0,0 +1,25 @@
+From 7fbf31dfe3cb2f9619df28258208eba36922e9d3 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Thu, 30 Jun 2011 04:15:53 +0200
+Subject: [PATCH] execute: fix PAM error checking
+
+---
+ src/execute.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/execute.c b/src/execute.c
+index c69442d..d297e0a 100644
+--- a/src/execute.c
++++ b/src/execute.c
+@@ -1269,7 +1269,7 @@ int exec_spawn(ExecCommand *command,
+
+ #ifdef HAVE_PAM
+ if (context->pam_name && username) {
+- if (setup_pam(context->pam_name, username, context->tty_path, &pam_env, fds, n_fds) < 0) {
++ if (setup_pam(context->pam_name, username, context->tty_path, &pam_env, fds, n_fds) != 0) {
+ r = EXIT_PAM;
+ goto fail_child;
+ }
+--
+1.7.4.4
+
diff --git a/0001-manager-consider-the-active-job-when-merging.patch b/0001-manager-consider-the-active-job-when-merging.patch
new file mode 100644
index 0000000..c0808fe
--- /dev/null
+++ b/0001-manager-consider-the-active-job-when-merging.patch
@@ -0,0 +1,38 @@
+From 1b562e4604f8833bc21fd251b8bdb45c9c224df4 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Sat, 2 Jul 2011 14:52:52 +0200
+Subject: [PATCH] manager: consider the active job when merging
+
+In some cases systemd forgets to start enabled services, e.g. in this scenario:
+1. The job "sendmail.service/start" is installed.
+2. Before systemd proceeds with this job, a process requests a reload of
+ sendmail. The job "sendmail.service/reload" is enqueued.
+3. The original job is silently discarded. The service is not started.
+ The reload job proceeds by doing nothing.
+
+The fix is to allow merging transaction jobs with the active job.
+With the fix the resulting merged job "sendmail.service/reload-or-start" is
+installed and the service works as expected.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=633774
+---
+ src/manager.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/src/manager.c b/src/manager.c
+index 92a6dff..258b3ca 100644
+--- a/src/manager.c
++++ b/src/manager.c
+@@ -897,6 +897,9 @@ static int transaction_merge_jobs(Manager *m, DBusError *e) {
+ transaction_merge_and_delete_job(m, j, k, t);
+ }
+
++ if (j->unit->meta.job && !j->installed)
++ transaction_merge_and_delete_job(m, j, j->unit->meta.job, t);
++
+ assert(!j->transaction_next);
+ assert(!j->transaction_prev);
+ }
+--
+1.7.4.4
+
diff --git a/0001-manager-include-full-systemctl-status-command-line-i.patch b/0001-manager-include-full-systemctl-status-command-line-i.patch
new file mode 100644
index 0000000..adb40a5
--- /dev/null
+++ b/0001-manager-include-full-systemctl-status-command-line-i.patch
@@ -0,0 +1,33 @@
+[hand-removed a TODO hunk -- michich]
+
+From 3661ac04b4f2840d3345605aa35963bbde3c469d Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 20 Jun 2011 21:39:28 +0200
+Subject: [PATCH] manager: include full systemctl status command line in error
+ message
+
+---
+ TODO | 2 ++
+ src/manager.c | 5 +++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/manager.c b/src/manager.c
+index 68d43ad..62451a0 100644
+--- a/src/manager.c
++++ b/src/manager.c
+@@ -1468,9 +1468,10 @@ static int transaction_add_job_and_dependencies(
+ if (type != JOB_STOP && unit->meta.load_state == UNIT_ERROR) {
+ dbus_set_error(e, BUS_ERROR_LOAD_FAILED,
+ "Unit %s failed to load: %s. "
+- "See system logs and 'systemctl status' for details.",
++ "See system logs and 'systemctl status %s' for details.",
+ unit->meta.id,
+- strerror(-unit->meta.load_error));
++ strerror(-unit->meta.load_error),
++ unit->meta.id);
+ return -EINVAL;
+ }
+
+--
+1.7.4.4
+
diff --git a/0001-password-agent-actually-really-don-t-access-unalloca.patch b/0001-password-agent-actually-really-don-t-access-unalloca.patch
new file mode 100644
index 0000000..ea0e996
--- /dev/null
+++ b/0001-password-agent-actually-really-don-t-access-unalloca.patch
@@ -0,0 +1,30 @@
+From 5ba7b871951ee120f1e9d5281debe00e2e42ba99 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 4 Jul 2011 19:06:32 +0200
+Subject: [PATCH] password-agent: actually really don't access unallocated
+ memory
+
+Fix for 9726f9ff11fa7b94dceed2972cd2453a08b9ee6a
+---
+ src/tty-ask-password-agent.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/tty-ask-password-agent.c b/src/tty-ask-password-agent.c
+index 38442f6..02b959e 100644
+--- a/src/tty-ask-password-agent.c
++++ b/src/tty-ask-password-agent.c
+@@ -384,9 +384,9 @@ static int parse_password(const char *filename, char **wall) {
+ packet[0] = '+';
+ strcpy(packet+1, password);
+ }
+- }
+
+- free(password);
++ free(password);
++ }
+ }
+
+ if (r == -ETIME || r == -ENOENT) {
+--
+1.7.4.4
+
diff --git a/0001-password-agent-make-sure-not-to-access-unallocated-m.patch b/0001-password-agent-make-sure-not-to-access-unallocated-m.patch
new file mode 100644
index 0000000..174fded
--- /dev/null
+++ b/0001-password-agent-make-sure-not-to-access-unallocated-m.patch
@@ -0,0 +1,38 @@
+From 9726f9ff11fa7b94dceed2972cd2453a08b9ee6a Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 4 Jul 2011 18:59:54 +0200
+Subject: [PATCH] password-agent: make sure not to access unallocated memory
+
+Tracked down by Frederic Crozat
+---
+ src/tty-ask-password-agent.c | 14 ++++++++------
+ 1 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/src/tty-ask-password-agent.c b/src/tty-ask-password-agent.c
+index b620aa6..38442f6 100644
+--- a/src/tty-ask-password-agent.c
++++ b/src/tty-ask-password-agent.c
+@@ -376,12 +376,14 @@ static int parse_password(const char *filename, char **wall) {
+ release_terminal();
+ }
+
+- packet_length = 1+strlen(password)+1;
+- if (!(packet = new(char, packet_length)))
+- r = -ENOMEM;
+- else {
+- packet[0] = '+';
+- strcpy(packet+1, password);
++ if (r >= 0) {
++ packet_length = 1+strlen(password)+1;
++ if (!(packet = new(char, packet_length)))
++ r = -ENOMEM;
++ else {
++ packet[0] = '+';
++ strcpy(packet+1, password);
++ }
+ }
+
+ free(password);
+--
+1.7.4.4
+
diff --git a/0001-shutdown-accept-minutes-argument-without.patch b/0001-shutdown-accept-minutes-argument-without.patch
new file mode 100644
index 0000000..accb76c
--- /dev/null
+++ b/0001-shutdown-accept-minutes-argument-without.patch
@@ -0,0 +1,35 @@
+From 1a63987788624a8819b94b199aa6748665f5e957 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Sat, 2 Jul 2011 20:41:36 +0200
+Subject: [PATCH] shutdown: accept minutes argument without '+'
+
+Both SysVinit's and upstart's shutdown commands accept the number of
+minutes with or without the plus sign.
+'shutdown -h 1' works in RHEL 5, Fedora 14, Debian 6.
+Let's be compatible.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=708886
+---
+ src/systemctl.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/systemctl.c b/src/systemctl.c
+index f6dca5b..b584e70 100644
+--- a/src/systemctl.c
++++ b/src/systemctl.c
+@@ -4815,10 +4815,10 @@ static int parse_time_spec(const char *t, usec_t *_u) {
+
+ if (streq(t, "now"))
+ *_u = 0;
+- else if (t[0] == '+') {
++ else if (!strchr(t, ':')) {
+ uint64_t u;
+
+- if (safe_atou64(t + 1, &u) < 0)
++ if (safe_atou64(t, &u) < 0)
+ return -EINVAL;
+
+ *_u = now(CLOCK_REALTIME) + USEC_PER_MINUTE * u;
+--
+1.7.4.4
+
diff --git a/0001-shutdown-print-the-standard-wall-message-even-when-t.patch b/0001-shutdown-print-the-standard-wall-message-even-when-t.patch
new file mode 100644
index 0000000..cbaa6c2
--- /dev/null
+++ b/0001-shutdown-print-the-standard-wall-message-even-when-t.patch
@@ -0,0 +1,74 @@
+From 30923233b34e23ed1b3ffa7317f6219f695fec2f Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Sat, 2 Jul 2011 23:40:42 +0200
+Subject: [PATCH] shutdown: print the standard wall message even when the user
+ provided one
+
+Print the user-provided wall message in addition to the standard one, not
+instead of it.
+
+Related to: https://bugzilla.redhat.com/show_bug.cgi?id=624149
+---
+ src/shutdownd.c | 38 +++++++++++++++++---------------------
+ 1 files changed, 17 insertions(+), 21 deletions(-)
+
+diff --git a/src/shutdownd.c b/src/shutdownd.c
+index 7fd9573..49ab886 100644
+--- a/src/shutdownd.c
++++ b/src/shutdownd.c
+@@ -100,6 +100,9 @@ static int read_packet(int fd, struct shutdownd_command *_c) {
+ }
+
+ static void warn_wall(usec_t n, struct shutdownd_command *c) {
++ char date[FORMAT_TIMESTAMP_MAX];
++ const char *prefix;
++ char *l = NULL;
+
+ assert(c);
+ assert(c->warn_wall);
+@@ -107,28 +110,21 @@ static void warn_wall(usec_t n, struct shutdownd_command *c) {
+ if (n >= c->elapse)
+ return;
+
+- if (c->wall_message[0])
+- utmp_wall(c->wall_message, NULL);
++ if (c->mode == 'H')
++ prefix = "The system is going down for system halt at ";
++ else if (c->mode == 'P')
++ prefix = "The system is going down for power-off at ";
++ else if (c->mode == 'r')
++ prefix = "The system is going down for reboot at ";
++ else
++ assert_not_reached("Unknown mode!");
++
++ if (asprintf(&l, "%s%s%s%s!", c->wall_message, c->wall_message[0] ? "\n" : "",
++ prefix, format_timestamp(date, sizeof(date), c->elapse)) < 0)
++ log_error("Failed to allocate wall message");
+ else {
+- char date[FORMAT_TIMESTAMP_MAX];
+- const char* prefix;
+- char *l = NULL;
+-
+- if (c->mode == 'H')
+- prefix = "The system is going down for system halt at ";
+- else if (c->mode == 'P')
+- prefix = "The system is going down for power-off at ";
+- else if (c->mode == 'r')
+- prefix = "The system is going down for reboot at ";
+- else
+- assert_not_reached("Unknown mode!");
+-
+- if (asprintf(&l, "%s%s!", prefix, format_timestamp(date, sizeof(date), c->elapse)) < 0)
+- log_error("Failed to allocate wall message");
+- else {
+- utmp_wall(l, NULL);
+- free(l);
+- }
++ utmp_wall(l, NULL);
++ free(l);
+ }
+ }
+
+--
+1.7.4.4
+
diff --git a/0001-shutdown-respect-the-dry-run-option-k.patch b/0001-shutdown-respect-the-dry-run-option-k.patch
new file mode 100644
index 0000000..f117373
--- /dev/null
+++ b/0001-shutdown-respect-the-dry-run-option-k.patch
@@ -0,0 +1,80 @@
+From 52c002150a34c07a59369ee952bcd3a1f8f316ca Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Sat, 2 Jul 2011 23:09:59 +0200
+Subject: [PATCH] shutdown: respect the dry run option '-k'
+
+Don't do the actual power-off/reboot when '-k' is passed to shutdown.
+
+Related to: https://bugzilla.redhat.com/show_bug.cgi?id=624149
+---
+ src/shutdownd.c | 2 +-
+ src/shutdownd.h | 1 +
+ src/systemctl.c | 6 ++++--
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/shutdownd.c b/src/shutdownd.c
+index 1381941..7fd9573 100644
+--- a/src/shutdownd.c
++++ b/src/shutdownd.c
+@@ -348,7 +348,7 @@ finish:
+ if (unlink_nologin)
+ unlink("/run/nologin");
+
+- if (exec_shutdown) {
++ if (exec_shutdown && !c.dry_run) {
+ char sw[3];
+
+ sw[0] = '-';
+diff --git a/src/shutdownd.h b/src/shutdownd.h
+index ed8a704..4581649 100644
+--- a/src/shutdownd.h
++++ b/src/shutdownd.h
+@@ -33,6 +33,7 @@ _packed_ struct shutdownd_command {
+ char mode; /* H, P, r, i.e. the switches usually passed to
+ * shutdown to select whether to halt, power-off or
+ * reboot the machine */
++ bool dry_run;
+ bool warn_wall;
+
+ /* Yepp, sometimes we are lazy and use fixed-size strings like
+diff --git a/src/systemctl.c b/src/systemctl.c
+index b584e70..8f904c1 100644
+--- a/src/systemctl.c
++++ b/src/systemctl.c
+@@ -5422,7 +5422,7 @@ static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError
+ return verbs[i].dispatch(bus, argv + optind, left);
+ }
+
+-static int send_shutdownd(usec_t t, char mode, bool warn, const char *message) {
++static int send_shutdownd(usec_t t, char mode, bool dry_run, bool warn, const char *message) {
+ int fd = -1;
+ struct msghdr msghdr;
+ struct iovec iovec;
+@@ -5432,6 +5432,7 @@ static int send_shutdownd(usec_t t, char mode, bool warn, const char *message) {
+ zero(c);
+ c.elapse = t;
+ c.mode = mode;
++ c.dry_run = dry_run;
+ c.warn_wall = warn;
+
+ if (message)
+@@ -5527,6 +5528,7 @@ static int halt_main(DBusConnection *bus) {
+ arg_action == ACTION_HALT ? 'H' :
+ arg_action == ACTION_POWEROFF ? 'P' :
+ 'r',
++ arg_dry,
+ !arg_no_wall,
+ m);
+ free(m);
+@@ -5774,7 +5776,7 @@ int main(int argc, char*argv[]) {
+ break;
+
+ case ACTION_CANCEL_SHUTDOWN:
+- r = send_shutdownd(0, 0, false, NULL);
++ r = send_shutdownd(0, 0, false, false, NULL);
+ break;
+
+ case ACTION_INVALID:
+--
+1.7.4.4
+
diff --git a/0001-swap-ignore-missing-proc-swaps.patch b/0001-swap-ignore-missing-proc-swaps.patch
new file mode 100644
index 0000000..54ba703
--- /dev/null
+++ b/0001-swap-ignore-missing-proc-swaps.patch
@@ -0,0 +1,27 @@
+From 3f8587327556c97ae4fc4c8b3ea0df122f769d4b Mon Sep 17 00:00:00 2001
+From: Michael Olbrich <m.olbrich at pengutronix.de>
+Date: Fri, 24 Jun 2011 13:43:19 +0200
+Subject: [PATCH] swap: ignore missing /proc/swaps
+
+Otherwise systemd reports "Failed to fully start up daemon: No such file or
+directory" when swap is disabled in the kernel.
+---
+ src/swap.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/swap.c b/src/swap.c
+index 14719ad..7675e6a 100644
+--- a/src/swap.c
++++ b/src/swap.c
+@@ -1237,7 +1237,7 @@ static int swap_enumerate(Manager *m) {
+
+ if (!m->proc_swaps) {
+ if (!(m->proc_swaps = fopen("/proc/swaps", "re")))
+- return -errno;
++ return (errno == ENOENT) ? 0 : -errno;
+
+ m->swap_watch.type = WATCH_SWAP;
+ m->swap_watch.fd = fileno(m->proc_swaps);
+--
+1.7.4.4
+
diff --git a/0001-systemadm-report-GLib.Error-only-to-stderr.patch b/0001-systemadm-report-GLib.Error-only-to-stderr.patch
new file mode 100644
index 0000000..8562237
--- /dev/null
+++ b/0001-systemadm-report-GLib.Error-only-to-stderr.patch
@@ -0,0 +1,29 @@
+From b8590c197deceab623d37dbb95e30eec9cf47d14 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Sun, 3 Jul 2011 01:47:21 +0200
+Subject: [PATCH] systemadm: report GLib.Error only to stderr
+
+When a GLib.Error happens, it is likely that showing a message box would fail
+too.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=716663
+---
+ src/systemadm.vala | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/systemadm.vala b/src/systemadm.vala
+index c262794..d45ec64 100644
+--- a/src/systemadm.vala
++++ b/src/systemadm.vala
+@@ -1011,7 +1011,7 @@ int main(string[] args) {
+ } catch (IOError e) {
+ show_error(e.message);
+ } catch (GLib.Error e) {
+- show_error(e.message);
++ stderr.printf("%s\n", e.message);
+ }
+
+ return 0;
+--
+1.7.4.4
+
diff --git a/0001-systemctl-Add-SYSTEMD_PAGER-for-setting-the-pager-to.patch b/0001-systemctl-Add-SYSTEMD_PAGER-for-setting-the-pager-to.patch
new file mode 100644
index 0000000..5e23794
--- /dev/null
+++ b/0001-systemctl-Add-SYSTEMD_PAGER-for-setting-the-pager-to.patch
@@ -0,0 +1,54 @@
+From abebb5af9a7f5da77425aab1ecadd9bfcad53009 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Sat, 18 Jun 2011 16:23:43 +0300
+Subject: [PATCH] systemctl: Add SYSTEMD_PAGER for setting the pager to use in
+ systemctl
+
+---
+ man/systemctl.xml | 16 ++++++++++++++++
+ src/systemctl.c | 2 +-
+ 2 files changed, 17 insertions(+), 1 deletions(-)
+
+diff --git a/man/systemctl.xml b/man/systemctl.xml
+index a9e86ce..2fd2b7b 100644
+--- a/man/systemctl.xml
++++ b/man/systemctl.xml
+@@ -1022,6 +1022,22 @@
+ </refsect1>
+
+ <refsect1>
++ <title>Environment</title>
++
++ <variablelist>
++ <varlistentry>
++ <term><varname>$SYSTEMD_PAGER</varname></term>
++ <listitem><para>Pager to use when
++ <option>--no-pager</option> is not given;
++ overrides <varname>$PAGER</varname>. Setting
++ this to an empty string or the value
++ <literal>cat</literal> is equivalent to passing
++ <option>--no-pager</option>.</para></listitem>
++ </varlistentry>
++ </variablelist>
++ </refsect1>
++
++ <refsect1>
+ <title>See Also</title>
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+diff --git a/src/systemctl.c b/src/systemctl.c
+index 08c7fab..ab41566 100644
+--- a/src/systemctl.c
++++ b/src/systemctl.c
+@@ -5572,7 +5572,7 @@ static void pager_open(void) {
+ if (!on_tty() || arg_no_pager)
+ return;
+
+- if ((pager = getenv("PAGER")))
++ if ((pager = getenv("SYSTEMD_PAGER")) || (pager = getenv("PAGER")))
+ if (!*pager || streq(pager, "cat"))
+ return;
+
+--
+1.7.4.4
+
diff --git a/0001-tmpfiles-don-t-exit-with-an-error-code-if-we-cannot-.patch b/0001-tmpfiles-don-t-exit-with-an-error-code-if-we-cannot-.patch
new file mode 100644
index 0000000..b5ec258
--- /dev/null
+++ b/0001-tmpfiles-don-t-exit-with-an-error-code-if-we-cannot-.patch
@@ -0,0 +1,44 @@
+[hand-removed the TODO hunk -- michich]
+
+From 21bdae12e11ae20460715475d8a0c991f15464ac Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Sat, 2 Jul 2011 01:44:49 +0200
+Subject: [PATCH] tmpfiles: don't exit with an error code if we cannot access
+ all files
+
+This is just to avoid confusion if people use stuff like FUSE file
+systems or SELinux which might disallow access to files even if tmpfiles
+is running as root.
+
+We still log away if we cannot access a file, but we do not return a
+failure exit code in the end.
+---
+ TODO | 4 ++++
+ src/tmpfiles.c | 8 ++------
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/tmpfiles.c b/src/tmpfiles.c
+index 954c3b7..4394f0d 100644
+--- a/src/tmpfiles.c
++++ b/src/tmpfiles.c
+@@ -983,15 +983,11 @@ int main(int argc, char *argv[]) {
+ strv_free(files);
+ }
+
+-
+-
+ HASHMAP_FOREACH(i, globs, iterator)
+- if (process_item(i) < 0)
+- r = EXIT_FAILURE;
++ process_item(i);
+
+ HASHMAP_FOREACH(i, items, iterator)
+- if (process_item(i) < 0)
+- r = EXIT_FAILURE;
++ process_item(i);
+
+ finish:
+ while ((i = hashmap_steal_first(items)))
+--
+1.7.4.4
+
diff --git a/0001-umount-ignore-missing-proc-swaps.patch b/0001-umount-ignore-missing-proc-swaps.patch
new file mode 100644
index 0000000..5ddf1d8
--- /dev/null
+++ b/0001-umount-ignore-missing-proc-swaps.patch
@@ -0,0 +1,27 @@
+From dee87d612d295d9c8642b76c716b8e357411e65a Mon Sep 17 00:00:00 2001
+From: Michael Olbrich <m.olbrich at pengutronix.de>
+Date: Tue, 28 Jun 2011 09:30:08 +0200
+Subject: [PATCH] umount: ignore missing /proc/swaps
+
+/proc/swaps does not exist when swap is disabled in the kernel.
+Just report an empty list of mountpoints to unmount in this case.
+---
+ src/umount.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/umount.c b/src/umount.c
+index 3d328e0..95efa82 100644
+--- a/src/umount.c
++++ b/src/umount.c
+@@ -146,7 +146,7 @@ static int swap_list_get(MountPoint **head) {
+ assert(head);
+
+ if (!(proc_swaps = fopen("/proc/swaps", "re")))
+- return -errno;
++ return (errno == ENOENT) ? 0 : -errno;
+
+ (void) fscanf(proc_swaps, "%*s %*s %*s %*s %*s\n");
+
+--
+1.7.4.4
+
diff --git a/0001-unit-when-loading-symlinked-template-units-properly-.patch b/0001-unit-when-loading-symlinked-template-units-properly-.patch
new file mode 100644
index 0000000..7daee88
--- /dev/null
+++ b/0001-unit-when-loading-symlinked-template-units-properly-.patch
@@ -0,0 +1,60 @@
+[hand-removed an irrelevant non-applicable hunk for logind.h -- michich]
+
+From 15e11d81e7c26439f583e1cf67ac3c712430a79e Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 28 Jun 2011 02:53:15 +0200
+Subject: [PATCH] unit: when loading symlinked template units, properly add
+ all names on the way to the unit
+
+---
+ src/load-fragment.c | 11 +++++++----
+ src/logind.h | 3 +--
+ src/unit-name.c | 7 ++++---
+ 3 files changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/src/load-fragment.c b/src/load-fragment.c
+index 56eaed9..352db6b 100644
+--- a/src/load-fragment.c
++++ b/src/load-fragment.c
+@@ -1661,13 +1661,16 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
+ * unit name. */
+ name = file_name_from_path(*filename);
+
+- if (unit_name_is_valid(name, false)) {
+- if (!(id = set_get(names, name))) {
++ if (unit_name_is_valid(name, true)) {
+
+- if (!(id = strdup(name)))
++ id = set_get(names, name);
++ if (!id) {
++ id = strdup(name);
++ if (!id)
+ return -ENOMEM;
+
+- if ((r = set_put(names, id)) < 0) {
++ r = set_put(names, id);
++ if (r < 0) {
+ free(id);
+ return r;
+ }
+diff --git a/src/unit-name.c b/src/unit-name.c
+index be4e73e..6d45576 100644
+--- a/src/unit-name.c
++++ b/src/unit-name.c
+@@ -272,9 +272,10 @@ char *unit_name_unescape(const char *f) {
+ else if (*f == '\\') {
+ int a, b;
+
+- if (f[1] != 'x' || (a = unhexchar(f[2])) < 0 ||
+- (b = unhexchar(f[3])) < 0) {
+- /* Invalid escape code, let's take it literal then */
++ if (f[1] != 'x' ||
++ (a = unhexchar(f[2])) < 0 ||
++ (b = unhexchar(f[3])) < 0) {
++ /* Invalid escape code, let's take it literal then */
+ *(t++) = '\\';
+ } else {
+ *(t++) = (char) ((a << 4) | b);
+--
+1.7.4.4
+
diff --git a/0001-units-enable-dev-hugepages.automount-and-dev-mqueue..patch b/0001-units-enable-dev-hugepages.automount-and-dev-mqueue..patch
new file mode 100644
index 0000000..5e39652
--- /dev/null
+++ b/0001-units-enable-dev-hugepages.automount-and-dev-mqueue..patch
@@ -0,0 +1,38 @@
+From 26b8e979c8a6340180716f686dbe26e4906bc568 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Sat, 2 Jul 2011 01:00:00 +0200
+Subject: [PATCH] units: enable dev-hugepages.automount and
+ dev-mqueue.automount only when enabled in kernel
+
+---
+ units/dev-hugepages.automount | 1 +
+ units/dev-mqueue.automount | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/units/dev-hugepages.automount b/units/dev-hugepages.automount
+index dfd3868..6e03df3 100644
+--- a/units/dev-hugepages.automount
++++ b/units/dev-hugepages.automount
+@@ -9,6 +9,7 @@
+ Description=Huge Pages File System Automount Point
+ DefaultDependencies=no
+ Before=sysinit.target
++ConditionPathExists=/sys/kernel/mm/hugepages
+
+ [Automount]
+ Where=/dev/hugepages
+diff --git a/units/dev-mqueue.automount b/units/dev-mqueue.automount
+index 73c4110..1061597 100644
+--- a/units/dev-mqueue.automount
++++ b/units/dev-mqueue.automount
+@@ -9,6 +9,7 @@
+ Description=POSIX Message Queue File System Automount Point
+ DefaultDependencies=no
+ Before=sysinit.target
++ConditionPathExists=/proc/sys/fs/mqueue
+
+ [Automount]
+ Where=/dev/mqueue
+--
+1.7.4.4
+
diff --git a/systemd.spec b/systemd.spec
index dacf936..ea3c08b 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -2,7 +2,7 @@ Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Version: 26
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPLv2+
Group: System Environment/Base
Summary: A System and Service Manager
@@ -46,6 +46,22 @@ Patch6: 0001-readahead-common-fix-total-memory-size-detection.patch
Patch7: 0001-systemctl-fix-is-enabled-for-native-units-under-lib.patch
Patch8: 0001-dbus-fix-name-of-capability-property.patch
Patch9: 0001-pam-module-add-debug-parameter.patch
+Patch10: 0001-systemctl-Add-SYSTEMD_PAGER-for-setting-the-pager-to.patch
+Patch11: 0001-manager-include-full-systemctl-status-command-line-i.patch
+Patch12: 0001-swap-ignore-missing-proc-swaps.patch
+Patch13: 0001-unit-when-loading-symlinked-template-units-properly-.patch
+Patch14: 0001-execute-don-t-choke-when-systemd-was-compiled-with-a.patch
+Patch15: 0001-execute-fix-PAM-error-checking.patch
+Patch16: 0001-umount-ignore-missing-proc-swaps.patch
+Patch17: 0001-units-enable-dev-hugepages.automount-and-dev-mqueue..patch
+Patch18: 0001-tmpfiles-don-t-exit-with-an-error-code-if-we-cannot-.patch
+Patch19: 0001-manager-consider-the-active-job-when-merging.patch
+Patch20: 0001-shutdown-accept-minutes-argument-without.patch
+Patch21: 0001-shutdown-respect-the-dry-run-option-k.patch
+Patch22: 0001-shutdown-print-the-standard-wall-message-even-when-t.patch
+Patch23: 0001-systemadm-report-GLib.Error-only-to-stderr.patch
+Patch24: 0001-password-agent-make-sure-not-to-access-unallocated-m.patch
+Patch25: 0001-password-agent-actually-really-don-t-access-unalloca.patch
Patch100: fedora-storage-detect-encrypted-PVs.patch
# For sysvinit tools
@@ -110,6 +126,22 @@ SysV compatibility tools for systemd
%patch7 -p1
%patch8 -p1
%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+%patch25 -p1
%patch100 -p1
%build
@@ -313,6 +345,12 @@ fi
%{_bindir}/systemd-sysv-convert
%changelog
+* Mon Jul 04 2011 Michal Schmidt <mschmidt at redhat.com> 26-6
+- Cherry-picked a bunch of upstream patches.
+- Fixes: BZ#633774, BZ#708886, BZ#712710, BZ#716663
+- Partially fixes: BZ#624149
+- other small fixes
+
* Mon Jun 20 2011 Michal Schmidt <mschmidt at redhat.com> - 26-5
- Temporary workaround to detect LVM VGs on encrypted PVs. (BZ#708684)
More information about the scm-commits
mailing list