From 96237b5868f5f0b53b7c355edbdac89485028d12 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mar 07 2014 05:44:59 +0000 Subject: Bugfix backports --- diff --git a/0018-add-bash-completion-for-systemd-cgls.patch b/0018-add-bash-completion-for-systemd-cgls.patch new file mode 100644 index 0000000..3be4558 --- /dev/null +++ b/0018-add-bash-completion-for-systemd-cgls.patch @@ -0,0 +1,86 @@ +From 8523c2a84f3d8a8b163a17aad5c55cb0234ebff2 Mon Sep 17 00:00:00 2001 +From: Thomas Hindoe Paaboel Andersen +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 . ++ ++__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 diff --git a/0019-hwdb-Update-database-of-Bluetooth-company-identifier.patch b/0019-hwdb-Update-database-of-Bluetooth-company-identifier.patch new file mode 100644 index 0000000..c63a9df --- /dev/null +++ b/0019-hwdb-Update-database-of-Bluetooth-company-identifier.patch @@ -0,0 +1,27 @@ +From a63a8b12c107215fa8b84ca792e84bc2789e6163 Mon Sep 17 00:00:00 2001 +From: Marcel Holtmann +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 diff --git a/0020-Allow-fractional-parts-in-disk-sizes.patch b/0020-Allow-fractional-parts-in-disk-sizes.patch new file mode 100644 index 0000000..bec6b9e --- /dev/null +++ b/0020-Allow-fractional-parts-in-disk-sizes.patch @@ -0,0 +1,156 @@ +From 4cae8946d581a6ecf0b26e154bf9c00e390024b2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +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(); diff --git a/0021-add-bash-completion-for-systemd-cgtop.patch b/0021-add-bash-completion-for-systemd-cgtop.patch new file mode 100644 index 0000000..631495a --- /dev/null +++ b/0021-add-bash-completion-for-systemd-cgtop.patch @@ -0,0 +1,70 @@ +From 6b4293393eb0a15e4f73ba9f08554178ccc4c222 Mon Sep 17 00:00:00 2001 +From: Thomas Hindoe Paaboel Andersen +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 . ++ ++__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 diff --git a/0022-Fix-systemd-stdio-bridge-symlink.patch b/0022-Fix-systemd-stdio-bridge-symlink.patch new file mode 100644 index 0000000..8a7f2c3 --- /dev/null +++ b/0022-Fix-systemd-stdio-bridge-symlink.patch @@ -0,0 +1,27 @@ +From 877c2fccf76afdd7364040f9b859c8d84226b9cc Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +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 diff --git a/0023-execute-free-directory-path-if-we-fail-to-remove-it-.patch b/0023-execute-free-directory-path-if-we-fail-to-remove-it-.patch new file mode 100644 index 0000000..a88139d --- /dev/null +++ b/0023-execute-free-directory-path-if-we-fail-to-remove-it-.patch @@ -0,0 +1,52 @@ +From f0eb7735d8cdf44ebf7064613add363ddda329b0 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +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; + } + diff --git a/0024-update-bash-completion-for-systemd-analyze.patch b/0024-update-bash-completion-for-systemd-analyze.patch new file mode 100644 index 0000000..695a50b --- /dev/null +++ b/0024-update-bash-completion-for-systemd-analyze.patch @@ -0,0 +1,55 @@ +From 1ec5be9a85b46c697fc87405038427eaf9bebe1b Mon Sep 17 00:00:00 2001 +From: Thomas Hindoe Paaboel Andersen +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 diff --git a/0025-add-bash-completion-for-systemd-detect-virt.patch b/0025-add-bash-completion-for-systemd-detect-virt.patch new file mode 100644 index 0000000..6c8a489 --- /dev/null +++ b/0025-add-bash-completion-for-systemd-detect-virt.patch @@ -0,0 +1,70 @@ +From 191479e0e4fb43f667ce743e82aac8bcccfbd6e1 Mon Sep 17 00:00:00 2001 +From: Thomas Hindoe Paaboel Andersen +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 . ++ ++__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 diff --git a/0026-Do-not-print-invalid-UTF-8-in-error-messages.patch b/0026-Do-not-print-invalid-UTF-8-in-error-messages.patch new file mode 100644 index 0000000..1c9f603 --- /dev/null +++ b/0026-Do-not-print-invalid-UTF-8-in-error-messages.patch @@ -0,0 +1,123 @@ +From 799f37dd06946958dfed2aec54788c5e81bf340a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +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; + } + diff --git a/0027-architecture-Add-cris.patch b/0027-architecture-Add-cris.patch new file mode 100644 index 0000000..e825d2e --- /dev/null +++ b/0027-architecture-Add-cris.patch @@ -0,0 +1,53 @@ +From b4fb5c323dc77954867e0d896dce03edd094617a Mon Sep 17 00:00:00 2001 +From: Umut Tezduyar Lindskog +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 diff --git a/0028-add-bash-completion-for-systemd-cat.patch b/0028-add-bash-completion-for-systemd-cat.patch new file mode 100644 index 0000000..bcee26b --- /dev/null +++ b/0028-add-bash-completion-for-systemd-cat.patch @@ -0,0 +1,87 @@ +From 7f197e46c944bdb43fa1cedbd97708ac2ea72558 Mon Sep 17 00:00:00 2001 +From: Thomas Hindoe Paaboel Andersen +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 . ++ ++__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 diff --git a/0029-man-document-missing-options-of-systemd-run.patch b/0029-man-document-missing-options-of-systemd-run.patch new file mode 100644 index 0000000..dffdfe9 --- /dev/null +++ b/0029-man-document-missing-options-of-systemd-run.patch @@ -0,0 +1,111 @@ +From 4c626a758f12c2e5862b185de8ae954e0bd795d7 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +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 . + + + +- Provide description for the unit. If not +- specified, the command itself will be used as a description. +- See Description= in ++ Provide description for the service or scope ++ unit. If not specified, the command itself will be used as a ++ description. See Description= in + systemd.unit5. + + +@@ -128,10 +128,10 @@ along with systemd; If not, see . + + + +- 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 ++ 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 + RemainAfterExit= in + systemd.service5. + +@@ -141,15 +141,64 @@ along with systemd; If not, see . + + + +- 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 SendSIGHUP= in ++ 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 ++ SendSIGHUP= in + systemd.kill5. + + + + ++ ++ ++ ++ Sets the service type. Also see ++ Type= in ++ systemd.service5. This ++ option has no effect in conjunction with ++ . Defaults to ++ simple. ++ ++ ++ ++ ++ ++ ++ ++ Runs the service process under the UNIX user ++ and group. Also see User= and ++ Group= in ++ systemd.exec5. This ++ option has no effect in conjunction with ++ . ++ ++ ++ ++ ++ ++ ++ Runs the service process with the specified ++ nice level. Also see Nice= in ++ systemd.exec5. This ++ option has no effect in conjunction with ++ . ++ ++ ++ ++ ++ ++ ++ Runs the service process with the specified ++ environment variables set. Also see ++ Environment= in ++ systemd.exec5. This ++ option has no effect in conjunction with ++ . ++ ++ ++ + + + diff --git a/0030-systemd-run-add-some-extra-safety-checks.patch b/0030-systemd-run-add-some-extra-safety-checks.patch new file mode 100644 index 0000000..22f85f6 --- /dev/null +++ b/0030-systemd-run-add-some-extra-safety-checks.patch @@ -0,0 +1,32 @@ +From 37c3628037acb728660222ad836047c8bb81363f Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +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; + } diff --git a/0031-journal-assume-that-next-entry-is-after-previous-ent.patch b/0031-journal-assume-that-next-entry-is-after-previous-ent.patch new file mode 100644 index 0000000..27042f3 --- /dev/null +++ b/0031-journal-assume-that-next-entry-is-after-previous-ent.patch @@ -0,0 +1,68 @@ +From c77f203a510d27ab08729454bc865547c6111d02 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +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( diff --git a/0032-journal-forget-file-after-encountering-an-error.patch b/0032-journal-forget-file-after-encountering-an-error.patch new file mode 100644 index 0000000..e9e9562 --- /dev/null +++ b/0032-journal-forget-file-after-encountering-an-error.patch @@ -0,0 +1,73 @@ +From c360d2f3141cdc8ec67cddef3df99e4045b6c6d8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +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) { diff --git a/0033-core-correctly-unregister-PIDs-from-PID-hashtables.patch b/0033-core-correctly-unregister-PIDs-from-PID-hashtables.patch new file mode 100644 index 0000000..1b71d3a --- /dev/null +++ b/0033-core-correctly-unregister-PIDs-from-PID-hashtables.patch @@ -0,0 +1,100 @@ +From dd935122a989eeb31a0ab4d42ad5381f1f48446e Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +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); + } + } + diff --git a/0034-logind-fix-reference-to-systemd-user-sessions.servic.patch b/0034-logind-fix-reference-to-systemd-user-sessions.servic.patch new file mode 100644 index 0000000..f731000 --- /dev/null +++ b/0034-logind-fix-reference-to-systemd-user-sessions.servic.patch @@ -0,0 +1,23 @@ +From b7bc83734b75499d3bf9d5446adcb43818796da5 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +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); diff --git a/0035-man-update-link-to-LSB.patch b/0035-man-update-link-to-LSB.patch new file mode 100644 index 0000000..cdef40b --- /dev/null +++ b/0035-man-update-link-to-LSB.patch @@ -0,0 +1,33 @@ +From bc447bbd474ed77da1a9cce0dcf85fb4f0e7cb35 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +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 LSB ++ url="http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html">LSB + recommendations for SysV init + scripts. + +@@ -395,7 +395,7 @@ + exclusively on boot (and manually by the + administrator) via SysV init scripts, as + detailed in the LSB ++ url="http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html">LSB + Linux Standard Base Core + Specification. This method of + activation is supported ubiquitously on Linux diff --git a/0036-man-systemd-bootchart-fix-spacing-in-command.patch b/0036-man-systemd-bootchart-fix-spacing-in-command.patch new file mode 100644 index 0000000..5feeb3f --- /dev/null +++ b/0036-man-systemd-bootchart-fix-spacing-in-command.patch @@ -0,0 +1,27 @@ +From 7117b40be2484d2f318c14d42b8c1f47d44a4465 Mon Sep 17 00:00:00 2001 +From: Zachary Cook +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 systemd-analyze +- plot function. ++ the systemd-analyze plot ++ function. + + + Of course, bootchart can also be used at any diff --git a/0037-man-add-missing-comma.patch b/0037-man-add-missing-comma.patch new file mode 100644 index 0000000..1760670 --- /dev/null +++ b/0037-man-add-missing-comma.patch @@ -0,0 +1,25 @@ +From a478182ddc3abcacd006ecef8de8829c3ec51b13 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +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 @@ + See Also + + udev7 +- ++ , + + systemd-udevd.service8 + diff --git a/0038-build-sys-Don-t-distribute-generated-udev-rule.patch b/0038-build-sys-Don-t-distribute-generated-udev-rule.patch new file mode 100644 index 0000000..8c8c1f0 --- /dev/null +++ b/0038-build-sys-Don-t-distribute-generated-udev-rule.patch @@ -0,0 +1,38 @@ +From 66f231f4c71dfb11dc4552cb337571d3e3019c81 Mon Sep 17 00:00:00 2001 +From: Armin K +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 \ diff --git a/0039-units-Do-not-unescape-instance-name-in-systemd-backl.patch b/0039-units-Do-not-unescape-instance-name-in-systemd-backl.patch new file mode 100644 index 0000000..bc28a7b --- /dev/null +++ b/0039-units-Do-not-unescape-instance-name-in-systemd-backl.patch @@ -0,0 +1,37 @@ +From 50ab7a793277bd976ea68c1d74b999ce483af50b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20B=C3=A4chler?= +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 diff --git a/systemd.spec b/systemd.spec index 0bc4a98..4584253 100644 --- a/systemd.spec +++ b/systemd.spec @@ -16,7 +16,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 210 -Release: 4%{?gitcommit:.git%{gitcommit}}%{?dist} +Release: 5%{?gitcommit:.git%{gitcommit}}%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -56,6 +56,28 @@ 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 # kernel-install patch for grubby, drop if grubby is obsolete Patch1000: kernel-install-grubby.patch @@ -733,6 +755,12 @@ getent passwd systemd-journal-gateway >/dev/null 2>&1 || useradd -r -l -u 191 -g %{_datadir}/systemd/gatewayd %changelog +* Fri Mar 07 2014 Zbigniew Jędrzejewski-Szmek - 210-5 +- Bugfixes: #1047568, #1047039, #1071128, #1073402 +- Bash completions for more systemd tools +- Bluetooth database update +- Manpage fixes + * Thu Mar 06 2014 Zbigniew Jędrzejewski-Szmek - 210-4 - Apply work-around for ppc64le too (#1073647).