[systemd-devel] [PATCH 11/17] journal: add sd_journal_open_files

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
This allows the caller to explicitly specify which journal files should be opened. The same functionality could be achieved before by creating a directory and playing around with symlinks. It is useful to debug stuff and explore the journal, and has been requested before. Waiting is supported, the

[systemd-devel] [PATCH 17/17] journal: letting (interleaved) seqnums go

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
In the following scenario: server creates system.journal server creates user-1000.journal both journals share the same seqnum_id. Then server writes to user-1000.journal first, and server writes to system.journal a bit later, and everything is fine. The server then terminates (crash, reboot

[systemd-devel] [PATCH 12/17] journalctl: allow the user to specify the file(s) to use

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
This is useful for debugging and feels pretty natural. For example answering the question "is this big .journal file worth keeping?" is made easier. --- man/journalctl.xml | 32 +++- src/journal/journalctl.c | 35 ++- src/shared/uti

[systemd-devel] [PATCH 16/17] tests: add testcase for duplicate seqnums

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
--- src/journal/test-journal-interleaving.c | 129 1 file changed, 115 insertions(+), 14 deletions(-) diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c index c83a1ea..069d297 100644 --- a/src/journal/test-journal-inter

[systemd-devel] [PATCH 14/17] journal: change direction tests to use the same convention (cp np)

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
The order was different in various places, which makes it harder to read to code. Also consistently use ternany for all direction checks. Remove one free(NULL). --- src/journal/sd-journal.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/journal/s

[systemd-devel] [PATCH 13/17] journal: remember last direction of search and keep offset cache

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
The fields in JournalFile are moved around to avoid wasting 7 bytes because of alignment. --- TODO | 3 --- src/journal/journal-file.h | 18 +++--- src/journal/sd-journal.c | 11 +-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/TODO

[systemd-devel] [PATCH 15/17] tests: add testcase for skipping-entries-on-direction-change-bug

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
From: Marius Vollmer This test case failed until a3e6f050de8. Taken from https://bugs.freedesktop.org/show_bug.cgi?id=65255. --- Makefile.am | 9 ++ src/journal/test-journal-interleaving.c | 198 2 files changed, 207 insertions(+)

[systemd-devel] [PATCH 10/17] tests: add test for empty journal files

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
The headers are currently not printed properly: some "(null)"s appear. --- TODO | 2 ++ src/journal/test-journal.c | 60 ++ 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index fc8044b..0dd19a0 100644 -

[systemd-devel] [PATCH 09/17] journalctl: print monotonic timestamp in --header

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
--- src/journal/journal-file.c| 6 -- src/journal/journald-server.c | 19 +++ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 073e4a4..b3c9a92 100644 --- a/src/journal/journal-file.c +++ b/src/jo

[systemd-devel] [PATCH 08/17] journalctl: print proper IDs with --header

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
The same buffer was used for two different IDs, messing up the output. The same idea of using alloca() is applied in a few other places. --- src/journal/journal-file.c| 9 - src/journal/journald-server.c | 3 +-- src/shared/logs-show.c| 9 - 3 files changed, 9 insertio

[systemd-devel] [PATCH 07/17] Use stdint.h macros instead of casts to print uint64_t values

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
Casts are visually heavy, and can obscure unwanted truncations. --- src/core/execute.c | 2 +- src/journal/journal-authenticate.c | 10 ++-- src/journal/journal-file.c | 90 ++-- src/journal/journal-gatewayd.c | 12 ++--- src/journal/jou

[systemd-devel] [PATCH 06/17] Properly check for overflow in offsets

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
--- src/shared/util.c| 18 ++ src/test/test-util.c | 39 +++ 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/src/shared/util.c b/src/shared/util.c index 2edf9cd..bc89c1e 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @

[systemd-devel] [PATCH 05/17] journalctl: no color for --reboot-- when not on tty

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
--- src/journal/journalctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index a389543..d89684b 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1334,12 +1334,14 @@ int main(int argc, char *argv[

[systemd-devel] [PATCH 04/17] journal: loop less in MATCH_AND_TERM conditionals

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
AND term usually don't have many subterms (4 seems to be the maximum sensible number, e.g. _BOOT_ID && _SYSTEMD_UNIT && _PID && MESSAGE_ID). Nevertheless, the cost of checking each subterm can be relatively high, especially when the nested terms are compound, and it makes sense to minimize the numb

[systemd-devel] [PATCH 03/17] journalctl: add --system/--user flags

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
--user basically gives messages from your own systemd --user services. --system basically gives messages from PID 1, kernel, and --system services. Those two options are not exahustive, because a priviledged user might be able to see messages from other users, and they will not be shown with either

[systemd-devel] [PATCH 02/17] journal: add ability to filter by current user

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
This is the just the library part. SD_JOURNAL_CURRENT_USER flags is added to sd_j_open(), to open files from current user. SD_JOURNAL_SYSTEM_ONLY is renamed to SD_JOURNAL_SYSTEM, and changed to mean to (also) open system files. This way various flags can be combined, which gives them nicer semant

[systemd-devel] [PATCH 01/17] journal: simplify match_free_if_empty

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
--- src/journal/sd-journal.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index cf60ebc..2bad243 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -197,9 +197,7 @@ static void matc

[systemd-devel] [PATCH 00/18] journal fixes and enhancements, please review

2013-06-07 Thread Zbigniew Jędrzejewski-Szmek
Hi, this is a small series with journal cleanups, enhancements, and bugfixes: Patches marked with (*) are the ones worth looking at. The last one is (hopefully) a fix for the production of journals which cause journalctl to loop. It doesn't fix the problem of looping on such journals, but should h

Re: [systemd-devel] Running "systemd --user" and creating a new session

2013-06-07 Thread Ivan Shapovalov
On 07 June 2013 12:47:28 Kok, Auke-jan H wrote: > On Fri, Jun 7, 2013 at 3:18 AM, Иван Шаповалов wrote: > > Hi all, > > > > Recently I've attempted to switch my user session to "systemd --user". The > > configuration is pretty simple - no multiseat, nothing special. > > I start the user session w

Re: [systemd-devel] [PATCH] udev: make net_id more robust

2013-06-07 Thread Sean McGovern
This is definitely not a common case as almost all of the other Linux machines I have access to expose a network controller in domain 0. At least in my case each of the domains has a bus ID unique to amongst all of the domains, but I'm reasonably sure this isn't mandated by the PCI specification

Re: [systemd-devel] [PATCH] udev: make net_id more robust

2013-06-07 Thread Kay Sievers
On Fri, Jun 7, 2013 at 10:58 PM, Sean McGovern wrote: > Ignore this patch then -- I can't change the PCI geography of my older G4 Mac > Mini, and without this patch predictable interface naming does not work for > it. > > I'll just keep it locally. Maybe we can add support for it, we would need

Re: [systemd-devel] [PATCH] udev: make net_id more robust

2013-06-07 Thread Sean McGovern
Ignore this patch then -- I can't change the PCI geography of my older G4 Mac Mini, and without this patch predictable interface naming does not work for it. I'll just keep it locally. -- Sean McGovern --Original Message-- From: Kay Sievers To: McGovern, Sean Cc: [email protected]

Re: [systemd-devel] Running "systemd --user" and creating a new session

2013-06-07 Thread Kok, Auke-jan H
On Fri, Jun 7, 2013 at 3:18 AM, Иван Шаповалов wrote: > Hi all, > > Recently I've attempted to switch my user session to "systemd --user". The > configuration is pretty simple - no multiseat, nothing special. > I start the user session with provided "[email protected]" with some > modifications: > > -

Re: [systemd-devel] Patch to show systemd & generators

2013-06-07 Thread Thomas H.P. Andersen
On Thu, Jun 6, 2013 at 11:10 AM, Lennart Poettering wrote: > On Tue, 14.05.13 08:59, Thomas H.P. Andersen ([email protected]) wrote: > >> >> Would you be interested in a patch that shows "Systemd + Generators" or >> >> maybe only "Generators"? >> > >> > Well, I guess it makes sense to show how much

Re: [systemd-devel] [PATCH] udev: make net_id more robust

2013-06-07 Thread Kay Sievers
On Fri, Jun 7, 2013 at 3:27 PM, Sean McGovern wrote: > Onboard network controllers are not always on PCI domain 0. > +sysname = udev_device_get_sysname(names->pcidev); > + > +if(!sysname) > +return -ENOENT; > + > +if(!strlen(sysname)) > +return -ENO

[systemd-devel] [PATCH] udev: make net_id more robust

2013-06-07 Thread Sean McGovern
Onboard network controllers are not always on PCI domain 0. --- src/udev/udev-builtin-net_id.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 5719021..3e77f30 100644 --- a/src/udev/udev-built

[systemd-devel] Running "systemd --user" and creating a new session

2013-06-07 Thread Иван Шаповалов
Hi all, Recently I've attempted to switch my user session to "systemd --user". The configuration is pretty simple - no multiseat, nothing special. I start the user session with provided "[email protected]" with some modifications: --- /usr/lib/systemd/system/[email protected] 2013-05-30 16:55:28.