Commit Graph

147 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek d025f1e4dc build-sys: store journald code in a noinst library
The point is to allow the use of journald functions by other binaries.
Before, journald code was split into multiple files (journald-*.[ch]),
but all those files all required functions from journald.c. And
journald.c has its own main(). Now, it is possible to link against
those functions, e.g. from test binaries.

This constitutes a fix for https://bugzilla.redhat.com/show_bug.cgi?id=872638.

The patch does the following:
1. rename journald.h to journald-server.h and move corresponding code
   to journald-server.c.
2. add journald-server.c and other journald-*.c parts to
   libsystemd-journal-internal.
3. remove journald-syslog.c from test_journal_syslog_SOURCES, since
   it is now contained in libsystemd-journal-internal.
There are no code changes, apart from the removal of a few static's,
to allow function calls between files.
2012-11-14 23:39:53 +01:00
Lennart Poettering fb0951b02e journal: implement time-based rotation/vacuuming
This also enables time-based rotation (but not vacuuming) after 1month,
so that not more one month of journal is lost at a time per vacuuming.
2012-10-16 22:58:07 +02:00
Zbigniew Jędrzejewski-Szmek 1ca6783f5e log: introduce a macro to format message id
The MESSAGE_ID=... stanza will appear in countless number of places.
It is just too long to write it out in full each time.

Incidentally, this also fixes a typo of MESSSAGE is three places.
2012-10-13 14:26:30 +02:00
Lennart Poettering 760c85c0bd journald: rework auto-rotation logic 2012-09-28 15:42:34 +02:00
Lennart Poettering 80d1c5988b journald: close sd_journal context after flushing to /var 2012-09-28 15:41:20 +02:00
Lennart Poettering c2893c4b34 journald: log how big the journal files may grow 2012-09-21 22:50:26 +02:00
Lennart Poettering 7d5e9c0f60 util: define union dirent_storage and make use of it everywhere
Make sure to allocate enough space for readdir_r().

