diff options
-rw-r--r-- | Makefile-man.am | 2 | ||||
-rw-r--r-- | Makefile.am | 12 | ||||
-rw-r--r-- | NEWS | 12 | ||||
-rw-r--r-- | TODO | 10 | ||||
-rw-r--r-- | man/udev_device_new_from_syspath.xml | 35 | ||||
-rw-r--r-- | src/basic/cgroup-util.c | 2 | ||||
-rw-r--r-- | src/basic/hashmap.c | 2 | ||||
-rw-r--r-- | src/basic/hashmap.h | 1 | ||||
-rw-r--r-- | src/import/pull.c | 16 | ||||
-rw-r--r-- | src/nspawn/nspawn.c | 11 | ||||
-rw-r--r-- | src/systemctl/systemctl.c | 37 | ||||
-rw-r--r-- | src/test/test-hashmap.c | 43 |
12 files changed, 107 insertions, 76 deletions
diff --git a/Makefile-man.am b/Makefile-man.am index 7d31800345..76c9389835 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -2142,10 +2142,8 @@ EXTRA_DIST += \ man/systemd-vconsole-setup.service.xml \ man/systemd.automount.xml \ man/systemd.device.xml \ - man/systemd.directives.xml \ man/systemd.exec.xml \ man/systemd.generator.xml \ - man/systemd.index.xml \ man/systemd.journal-fields.xml \ man/systemd.kill.xml \ man/systemd.link.xml \ diff --git a/Makefile.am b/Makefile.am index 7dc57b18da..936e4edd81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -700,11 +700,10 @@ noinst_DATA += \ CLEANFILES += \ man/index.html -XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml) NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES)) -SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES)) +SOURCE_XML_FILES = ${patsubst %,$(top_srcdir)/%,$(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))} -update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB) +update-man-list: $(top_srcdir)/tools/make-man-rules.py $(SOURCE_XML_FILES) $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am @echo "Makefile-man.am has been regenerated" @@ -726,7 +725,7 @@ endif endif EXTRA_DIST += \ - $(XML_FILES) \ + $(filter-out man/systemd.directives.xml,$(XML_FILES)) \ $(HTML_FILES) \ $(HTML_ALIAS) \ $(man_MANS) \ @@ -735,7 +734,6 @@ EXTRA_DIST += \ tools/xml_helper.py \ man/systemd.index.xml \ man/index.html \ - man/systemd.directives.xml \ man/glib-event-glue.c \ $(NULL) @@ -1283,14 +1281,14 @@ src/basic/cap-from-name.h: src/basic/cap-from-name.gperf $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@ -audit_list_includes = -include linux/audit.h missing.h +audit_list_includes = -include linux/audit.h -include missing.h if HAVE_AUDIT audit_list_includes += -include libaudit.h endif src/journal/audit_type-list.txt: $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/audit.h -include missing.h - </dev/null | grep -vE 'AUDIT_.*(FIRST|LAST)_' | $(SED) -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | sort -k2 >$@ + $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM $(audit_list_includes) - </dev/null | grep -vE 'AUDIT_.*(FIRST|LAST)_' | $(SED) -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | sort -k2 >$@ src/journal/audit_type-to-name.h: src/journal/audit_type-list.txt $(AM_V_at)$(MKDIR_P) $(dir $@) @@ -9,7 +9,7 @@ CHANGES WITH 221: supports both classic D-Bus as well as kdbus as transport backend. sd-event is a generic event loop abstraction that is built around Linux epoll, but adds features such as event - priorization or efficient timer handling. Both APIs are good + prioritization or efficient timer handling. Both APIs are good choices for C programs looking for a bus and/or event loop implementation that is minimal and does not have to be portable to other kernels. @@ -17,12 +17,12 @@ CHANGES WITH 221: * kdbus support is no longer compile-time optional. It is now always built-in. However, it can still be disabled at runtime using the kdbus=0 kernel command line setting, and - that setting my by changed to default to off, by specifying + that setting may be changed to default to off, by specifying --disable-kdbus at build-time. Note though that the kernel command line setting has no effect if the kdbus.ko kernel module is not installed, in which case kdbus is (obviously) also disabled. We encourage all downstream distributions to - begin testing kdbus by adding it to the kernel images if the + begin testing kdbus by adding it to the kernel images in the development distributions, and leaving kdbus support in systemd enabled. @@ -30,7 +30,7 @@ CHANGES WITH 221: 2.26. * Support for chkconfig (--enable-chkconfig) was removed in - favour of calling an abstraction tool + favor of calling an abstraction tool /lib/systemd/systemd-sysv-install. This needs to be implemented for your distribution. See "SYSV INIT.D SCRIPTS" in README for details. @@ -48,7 +48,7 @@ CHANGES WITH 221: external project. * The systemd-cgtop tool learnt a new --raw switch to generate - "raw" (machine parseable) output. + "raw" (machine parsable) output. * networkd's IPForwarding= .network file setting learnt the new setting "kernel", which ensures that networkd does not @@ -76,7 +76,7 @@ CHANGES WITH 221: Tezduyar Lindskog, Viktar Vauchkevich, Werner Fink, Zbigniew Jędrzejewski-Szmek - -- Berlin, 2015-05-XX + -- Berlin, 2015-06-XX CHANGES WITH 220: @@ -28,6 +28,16 @@ External: Features: +* Add PassEnvironment= setting to service units, to import select env vars from PID 1 into the service env block + +* nspawn: fix logic always print a final newline on output. + https://github.com/systemd/systemd/pull/272#issuecomment-113153176 + +* make nspawn's --network-veth switch more powerful: + http://lists.freedesktop.org/archives/systemd-devel/2015-June/033121.html + +* man: document that unless you use StandardError=null the shell >/dev/stderr won't work in shell scripts in services + * man: clarify that "machinectl show" shows different information than "machinectl status" (no cgroup tree, no IP addresses, ...) * "systemctl daemon-reload" should result in /etc/systemd/system.conf being reloaded by systemd diff --git a/man/udev_device_new_from_syspath.xml b/man/udev_device_new_from_syspath.xml index fc147a879a..9c4ab7a1bf 100644 --- a/man/udev_device_new_from_syspath.xml +++ b/man/udev_device_new_from_syspath.xml @@ -136,10 +136,37 @@ <constant>c</constant> for character devices, as well as a devnum (see <citerefentry><refentrytitle>makedev</refentrytitle><manvolnum>3</manvolnum></citerefentry>). <function>udev_device_new_from_subsystem_sysname</function> looks up devices based - on the provided subsystem and sysname and - <function>udev_device_new_from_device_id</function> looks up devices based on the provided - device id (see - <citerefentry><refentrytitle>udev_device_get_subsystem</refentrytitle><manvolnum>3</manvolnum></citerefentry>). + on the provided subsystem and sysname + (see <citerefentry><refentrytitle>udev_device_get_subsystem</refentrytitle><manvolnum>3</manvolnum></citerefentry> + and + <citerefentry><refentrytitle>udev_device_get_sysname</refentrytitle><manvolnum>3</manvolnum></citerefentry>) + and <function>udev_device_new_from_device_id</function> looks up devices based on the provided + device id which is a special string in one of the following four forms: + <table> + <title>Device ID strings</title> + + <tgroup cols='2'> + <colspec colname='example' /> + <colspec colname='explanation' /> + <thead><row> + <entry>Example</entry> + <entry>Explanation</entry> + </row></thead> + <tbody> + <row><entry><varname>b8:2</varname></entry> + <entry>block device major:minor</entry></row> + + <row><entry><varname>c128:1</varname></entry> + <entry>char device major:minor</entry></row> + + <row><entry><varname>n3</varname></entry> + <entry>network device ifindex</entry></row> + + <row><entry><varname>+sound:card29</varname></entry> + <entry>kernel driver core subsystem:device name</entry></row> + </tbody> + </tgroup> + </table> </para> <para><function>udev_device_new_from_environment</function> diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 66857f118f..439c5516dc 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -1776,7 +1776,7 @@ int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t if (!p) p = path; - cg_attach_fallback(n, path, pid); + cg_attach_fallback(n, p, pid); } bit <<= 1; diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index a84fc5b69e..7d2a4160c6 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -1804,8 +1804,6 @@ void *ordered_hashmap_next(OrderedHashmap *h, const void *key) { struct ordered_hashmap_entry *e; unsigned hash, idx; - assert(key); - if (!h) return NULL; diff --git a/src/basic/hashmap.h b/src/basic/hashmap.h index 5723f09ca9..2af23024de 100644 --- a/src/basic/hashmap.h +++ b/src/basic/hashmap.h @@ -65,7 +65,6 @@ typedef struct { } Iterator; #define _IDX_ITERATOR_FIRST (UINT_MAX - 1) -#define _IDX_ITERATOR_NIL (UINT_MAX) #define ITERATOR_FIRST ((Iterator) { .idx = _IDX_ITERATOR_FIRST, .next_key = NULL }) typedef unsigned long (*hash_func_t)(const void *p, const uint8_t hash_key[HASH_KEY_SIZE]); diff --git a/src/import/pull.c b/src/import/pull.c index ca33d2f3fa..ca7be6be85 100644 --- a/src/import/pull.c +++ b/src/import/pull.c @@ -245,15 +245,15 @@ static int pull_dkr(int argc, char *argv[], void *userdata) { if (digest) { reference = digest + 1; name = strndupa(argv[1], digest - argv[1]); - } - - reference = strchr(argv[1], ':'); - if (reference) { - name = strndupa(argv[1], reference - argv[1]); - reference++; } else { - name = argv[1]; - reference = "latest"; + reference = strchr(argv[1], ':'); + if (reference) { + name = strndupa(argv[1], reference - argv[1]); + reference++; + } else { + name = argv[1]; + reference = "latest"; + } } if (!dkr_name_is_valid(name)) { diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index d1154de08a..4cf2d14ae2 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -1538,7 +1538,16 @@ static int setup_resolv_conf(const char *dest) { r = copy_file("/etc/resolv.conf", where, O_TRUNC|O_NOFOLLOW, 0644, 0); if (r < 0) { - log_warning_errno(r, "Failed to copy /etc/resolv.conf to %s: %m", where); + /* If the file already exists as symlink, let's + * suppress the warning, under the assumption that + * resolved or something similar runs inside and the + * symlink points there. + * + * If the disk image is read-only, there's also no + * point in complaining. + */ + log_full_errno(IN_SET(r, -ELOOP, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to copy /etc/resolv.conf to %s: %m", where); return 0; } diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 23fc946fbf..538838b7fc 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5855,23 +5855,15 @@ static int run_editor(char **paths) { if (pid == 0) { const char **args; - char *editor; + char *editor, **editor_args = NULL; char **tmp_path, **original_path, *p; - unsigned i = 1; + unsigned n_editor_args = 0, i = 1; size_t argc; (void) reset_all_signal_handlers(); (void) reset_signal_mask(); argc = strv_length(paths)/2 + 1; - args = newa(const char*, argc + 1); - - args[0] = NULL; - STRV_FOREACH_PAIR(original_path, tmp_path, paths) { - args[i] = *tmp_path; - i++; - } - args[argc] = NULL; /* SYSTEMD_EDITOR takes precedence over EDITOR which takes precedence over VISUAL * If neither SYSTEMD_EDITOR nor EDITOR nor VISUAL are present, @@ -5884,9 +5876,30 @@ static int run_editor(char **paths) { editor = getenv("VISUAL"); if (!isempty(editor)) { - args[0] = editor; - execvp(editor, (char* const*) args); + editor_args = strv_split(editor, WHITESPACE); + if (!editor_args) { + (void) log_oom(); + _exit(EXIT_FAILURE); + } + n_editor_args = strv_length(editor_args); + argc += n_editor_args - 1; } + args = newa(const char*, argc + 1); + + if (n_editor_args > 0) { + args[0] = editor_args[0]; + for (; i < n_editor_args; i++) + args[i] = editor_args[i]; + } + + STRV_FOREACH_PAIR(original_path, tmp_path, paths) { + args[i] = *tmp_path; + i++; + } + args[i] = NULL; + + if (n_editor_args > 0) + execvp(args[0], (char* const*) args); FOREACH_STRING(p, "editor", "nano", "vim", "vi") { args[0] = p; diff --git a/src/test/test-hashmap.c b/src/test/test-hashmap.c index 767cbd90e9..d0e65001f5 100644 --- a/src/test/test-hashmap.c +++ b/src/test/test-hashmap.c @@ -24,38 +24,17 @@ void test_hashmap_funcs(void); void test_ordered_hashmap_funcs(void); static void test_ordered_hashmap_next(void) { - OrderedHashmap *m; - char *val1, *val2, *val3, *val4, *r; - - m = ordered_hashmap_new(&string_hash_ops); - val1 = strdup("val1"); - assert_se(val1); - val2 = strdup("val2"); - assert_se(val2); - val3 = strdup("val3"); - assert_se(val3); - val4 = strdup("val4"); - assert_se(val4); - - ordered_hashmap_put(m, "key 1", val1); - ordered_hashmap_put(m, "key 2", val2); - ordered_hashmap_put(m, "key 3", val3); - ordered_hashmap_put(m, "key 4", val4); - - r = ordered_hashmap_next(m, "key 1"); - assert_se(streq(r, val2)); - r = ordered_hashmap_next(m, "key 2"); - assert_se(streq(r, val3)); - r = ordered_hashmap_next(m, "key 3"); - assert_se(streq(r, val4)); - r = ordered_hashmap_next(m, "key 4"); - assert_se(!r); - r = ordered_hashmap_next(NULL, "key 1"); - assert_se(!r); - r = ordered_hashmap_next(m, "key 5"); - assert_se(!r); - - ordered_hashmap_free_free(m); + _cleanup_ordered_hashmap_free_ OrderedHashmap *m = NULL; + int i; + + assert_se(m = ordered_hashmap_new(NULL)); + for (i = -2; i <= 2; i++) + assert_se(ordered_hashmap_put(m, INT_TO_PTR(i), INT_TO_PTR(i+10)) == 1); + for (i = -2; i <= 1; i++) + assert_se(ordered_hashmap_next(m, INT_TO_PTR(i)) == INT_TO_PTR(i+11)); + assert_se(!ordered_hashmap_next(m, INT_TO_PTR(2))); + assert_se(!ordered_hashmap_next(NULL, INT_TO_PTR(1))); + assert_se(!ordered_hashmap_next(m, INT_TO_PTR(3))); } static void test_uint64_compare_func(void) { |