Commit graph

50 commits

Author SHA1 Message Date
Lennart Poettering cbdca8525b journal: beef up journal matches considerably
we now can take multiple matches, and they will apply as AND if they
apply to different fields and OR if they apply to the same fields. Also,
terms of this kind can be combined with an overreaching OR.
2012-07-13 00:32:32 +02:00
Lennart Poettering 362a3f8122 journal: check fields we search for more carefully 2012-07-13 00:32:32 +02:00
Lennart Poettering c4aff78b2d journal: fix interleaving of files with different time sources 2012-07-13 00:32:32 +02:00
Lennart Poettering 14a65d65a0 journalctl: add a marker to log output for reboots
With this we'll print a marker "----- Reboot -----" between two
subsequent lines with different boot IDs.
2012-07-11 01:36:55 +02:00
Lennart Poettering a963990ff4 journal: rework directory enumeration/watch logic
There's now sd_journal_new_directory() for watching specific journal
directories. This is exposed in journalctl -D.

sd_journal_wait() and sd_journal_process() now return whether changes in
the journal are invalidating or just appending.

We now create inotify kernel watches only when we actually need them
2012-07-11 01:08:38 +02:00
Lennart Poettering e02d1cf72d journal: introduce sd_journal_wait() to simplify writing synchronous clients 2012-07-10 21:46:11 +02:00
Lennart Poettering e590af2666 journal: fix iteration through journal if one file is corrupt 2012-07-03 11:58:16 +02:00
Lennart Poettering 38a6db16dc journal: fix SD_JOURNAL_SYSTEM_ONLY flag 2012-06-17 00:03:12 +02:00
Lennart Poettering 089842938d journal: expose and make use of cutoff times of journal
This helps explaining when the log output of "systemctl status" is
incomplete because the logs got rotated since the service was started.
2012-06-17 00:03:12 +02:00
Lennart Poettering d94117a93c journal: don't allow adding invalid matches to the context 2012-05-30 22:46:07 +02:00
Lennart Poettering ab4979d202 journalctl: for now complain if more than one match is provided since this is still broken 2012-05-30 22:30:35 +02:00
Kay Sievers 9eb977db5b util: split-out path-util.[ch] 2012-05-08 02:33:10 +02:00
Lennart Poettering 5430f7f2bc relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.

Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.

The bits that used to be MIT continue to be MIT.

The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends.
2012-04-12 00:24:39 +02:00
Lennart Poettering 6030831d5b journal: properly handle if we interleave files with different boot ids
If we try to locate a monotonic time in a file that doesn't have any
entries with the matching boot id, then don't fail on it, simply
fall back to calendar time.
2012-03-27 18:50:34 +02:00
Frederic Crozat 4fd052aede add sparse support to detect endianness bug
le16/32/64_t type should be used when storing little-endian value

header to integrate with sparse from Josh Triplett <josh@joshtriplett.org>
2012-03-22 01:09:37 +01:00
Marti Raudsepp 189f6d82ee journal: Don't hold pointers to journal while remapping
Hi!

I was trying out the journal and the journalctl utility sometimes
crashed on me. After some debugging, I tracked it down to the fact
that next_with_matches() holds the "c" object pointer through the
journal_file_next_entry_for_data() call -- which apparently may re-map
the journal file, invalidating the pointer.

The attached patch fixes this crash for me, but being unfamiliar with
the code, I don't know if I'm doing the right thing.

This patch is also available from my github repository:
git://github.com/intgr/systemd.git
https://github.com/intgr/systemd

Regards,
Marti

For the record, here's the original stack trace at the time of remapping:

ret=0x7fff1d5cdec0) at src/journal/journal-file.c:330
ret=0x7fff1d5cdf28) at src/journal/journal-file.c:414
ret=0x7fff1d5ce0a0, offset=0x7fff1d5ce098) at
src/journal/journal-file.c:1101
i=5705, ret=0x7fff1d5ce0a0, offset=0x7fff1d5ce098) at
src/journal/journal-file.c:1147
p=6413608, data_offset=66600, direction=DIRECTION_DOWN,
ret=0x7fff1d5ce0a0, offset=0x7fff1d5ce098) at
src/journal/journal-file.c:1626
direction=DIRECTION_DOWN, ret=0x7fff1d5ce120, offset=0x7fff1d5ce128)
at src/journal/sd-journal.c:533
direction=DIRECTION_DOWN, ret=0x7fff1d5ce170, offset=0x7fff1d5ce178)
at src/journal/sd-journal.c:595
src/journal/sd-journal.c:651

From 9266fc6a58065a7c5dab67430fd78925e519dce9 Mon Sep 17 00:00:00 2001
From: Marti Raudsepp <marti@juffo.org>
Date: Fri, 9 Mar 2012 16:23:00 +0200
Subject: [PATCH] journal: Don't hold pointers to journal while remapping

This would cause a segfault otherwise.
2012-03-14 17:55:55 +01:00
Dan Horák ce3fd7e72a journal: systemd v38 fails to build on big-endians
Hi,

