Re: [systemd-devel] [PATCHv2] logind: Support logind.conf.d directories in the usual search paths

2014-10-16 Thread Mantas Mikulėnas
On Fri, Oct 17, 2014 at 7:29 AM, Josh Triplett wrote: > This makes it possible to drop in logind configuration snippets from a > package or other configuration management mechanism. I'm still very curious what packages would need to install drop-ins for logind? > Introduce a new helper, conf_par

[systemd-devel] [PATCHv2] logind: Support logind.conf.d directories in the usual search paths

2014-10-16 Thread Josh Triplett
This makes it possible to drop in logind configuration snippets from a package or other configuration management mechanism. Introduce a new helper, conf_parse_many, to parse configuration files in a search path. systemd now installs /usr/lib/systemd/logind.conf.d/50-default.conf rather than /etc/

Re: [systemd-devel] [PATCH] logind: Support /etc/systemd/logind.conf.d/*.conf

2014-10-16 Thread Josh Triplett
On Thu, Oct 16, 2014 at 09:42:50AM -0400, Rahul Sundaram wrote: > On Thu, Oct 16, 2014 at 6:27 AM, Josh Triplett wrote: > > This makes it possible to drop in configuration file snippets from a > > package or other configuration management mechanism. > > Shouldn't those go into /usr according to >

Re: [systemd-devel] [PATCH 4/5] shared:util : Remove shadow compile warning

2014-10-16 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Oct 17, 2014 at 02:16:14AM +0300, Philippe De Swert wrote: > Hi, > > On 17/10/14 02:09, Zbigniew Jędrzejewski-Szmek wrote: > > On Fri, Oct 17, 2014 at 12:43:52AM +0300, philippedesw...@gmail.com wrote: > >> From: Philippe De Swert > >> > >> Removes the following compilation warning: > >>

Re: [systemd-devel] [PATCH 4/5] shared:util : Remove shadow compile warning

2014-10-16 Thread Philippe De Swert
Hi, On 17/10/14 02:09, Zbigniew Jędrzejewski-Szmek wrote: > On Fri, Oct 17, 2014 at 12:43:52AM +0300, philippedesw...@gmail.com wrote: >> From: Philippe De Swert >> >> Removes the following compilation warning: >> src/shared/util.c: In function 'rm_rf_children_dangerous': >> src/shared/util.c:280

Re: [systemd-devel] [PATCH 4/5] shared:util : Remove shadow compile warning

2014-10-16 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Oct 17, 2014 at 12:43:52AM +0300, philippedesw...@gmail.com wrote: > From: Philippe De Swert > > Removes the following compilation warning: > src/shared/util.c: In function 'rm_rf_children_dangerous': > src/shared/util.c:2800:22: warning: declaration of 'is_dir' shadows a global > declar

[systemd-devel] [PATCH 1/5] journal : fix uninitialized var in coredump

2014-10-16 Thread philippedeswert
From: Philippe De Swert "Fix" the following warning: src/journal/coredump.c: In function ‘main’: src/journal/coredump.c:717:42: warning: ‘sz’ may be used uninitialized in this function [-Wmaybe-uninitialized] --- src/journal/coredump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[systemd-devel] [PATCH 4/5] shared:util : Remove shadow compile warning

2014-10-16 Thread philippedeswert
From: Philippe De Swert Removes the following compilation warning: src/shared/util.c: In function 'rm_rf_children_dangerous': src/shared/util.c:2800:22: warning: declaration of 'is_dir' shadows a global declaration [-Wshadow] In file included from src/shared/util.c:77:0: src/shared/mkdir.h:45:5:

[systemd-devel] [PATCH 5/5] test-strv : Fix shadowing compilation warning

2014-10-16 Thread philippedeswert
From: Philippe De Swert Remove the following warning during compilation: src/test/test-strv.c: In function ‘test_strv_quote_unquote’: src/test/test-strv.c:140:56: warning: declaration of ‘split’ shadows a global declaration [-Wshadow] In file included from src/test/test-strv.c:25:0: ./src/shared

[systemd-devel] [PATCH 0/5] Fix compiler warnings

2014-10-16 Thread philippedeswert
From: Philippe De Swert This patchset silences a number of compiler warnings. Most of them are more of a cosmetic nature, but can be useful anyway ;) Philippe De Swert (5): journal : fix uninitialized var in coredump libsystemd:terminal :fix uninitialized warning resolve: Remove implicit d

[systemd-devel] [PATCH 3/5] resolve: Remove implicit declaration

2014-10-16 Thread philippedeswert
From: Philippe De Swert Removes this compilation warning: src/resolve/resolved.c: In function ‘main’: src/resolve/resolved.c:49:9: warning: implicit declaration of function ‘label_init’ [-Wimplicit-function-declaration] src/resolve/resolved.c:49:9: warning: nested extern declaration of ‘label_in

[systemd-devel] [PATCH] kdbus: free returned buffer when the memory is no longer needed

2014-10-16 Thread Lukasz Skalski
--- src/libsystemd/sd-bus/bus-control.c | 43 - 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c index 7b106a3..9bb6e5b 100644 --- a/src/libsystemd/sd-bus/bus-control.c +++

[systemd-devel] [PATCH] resolve: add missing header

2014-10-16 Thread Lukasz Skalski
Change-Id: I64f7c6b446f6d92057c35cc3d4e29bd2bad8f75b --- src/resolve/resolved.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/resolve/resolved.c b/src/resolve/resolved.c index ef416e5..abd6314 100644 --- a/src/resolve/resolved.c +++ b/src/resolve/resolved.c @@ -22,6 +22,7 @@ #include "s

Re: [systemd-devel] [PATCH] sysctl.d: default to fq_codel, fight bufferbloat

2014-10-16 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Oct 16, 2014 at 02:05:47PM +0200, Michal Schmidt wrote: > Quoting from Jon Corbet's report of Stephen Hemminger's talk at Linux > Plumbers Conference 2014 (https://lwn.net/Articles/616241/): > > [...] So Stephen encouraged everybody to run a command like: > > sysctl -w net.core.de

Re: [systemd-devel] [PATCH] logind: Support /etc/systemd/logind.conf.d/*.conf

2014-10-16 Thread Josh Triplett
On Thu, Oct 16, 2014 at 03:36:57PM +0200, Zbigniew Jędrzejewski-Szmek wrote: > On Thu, Oct 16, 2014 at 12:27:21PM +0200, Josh Triplett wrote: > > This makes it possible to drop in configuration file snippets from a > > package or other configuration management mechanism. > What kind of settings wou

Re: [systemd-devel] [PATCH] logind: Support /etc/systemd/logind.conf.d/*.conf

2014-10-16 Thread Rahul Sundaram
Hi On Thu, Oct 16, 2014 at 6:27 AM, Josh Triplett wrote: > This makes it possible to drop in configuration file snippets from a > package or other configuration management mechanism. > Shouldn't those go into /usr according to http://0pointer.net/blog/projects/stateless.html Rahul ___

Re: [systemd-devel] [PATCH] logind: Support /etc/systemd/logind.conf.d/*.conf

2014-10-16 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Oct 16, 2014 at 12:27:21PM +0200, Josh Triplett wrote: > This makes it possible to drop in configuration file snippets from a > package or other configuration management mechanism. What kind of settings would you install in this way? Zbyszek ___

Re: [systemd-devel] How to use cgroups for Tracker?

2014-10-16 Thread Martyn Russell
On 15/10/14 16:01, David Timothy Strauss wrote: I'm responding here only to the systemd list. Thanks David, I appreciate your comments. On Tue, Oct 14, 2014 at 4:35 PM, Martyn Russell wrote: Does anyone have any suggestions or projects that lead by example that Tracker could/should follow?

Re: [systemd-devel] [PATCH 21/26] hashmap: rewrite the implementation

2014-10-16 Thread Michal Schmidt
On 10/16/2014 09:50 AM, Michal Schmidt wrote: > --- a/src/shared/hashmap.h > +++ b/src/shared/hashmap.h > @@ -6,6 +6,7 @@ >This file is part of systemd. > >Copyright 2010 Lennart Poettering > + Copyright 2014 Lennart Poettering Oh, I'll fix this before pushing upstream. Michal ___

[systemd-devel] [PATCH] sysctl.d: default to fq_codel, fight bufferbloat

2014-10-16 Thread Michal Schmidt
Quoting from Jon Corbet's report of Stephen Hemminger's talk at Linux Plumbers Conference 2014 (https://lwn.net/Articles/616241/): [...] So Stephen encouraged everybody to run a command like: sysctl -w net.core.default_qdisc=fq_codel That will cause fq_codel to be used for all future

Re: [systemd-devel] [PATCH] logind: Support /etc/systemd/logind.conf.d/*.conf

2014-10-16 Thread David Timothy Strauss
Changes like this make config management so much easier. +1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] [PATCH] logind: Support /etc/systemd/logind.conf.d/*.conf

2014-10-16 Thread Josh Triplett
This makes it possible to drop in configuration file snippets from a package or other configuration management mechanism. --- man/logind.conf.xml | 4 +++- src/login/logind.c | 21 + src/shared/conf-parser.c | 19 +++ src/shared/conf-parser.h | 7 ++

[systemd-devel] [PATCH 1/3] label: rearrange mandatory access control(MAC) apis

2014-10-16 Thread WaLyong Cho
move label apis to selinux-util.ch or smack-util.ch appropriately. --- src/shared/label.c| 554 -- src/shared/label.h| 31 +-- src/shared/mkdir-label.c | 26 +++ src/shared/mkdir.h| 2 +- src/shared/selinux-util.c | 481 +

[systemd-devel] [PATCH 3/3] udev: do NOT re-label smack

2014-10-16 Thread WaLyong Cho
If selinux is disabled and smack is only enabled, smack label is relable-ed by label_fix. To avoid, make only be labeled for selinux. --- src/udev/udev-node.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index 9796672..6dd4e74

[systemd-devel] [PATCH 2/3] mac: rename apis with mac_{selinux/smack}_ prefix

2014-10-16 Thread WaLyong Cho
--- src/core/execute.c| 2 +- src/core/main.c | 4 ++-- src/core/namespace.c | 4 ++-- src/core/selinux-setup.c | 4 ++-- src/core/socket.c | 26 +- src/hostname/hostnamed.c | 2 +- src/lo

[systemd-devel] [PATCH 21/26] hashmap: rewrite the implementation

2014-10-16 Thread Michal Schmidt
This is a rewrite of the hashmap implementation. Its advantage is lower memory usage. It uses open addressing (entries are stored in an array, as opposed to linked lists). Hash collisions are resolved with linear probing and Robin Hood displacement policy. See the references in hashmap.c. Some fu

[systemd-devel] [PATCH 22/26] test: adjust max load factor in test_hashmap_many

2014-10-16 Thread Michal Schmidt
--- src/test/test-hashmap-plain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c index 17b72a7..8ea793d 100644 --- a/src/test/test-hashmap-plain.c +++ b/src/test/test-hashmap-plain.c @@ -699,9 +699,9 @@ static v

[systemd-devel] [PATCH 20/26] util: add log2u, log2u_round_up

2014-10-16 Thread Michal Schmidt
two's logarithms for unsigned. --- src/shared/util.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/shared/util.h b/src/shared/util.h index 21a90a4..dfb4341 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -829,6 +829,21 @@ static inline int log2i(int x) {

[systemd-devel] [PATCH 19/26] unit: adjust for the possibility of set_move failing

2014-10-16 Thread Michal Schmidt
--- src/core/unit.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/core/unit.c b/src/core/unit.c index 41b9ba4..e40e6f2 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -553,29 +553,38 @@ const char* unit_sub_state_to_string(Unit *u)

[systemd-devel] [PATCH 15/26] test: add test for hashmap_reserve()

2014-10-16 Thread Michal Schmidt
--- src/test/test-hashmap-plain.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c index 6b93ed6..1c2c556 100644 --- a/src/test/test-hashmap-plain.c +++ b/src/test/test-hashmap-plain.c @@ -795,6 +795,23 @@ static

[systemd-devel] [PATCH 14/26] hashmap: introduce hashmap_reserve()

2014-10-16 Thread Michal Schmidt
With the current hashmap implementation that uses chaining, placing a reservation can serve two purposes: - To optimize putting of entries if the number of entries to put is known. The reservation allocates buckets, so later resizing can be avoided. - To avoid having very long bucket chains

[systemd-devel] [PATCH 16/26] install, cgtop: adjust hashmap_move_one callers for -ENOMEM possibility

2014-10-16 Thread Michal Schmidt
That hashmap_move_one() currently cannot fail with -ENOMEM is an implementation detail, which is not possible to guarantee in general. Hashmap implementations based on anything else than chaining of individual entries may have to allocate. hashmap_move_one will not fail with -ENOMEM if a proper re

[systemd-devel] [PATCH 24/26] configure.ac: add --enable-hashmap-debug option

2014-10-16 Thread Michal Schmidt
The option simply enables hashmap debugging by defining ENABLE_HASHMAP_DEBUG. I suggest developing new code with it enabled, to have the iterator checks. --- configure.ac | 7 +++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 945adfc..02a1923 100644 --- a/con

[systemd-devel] [PATCH 13/26] hashmap: return more information from resize_buckets

2014-10-16 Thread Michal Schmidt
Return 0 if no resize was needed, 1 if successfully resized and negative on error. --- src/shared/hashmap.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c index 1ae3602..2a152ab 100644 --- a/src/shared/hashmap.c +++ b/src/

[systemd-devel] [PATCH 08/26] journal: make Server::user_journals a LinkedHashmap

2014-10-16 Thread Michal Schmidt
Order matters here. It replaces oldest entries first when USER_JOURNALS_MAX is reached. --- src/journal/journald-server.c | 24 src/journal/journald-server.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/journal/journald-server.c b/src/journ

[systemd-devel] [PATCH 02/26] test: generate tests for LinkedHashmap from Hashmap tests

2014-10-16 Thread Michal Schmidt
test-hashmap-linked.c is generated from test-hashmap-plain.c simply by substituting "linked_hashmap" for "hashmap" etc. In the cases where tests rely on the order of entries, a distinction between plain and linked hashmaps is made using the LINKED macro, which is defined only for test-hashmap-link

[systemd-devel] [PATCH 04/26] hashmap: hashmap_move_one should return -ENOENT when 'other' is NULL

2014-10-16 Thread Michal Schmidt
-ENOENT is the same return value as if 'other' were an allocated hashmap that does not contain the key. A NULL hashmap is a possible way of expressing a hashmap that contains no key. --- src/shared/hashmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/hashm

[systemd-devel] [PATCH 06/26] install: make InstallContext::{will_install, have_installed} LinkedHashmaps

2014-10-16 Thread Michal Schmidt
It appears order may matter here. Use LinkedHashmaps to be safe. --- src/shared/install.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/shared/install.c b/src/shared/install.c index ff5dcba..4b9fb7a 100644 --- a/src/shared/instal

[systemd-devel] [PATCH 12/26] shared: split mempool implementation from hashmaps

2014-10-16 Thread Michal Schmidt
--- Makefile.am | 2 + src/shared/hashmap.c | 101 ++- src/shared/mempool.c | 94 +++ src/shared/mempool.h | 55 4 files changed, 171 insertions(+), 81 deletions(-)

[systemd-devel] [PATCH 18/26] hashmap: allow hashmap_move to fail

2014-10-16 Thread Michal Schmidt
It cannot fail in the current hashmap implementation, but it may fail in alternative implementations (unless a sufficiently large reservation has been placed beforehand). --- src/shared/hashmap.c | 8 +--- src/shared/hashmap.h | 6 +++--- src/shared/set.c | 2 +-

[systemd-devel] [PATCH 23/26] tools: add gdb command to dump hashmap information

2014-10-16 Thread Michal Schmidt
$ sudo gdb -p 1 ... (gdb) source gdb-sd_dump_hashmaps.py (gdb) sd_dump_hashmaps ... lists allocated hashmaps ... (gdb) sd_dump_hashmaps 1 ... lists allocated hashmaps, their DIB histograms and contiguous blocks statistics ... --- Makefile.am | 3 ++ tools/gdb-sd_dump_h

[systemd-devel] [PATCH 01/26] hashmap: add LinkedHashmap as a distinct type

2014-10-16 Thread Michal Schmidt
Few Hashmaps/Sets need to remember the insertion order. Most don't care about the order when iterating. It would be possible to use more compact hashmap storage in the latter cases. Add LinkedHashmap as a distinct type from Hashmap, with functions prefixed with "linked_". For now, the functions ar

[systemd-devel] [PATCH 07/26] journal: make JournalFile::chain_cache a LinkedHashmap

2014-10-16 Thread Michal Schmidt
The order of entries may matter here. Oldest entries are evicted first when the cache is full. (Though I don't see anything to rejuvenate entries on cache hits.) --- src/journal/journal-file.c | 16 src/journal/journal-file.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions

[systemd-devel] [PATCH 25/26] test: test a corner case in hashmap_remove_and_replace

2014-10-16 Thread Michal Schmidt
--- src/test/test-hashmap-plain.c | 20 1 file changed, 20 insertions(+) diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c index 8ea793d..f9553c9 100644 --- a/src/test/test-hashmap-plain.c +++ b/src/test/test-hashmap-plain.c @@ -380,6 +380,7 @@ static

[systemd-devel] [PATCH 26/26] shared: drop mempool, now unused

2014-10-16 Thread Michal Schmidt
--- Makefile.am | 2 -- src/shared/mempool.c | 94 src/shared/mempool.h | 55 -- 3 files changed, 151 deletions(-) delete mode 100644 src/shared/mempool.c delete mode 100644 src/shared/mempool.h diff --gi

[systemd-devel] [PATCH 03/26] test: add and improve hashmap tests

2014-10-16 Thread Michal Schmidt
Test more corner cases and error states in several tests. Add new tests for: hashmap_move hashmap_remove hashmap_remove2 hashmap_remove_value hashmap_remove_and_replace hashmap_get2 hashmap_first In test_hashmap_many additionally test with an intentionally bad hash function. --- sr

[systemd-devel] [PATCH 05/26] hashmap: drop assert(h) from linked_hashmap_next

2014-10-16 Thread Michal Schmidt
It's handled just fine by returning NULL. --- src/shared/hashmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c index c4fde89..8225b8e 100644 --- a/src/shared/hashmap.c +++ b/src/shared/hashmap.c @@ -945,7 +945,6 @@ void *hashmap_next(Hashmap *h, c

[systemd-devel] [PATCH 09/26] journal: make sd_journal::files a LinkedHashmap

2014-10-16 Thread Michal Schmidt
Anything that uses hashmap_next() almost certainly cares about the order and needs to be a LinkedHashmap. --- src/journal/journal-internal.h | 2 +- src/journal/journalctl.c | 6 +++--- src/journal/sd-journal.c | 38 +++--- 3 files changed, 23 insertio

[systemd-devel] [PATCH 11/26] resolve: make DnsScope::conflict_queue a LinkedHashmap

2014-10-16 Thread Michal Schmidt
on_conflict_dispatch() uses hashmap_steal_first() and then does something non-trivial with it. It may care about the order. --- src/resolve/resolved-dns-scope.c | 10 +- src/resolve/resolved-dns-scope.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/resolve/res

[systemd-devel] [PATCH 10/26] sd-bus: make sd_bus::reply_callbacks a LinkedHashmap

2014-10-16 Thread Michal Schmidt
The way process_closing() picks the first entry from reply_callbacks and works with it makes it likely that it cares about the order. --- src/libsystemd/sd-bus/bus-internal.h | 2 +- src/libsystemd/sd-bus/bus-slot.c | 2 +- src/libsystemd/sd-bus/sd-bus.c | 14 +++--- 3 files ch

[systemd-devel] [PATCH 00/26] hashmap rewrite

2014-10-16 Thread Michal Schmidt
Hello, I rewrote the hashmaps implementation to use less memory. See patch PATCH 21/26 for details and some measurements. I'd like to push this upstream after v217 is released, unless there are objections. Key changes that affect other code: - Sets and Hashmaps do not remember the insertion ord

[systemd-devel] [PATCH] shell-completion/bash: add add-wants and add-requires

2014-10-16 Thread Lukas Nykryn
--- shell-completion/bash/systemctl.in | 12 1 file changed, 12 insertions(+) diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index afa80da..30ba668 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.in @@ -74,6