https://bugzilla.redhat.com/show_bug.cgi?id=858754
2012-09-19 22:21:09 +02:00
Lennart Poettering 178cc7700c journald: log when we fail to forward messages to syslog
https://bugzilla.redhat.com/show_bug.cgi?id=847207
2012-09-17 23:59:26 +02:00
Lennart Poettering b58b344afd journald: properly update perms on freshly rotate user journals 2012-09-17 15:53:42 +02:00
Lennart Poettering c17a8454f7 journald: don't do debug logging by default 2012-09-10 13:18:39 +02:00
Lennart Poettering 182b858fc2 journald: make splitting up of journal files per-user configurable 2012-09-07 23:40:00 +02:00
Lennart Poettering 2b43f939a4 journald: avoid logging to kmsg in the normal paths 2012-09-06 00:32:51 -07:00
Lennart Poettering 99add6fd0b journalctl: complain if unprivileged users attempt to access the journal and persistant logging is off 2012-08-22 04:45:17 +02:00
Lennart Poettering d2bd7630d7 journal: the ratelimiter is part of journald 2012-08-22 03:43:45 +02:00
Lennart Poettering 0153028ae3 journald: split off native protocol support into its own .c file 2012-08-22 03:42:23 +02:00
Lennart Poettering 3b7124a8db journald: split console transport stuff into its own file 2012-08-22 03:36:29 +02:00
Lennart Poettering a45b9fca6b journald: move stream protocol into its own .c file 2012-08-22 03:32:41 +02:00
Lennart Poettering 35e2e347d3 journald: splitt of syslog protocol support into its own file 2012-08-22 03:21:03 +02:00
Lennart Poettering ef63833d53 journald: split /dev/kmsg related stuff into its own .c file 2012-08-22 03:09:44 +02:00
Lennart Poettering 671e021c92 journald: write tags also to user journal files 2012-08-22 02:53:51 +02:00
Lennart Poettering bdfb9e7f7c journald: augment journal entries from the kernel with data from udev 2012-08-22 02:49:17 +02:00
Lennart Poettering 24a598f889 journal: properly handle EPIPE from /dev/kmsg 2012-08-21 15:39:34 +02:00
Lennart Poettering 89fef99014 journal: automatically evolve FSS key even when nothing is logged 2012-08-21 01:29:17 +02:00
Lennart Poettering eb53b74f7e journald: add new Seal= configuration option 2012-08-20 22:13:22 +02:00
Lennart Poettering 84168d8068 mmap: resize arrays dynamically 2012-08-18 01:46:20 +02:00
Lennart Poettering 0284adc6a6 journal: split up journal-file.c 2012-08-16 17:10:57 +02:00
Lennart Poettering f65425cbc4 journal: add superficial structure verifier 2012-08-16 17:10:57 +02:00
Lennart Poettering 16e9f408fa journal: implement generic sharable mmap caching logic
instead of having one simple per-file cache implement an more
comprehensive one that works for multiple files and can actually
maintain multiple maps per file and per object type.
2012-08-16 17:10:56 +02:00
Lennart Poettering 7560fffcd2 journald: initial version of FSPRG hookup
This adds forward-secure authentication of journal files. This patch
includes key generation as well as tagging of journal files,
Verification of journal files will be added in a later patch.
2012-08-13 20:31:10 +02:00
Lennart Poettering cee5e9a7ca journald: never read the same kernel msg twice, and generate message when we lose one 2012-08-09 17:52:05 +02:00
Lennart Poettering 5b4c61cd0b journald: properly unescape messages from /dev/kmsg 2012-08-09 16:49:28 +02:00
Lennart Poettering e7573d7fa9 journald: also parse kernel key/value fields and store them prefixed with _KERNEL_ as journal fields 2012-08-09 16:29:16 +02:00
Lennart Poettering 51abe64c85 journald: basic support for /dev/kmsg parsing 2012-08-09 15:57:24 +02:00
Artur Zaprzala 4cdc45994a journald: fixed memory leak 2012-07-31 14:15:34 +02:00
Lennart Poettering c51742d029 journald: log driver messages at LOG_INFO 2012-07-26 16:56:22 +02:00
Shawn Landden 0d0f0c50d3 log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera
2012-07-26 11:48:26 +02:00
Shawn Landden 669241a076 use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.

Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id
2012-07-25 11:23:57 +02:00
Lennart Poettering 3146a302d1 journald: upgrade signal reception message to INFO 2012-07-19 12:44:58 +02:00
Lennart Poettering 4a299a7ad5 journal: remove all of /run/log/journal when serializing, since the machine ID might deviate 2012-07-18 16:23:26 +02:00
Lennart Poettering 4ca86bbc25 journal: don't complain if the syslog forwarder socket doesn't exist 2012-07-18 16:23:06 +02:00
Lennart Poettering c2a623d842 journald: fix another bad memory access
If we rotate due to header out of date we need the new journal file
object, too.
2012-07-18 13:28:39 +02:00
Lennart Poettering 32fca2d5b7 journald: fix bad memory access
After vacuuming we need to retrieve the journal file object again, since
it might have changed.
2012-07-18 13:13:15 +02:00
Lennart Poettering 4a92baf3fa journal: size journal data hash table based on maximum file size metrics
The default of 2047 hash table entries turned out to result in way too
many collisions for bigger files, hence scale the hash table size by the
estimated maximum file size.
2012-07-17 00:59:03 +02:00
Lennart Poettering 71fa6f006f journal: immediately rotate when the journal was previously not closed properly 2012-07-17 00:59:03 +02:00
Lennart Poettering dca6219e04 journal: automatically rotate journal files if the data hash table is full > 75%
Previously, when the main data hash table grows too full the performance
simply started to decrease drastically. Instead, now simply rotate to a
new journal file as the hash table gets to full, so that we can start
with a new fresh empty hash table.
2012-07-17 00:59:03 +02:00
Lennart Poettering b7def68494 util: rename join() to strjoin()
This is to match strappend() and the other string related functions.
2012-07-13 13:41:01 +02:00
Lennart Poettering b8156be03f journal: replace implicit flushing of journal by explicit one
The old automatism that the flushing of the journal from /run to /var
was triggered by the appearance of /var/log/journal is broken if that
directory is mounted from another host and hence always available to be
useful as mount point. To avoid probelsm with this, introduce a new unit
that is explicitly orderer after all mounte files systems and triggers
the flushing.
2012-07-11 02:41:16 +02:00
Lennart Poettering 205c4d1d6a journald: use "persistent", not "permanent" as storage option
"permanent" is simply the wrong term and we use "persistant" in most
other contexts to correct this.
2012-07-10 19:39:27 +02:00
Lennart Poettering 461b182232 paranoia: refuse rm_rf("/") 2012-07-09 17:30:22 +02:00
Lennart Poettering f4bad2bd2a journal: default ImportKernel=no until we make use of structured logging 2012-07-03 14:07:10 +02:00