during the builds for Fedora/s390x I've found that systemd v38 fails to
build on big-endian platforms.

...
make[2]: Entering directory `/root/systemd'
  CC     src/journal/libsystemd_journal_la-sd-journal.lo
src/journal/sd-journal.c: In function 'init_location':
src/journal/sd-journal.c:69:22: error: incompatible types when
initializing type 'long unsigned int' using type 'sd_id128_t'
src/journal/sd-journal.c:69:20: error: incompatible types when assigning
to type 'sd_id128_t' from type 'long unsigned int'
make[2]: *** [src/journal/libsystemd_journal_la-sd-journal.lo] Error 1

I see the problem in using le64toh() on the 16 bytes boot_id structure
in init_location()

Please see
http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=544375 for a
full build log and attachment for a proposed fix.

With regards

Dan
2012-01-21 03:48:26 +01:00
Lennart Poettering 19a2bd80c1 sd-journal: implement a number of non-implemented calls from the API for now 2012-01-11 03:23:04 +01:00
Lennart Poettering df50185b43 journal: beef up journal output of systemctl and journalctl 2012-01-04 18:33:36 +01:00
Lennart Poettering 6f003b4304 journalctl: fix counting of -n parameter 2012-01-04 04:00:14 +01:00
Lennart Poettering cf5eb6a110 journal: fix reverse traversing of entries 2012-01-04 03:45:50 +01:00
Lennart Poettering b4e5f92017 journal: add missing error check 2012-01-04 03:45:24 +01:00
Lennart Poettering 9c4e3f2624 journal: don't mind too much if we can't find a monotonic timestamp 2012-01-04 03:45:14 +01:00
Lennart Poettering 4b067dc9d2 journal: add missing error check 2012-01-04 02:15:08 +01:00
Lennart Poettering a5344d2c3b journal: add _public_ to all sd-journal calls, and add parameter checks 2012-01-03 21:08:58 +01:00
Lennart Poettering cf244689e9 journald: flush /run to /var as soon as it becomes available 2011-12-29 15:00:57 +01:00
Lennart Poettering 24b51289e3 journal: fix typo 2011-12-27 22:52:22 +01:00
Lennart Poettering 6ad1d1c306 journald: enforce some syntax restrictions on field names sent from the client side 2011-12-22 00:35:04 +01:00
Lennart Poettering 72f597065c journalctl: add json, export, short and verbose output modes 2011-12-21 18:17:22 +01:00
Lennart Poettering 807e17f05e journal: add inline compression support with XZ 2011-12-21 02:40:59 +01:00
Lennart Poettering 466ccd92e2 journal: fix matches 2011-12-20 00:38:14 +01:00
Lennart Poettering 50f20cfdb0 journal: implement inotify-based live logging logic 2011-12-19 22:35:46 +01:00
Lennart Poettering cab8ac6083 journal: enforce limits on open journal files 2011-12-17 01:13:55 +01:00
Lennart Poettering de190aef08 journal: implement multiple field matches 2011-11-08 18:20:03 +01:00
Lennart Poettering 8f9b6cd9eb journal: automaticall reset location when the set of matches changes 2011-10-15 02:53:04 +02:00
Lennart Poettering 8725d60ae4 journal: implement seek to head/tail 2011-10-15 02:45:58 +02:00
Lennart Poettering e892bd1797 journal: unify code for up and for down traversal 2011-10-15 01:38:44 +02:00
Lennart Poettering de7b95cdc3 journal: properly implement matching with multiple matches 2011-10-15 01:13:37 +02:00
Lennart Poettering 1cc101f1e5 journal: if two entries match with everything but seqnums, they are still identical 2011-10-14 16:52:42 +02:00
Lennart Poettering 7210bfb370 journal: move field index from file into journal object 2011-10-14 05:38:40 +02:00
Lennart Poettering ae2cc8efc1 journal: when the same entry is in two files, skip over them in sync 2011-10-14 05:34:19 +02:00
Lennart Poettering c2373f848d journal: synchronize seqnum across files 2011-10-14 05:12:58 +02:00
Lennart Poettering 161e54f871 journal: fix field retrieval by name 2011-10-14 04:52:56 +02:00
Lennart Poettering 3fbf9cbb02 journal: implement parallel file traversal 2011-10-14 04:44:50 +02:00
Lennart Poettering 0ac38b7072 journal: implementation rotation 2011-10-13 05:19:35 +02:00
Lennart Poettering cec736d21f journal: implement parallel traversal in client 2011-10-08 02:21:05 +02:00
Lennart Poettering f4b4781191 journal: split user logs into their own journal files 2011-10-07 23:03:07 +02:00
Lennart Poettering 260a2be455 journal: replace linked list by hashmap when merging files 2011-10-07 22:02:06 +02:00
Lennart Poettering dad503169b journal: store XOR combination of entry data object hashes to identify hash lines 2011-10-07 22:02:06 +02:00
Lennart Poettering 87d2c1ff6a journal: add preliminary incomplete implementation 2011-10-07 22:02:05 +02:00