summaryrefslogtreecommitdiff
path: root/src/journal
Commit message (Collapse)AuthorAge
* memfd: rename memfd.h to memfd-util.h to avoid any confusion with any libc ↵Lennart Poettering2014-10-30
| | | | provided headers
* memfd: always use our internal utility functions where we have themLennart Poettering2014-10-30
|
* journal: when sending huge log messages prefer memfds over temporary files ↵Lennart Poettering2014-10-30
| | | | | | | | | | | | | in /dev/shm Previously when a log message grew beyond the maximum AF_UNIX/SOCK_DGRAM datagram limit we'd send an fd to a deleted file in /dev/shm instead. Because the sender could still modify the file after delivery we had to immediately copy the data on the receiving side. With memfds we can optimize this logic, and also remove the dependency on /dev/shm: simply send a sealed memfd around, and if we detect the seal memory map the fd and use it directly.
* journald: be nice to coverity, add an extra assertLennart Poettering2014-10-27
| | | | coverity otherwise assumes that the chain object might be NULL.
* journald: fix flushingZbigniew Jędrzejewski-Szmek2014-10-26
| | | | | | | | Commit 74055aa762 'journalctl: add new --flush command and make use of it in systemd-journal-flush.service' broke flushing because journald checks for the /run/systemd/journal/flushed file before opening the permanent journal. When the creation of this file was postponed, flushing stoppage ensued.
* journalctl: correct help text for --untilSantiago Vila2014-10-25
| | | | http://bugs.debian.org/766598
* journalctl: Unify boot id lookup into common function get_bootsJan Janssen2014-10-24
|
* journald: removed gendered pronouns in commentKlaus Purer2014-10-24
|
* journal: make sd_journal::files a OrderedHashmapMichal Schmidt2014-10-23
| | | | | Anything that uses hashmap_next() almost certainly cares about the order and needs to be an OrderedHashmap.
* journal: make Server::user_journals an OrderedHashmapMichal Schmidt2014-10-23
| | | | | Order matters here. It replaces oldest entries first when USER_JOURNALS_MAX is reached.
* journal: make JournalFile::chain_cache an OrderedHashmapMichal Schmidt2014-10-23
| | | | | | | 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.)
* mac: also rename use_{smack,selinux,apparmor}() calls so that they share the ↵Lennart Poettering2014-10-23
| | | | new mac_{smack,selinux,apparmor}_xyz() convention
* journalctl: add new --flush command and make use of it in ↵Lennart Poettering2014-10-23
| | | | | | | | | | systemd-journal-flush.service This new command will ask the journal daemon to flush all log data stored in /run to /var, and wait for it to complete. This is useful, so that in case of Storage=persistent we can order systemd-tmpfiles-setup afterwards, to ensure any possibly newly created directory in /var/log gets proper access mode and owners.
* machine: validate machine names using machine_name_is_valid() instead of ↵Lennart Poettering2014-10-22
| | | | | | | string_is_safe() After all, we know have this as generic validator, so let's be correct and use it wherver applicable.
* journal: do server_vacuum for sigusr1WaLyong Cho2014-10-22
| | | | | | | | | runtime journal is migrated to system journal when only "/run/systemd/journal/flushed" exist. It's ok but according to this the system journal directory size(max use) can be over the config. If journal is not rotated during some time the journal directory can be remained as over the config(or default) size. To avoid, do server_vacuum just after the system journal migration from runtime.
* journalctl: don't introduce numeric constants with special names, give them ↵Lennart Poettering2014-10-22
| | | | names
* sd-journal: consistently use ternary operator for all direction checksChristian Hesse2014-10-20
|
* ModernizationZbigniew Jędrzejewski-Szmek2014-10-12
|
* journalctl: use pager for --list-bootsZbigniew Jędrzejewski-Szmek2014-10-09
|
* sd-journal: fix sd_journal_enumerate_unique skipping valuesJan Janssen2014-10-09
| | | | | | | | | | | | | | sd_journal_enumerate_unique will lock its mmap window to prevent it from being released by calling mmap_cache_get with keep_always=true. This call may return windows that are wider, but compatible with the parameters provided to it. This can result in a mismatch where the window to be released cannot properly be selected, because we have more than one window matching the parameters of mmap_cache_release. Therefore, introduce a release_cookie to be used when releasing the window. https://bugs.freedesktop.org/show_bug.cgi?id=79380
* sd-journal: change check to assertZbigniew Jędrzejewski-Szmek2014-10-09
| | | | | As of 0f99f74a14 'sd-journal: verify that object start with the field name' this condition should never happen.
* sd-journal: do not reset sd_j_enumerate_unique position on errorZbigniew Jędrzejewski-Szmek2014-10-09
| | | | | | | | | | | | systemctl would call sd_j_enumerate_unique() interleaved with sd_j_next(). But the latter can remove a file if it detects an error in it. In those circumstances sd_j_enumerate_unique would restart with the first file in hashmap. With many corrupted files sd_j_enumerate_unique might iterate over the list multiple times. Avoid this by jumping to the next file in unique list if possible, or setting a flag that tells sd_j_enumerate_unique that it is done otherwise.
* time: functions named "internal" really shouldn't be exportedLennart Poettering2014-10-08
| | | | | Also, let's try to make function names descriptive, instead of using bools for flags.
* journalctl: make --utc work everywhereJan Synacek2014-10-03
| | | | | | The --utc option was introduced by commit 9fd290443f5f99fca0dcd4216b1de70f7d3b8db1. Howerver, the implementation was incomplete.
* journalctl: add --utc optionJan Synacek2014-10-02
| | | | Introduce option to display time in UTC.
* journalctl: do not output --reboot-- markers when running non-interactivelyZbigniew Jędrzejewski-Szmek2014-09-29
| | | | They are not legal in the export format.
* journal: build fix when LZ4 is enabled but XZ is notGustavo Sverzut Barbieri2014-09-25
|
* test: warn if we could not parse the loop count argumentThomas Hindoe Paaboel Andersen2014-09-19
| | | | Found by coverity. Fixes: CID#1237512
* journal: Do not count on the compiler initializing found_last to falsePhilippe De Swert2014-09-18
| | | | | | | There is a very unlikely case where this can happen since gcc usually does the sane thing. But let's make sure found_last is initialized anyway. Fixes: CID#996386
* hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt2014-09-15
| | | | | | | | | It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
* journal: do not leak mmaps on OOMPhilippe De Swert2014-09-11
| | | | | | | After a section of memory is succesfully allocated, some of the following actions can still fail due to lack of memory. In this case -ENOMEM is returned without actually freeing the already mapped memory. Found with coverity. Fixes: CID#1237762
* journal: do not dereference already freed patternsPhilippe De Swert2014-09-11
| | | | | | | In case set_consume goes wrong, the pattern name has already been freed. So we do not try to print it in the logs, assuming the pattern addition print will be printed just before the failure anyway. Found with coverity. Fixes: CID#1237798
* journalctl: Allow to disable line cap with --lines=allJan Janssen2014-08-31
|
* test-compress: also test with incompressible inputsZbigniew Jędrzejewski-Szmek2014-08-30
|
* journal/compress: use LZ4_compress_continue()Evangelos Foutras2014-08-30
| | | | | | | | | | | We can't use LZ4_compress_limitedOutput_continue() because in the worst-case scenario the compressed output can be slightly bigger than the input block. This generally affects very few blocks and is no reason to abort the compression process. I ran into this when I noticed that Chromium core dumps weren't being compressed. After switching to LZ4_compress_continue() a ~330MB Chromium core dump gets compressed to ~17M.
* Fix a few more typosRuben Kerkhof2014-08-30
|
* sd-journal: verify that object start with the field nameZbigniew Jędrzejewski-Szmek2014-08-27
| | | | | | If the journal is corrupted, we might return an object that does not start with the expected field name and/or is shorter than it should.
* sd-journal: properly convert object->size on big endianZbigniew Jędrzejewski-Szmek2014-08-27
| | | | | | | mmap code crashes when attempting to map an object of zero size. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758392 https://bugs.freedesktop.org/show_bug.cgi?id=82894
* sd-journal: never log anything by default from a libraryLennart Poettering2014-08-26
|
* test-compress: make sure asserts with side effects use assert_se()Filipe Brandenburger2014-08-26
| | | | | | | | Otherwise the test fails when built with CPPFLAGS='-DNDEBUG' which disables assertions. Tested: - make check TESTS='test-compress' CPPFLAGS='-DNDEBUG'
* notify: send STOPPING=1 from our daemonsLennart Poettering2014-08-21
|
* journalctl: add "-t --identifier=STRING" optionHarald Hoyer2014-08-21
| | | | | | | | | | | | | | | This turns journalctl to the counterpart of systemd-cat. Messages sent with systemd-cat --identifier foo --prioritiy debug can now be shown with journalctl --identifier foo --prioritiy debug "--identifier" is not merged with "--unit" to make a clear distinction between syslog and systemd units. syslog identifiers can be chosen freely by anyone.
* coredump: display libdw fail string on stack trace failUmut Tezduyar Lindskog2014-08-15
| | | | | | - systemd[1]: hello.service: main process exited, code= dumped, status=3/QUIT - systemd-coredump[2541]: Failed to generate stack trace: Unwinding not supported for this architecture - systemd-coredump[2541]: Process 1024 (hello) of user 154 dumped core.
* journald: Fix off-by-one error in "Missed X kernel messages" warningEelco Dolstra2014-08-13
| | | | | | On receiving a message, "kernel_seqnum" is set to "serial + 1". So subtracting 1 will cause messages like "Missed 0 kernel messages", which should be "Missed 1 kernel messages".
* journald: remove redundant newlinesLennart Poettering2014-08-05
|
* journald: properly sum up entry size counterLennart Poettering2014-08-05
| | | | | We should read the entry size before moving to the next iovec, not after.
* Fix misuse of uint64_t as size_tZbigniew Jędrzejewski-Szmek2014-08-03
| | | | They have different size on 32 bit, so they are really not interchangable.
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-03
| | | | | | | | | | | | | | | | getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
* Always prefer our headers to system headersZbigniew Jędrzejewski-Szmek2014-07-31
| | | | | | In practice this shouldn't make much difference, but sometimes our headers might be newer, and we want to test them.
* Properly report invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-31
| | | | | | | | $ systemd-analyze verify trailing-g.service [./trailing-g.service:2] Trailing garbage, ignoring. trailing-g.service lacks ExecStart setting. Refusing. Error: org.freedesktop.systemd1.LoadFailed: Unit trailing-g.service failed to load: Invalid argument. Failed to create trailing-g.service/start: Invalid argument