summaryrefslogtreecommitdiff
path: root/src/journal
Commit message (Collapse)AuthorAgeFilesLines
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-033-39/+32
| | | | | | | | | | | | | | | | 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-3116-19/+19
| | | | | | 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-311-0/+1
| | | | | | | | $ 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
* Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-312-11/+11
| | | | | | | | | | | | | | | | | | | | | | String which ended in an unfinished quote were accepted, potentially with bad memory accesses. Reject anything which ends in a unfished quote, or contains non-whitespace characters right after the closing quote. _FOREACH_WORD now returns the invalid character in *state. But this return value is not checked anywhere yet. Also, make 'word' and 'state' variables const pointers, and rename 'w' to 'word' in various places. Things are easier to read if the same name is used consistently. mbiebl_> am I correct that something like this doesn't work mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"' mbiebl_> systemd seems to strip of the quotes mbiebl_> systemctl status shows mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint mbiebl_> which is pretty weird
* time-util: add and use USEC/NSEC_INFINIYKay Sievers2014-07-292-4/+4
|
* journald: always add syslog facility for messages coming from kmsgMichal Sekletar2014-07-281-3/+3
| | | | | | Set SYSLOG_FACILITY field for kernel log messages too. Setting only SYSLOG_IDENTIFIER="kernel" is not sufficient and tools reading journal maybe confused by missing SYSLOG_FACILITY field for kernel log messages.
* Add utility function to append root to pathZbigniew Jędrzejewski-Szmek2014-07-261-10/+6
|
* Always check asprintf return codeKarel Zak2014-07-262-8/+14
| | | | | | | There is a small number of the places in sources where we don't check asprintf() return code and assume that after error the function returns NULL pointer via the first argument. That's wrong, after error the content of pointer is undefined.
* journalctl,man: allow + only between termsZbigniew Jędrzejewski-Szmek2014-07-191-3/+17
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1110712
* Small modernizationsZbigniew Jędrzejewski-Szmek2014-07-182-7/+5
|
* Be more verbose when bind or listen failsZbigniew Jędrzejewski-Szmek2014-07-183-4/+4
| | | | Also be more verbose in devnode_acl_all().
* man,journal: add note about sd_journal_get_cutoff_monotonic_usec return valueZbigniew Jędrzejewski-Szmek2014-07-181-8/+8
| | | | Also modify the function itself to be a bit simpler to read.
* compress: fix return valueZbigniew Jędrzejewski-Szmek2014-07-181-2/+2
|
* journal: reduce test-journal-send timeout from 10s to 1sDavid Herrmann2014-07-181-1/+1
| | | | | | The sleep(10) in test-journal-send is quite aggressive. We need it only for the journal to get our cgroup information. But even that information is not vital to the test, so a sleep(1) should be just fine.
* journal/verify: flush progress bar, print offset in more placesZbigniew Jędrzejewski-Szmek2014-07-161-201/+215
| | | | | Before, fragments of the progress bar would remain when errors or warnings were printed.
* Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek2014-07-162-29/+8
| | | | | | | | Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
* test-compress-benchmark: add missing % before PRIu64 formatThomas Hindoe Paaboel Andersen2014-07-161-1/+1
|
* test-compress-benchmark: silence warningsMarc-Antoine Perennou2014-07-151-4/+4
| | | | and btw make it pass for 32bits where size_t != uint64_t
* Clear up confusion wrt. ENTRY_SIZE_MAX and DATA_SIZE_MAXZbigniew Jędrzejewski-Szmek2014-07-153-5/+22
| | | | | | | | | Define DATA_SIZE_MAX to mean the maximum size of a single field, and ENTRY_SIZE_MAX to mean the size of the whole entry, with some rough calculation of overhead over the payload. Check if entries are not too big when processing native journal messages.
* Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek2014-07-152-2/+2
|
* journal-upload: use journal as the sourceZbigniew Jędrzejewski-Szmek2014-07-151-3/+3
|
* journal-remote: reject fields above maximum sizeZbigniew Jędrzejewski-Szmek2014-07-151-2/+2
| | | | | | | Also fix an infinite loop on E2BIG. Remember what range we already scanned for '\n', to avoid quadratic behaviour on long "text" fields.
* Move network-related journal programs to src/journal-remote/Zbigniew Jędrzejewski-Szmek2014-07-159-3909/+0
| | | | | | | Directory src/journal has become one of the largest directories, and since systemd-journal-gatewayd, systemd-journal-remote, and forthcoming systemd-journal-upload are all closely related, create a separate directory for them.
* microhttp-util: rework gnutls loggingZbigniew Jędrzejewski-Szmek2014-07-154-29/+104
|
* journal: allow files with no data whatsoeverZbigniew Jędrzejewski-Szmek2014-07-151-6/+0
| | | | | | | If a file was opened for writing, and then closed immediately without actually writing any entries, on subsequent opening, it would be considered "corrupted". This should be totally fine, and even in read mode, an empty file can become non-empty later on.
* Fix build without any compression enabledZbigniew Jędrzejewski-Szmek2014-07-114-21/+41
|
* journald: turn ForwardToSyslog= off by defaultLennart Poettering2014-07-113-5/+4
| | | | | After all, rsyslog and friends nowadays read their data directly from the journal, hence the forwarding is unnecessary in most cases.
* journal/compress: improve xz compression performanceJon Severinsson2014-07-081-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | The new lzma2 compression options at the top of compress_blob_xz are equivalent to using preset "0", exept for using a 1 MiB dictionary (the same as preset "1"). This makes the memory usage at most 7.5 MiB in the compressor, and 1 MiB in the decompressor, instead of the previous 92 MiB in the compressor and 8 MiB in the decompressor. According to test-compress-benchmark this commit makes XZ compression 20 times faster, with no increase in compressed data size. Using more realistic test data (an ELF binary rather than repeating ASCII letters 'a' through 'z' in order) it only provides a factor 10 speedup, and at a cost if a 10% increase in compressed data size. But that is still a worthwhile trade-off. According to test-compress-benchmark XZ compression is still 25 times slower than LZ4, but the compressed data is one eighth the size. Using more realistic test data XZ compression is only 18 times slower than LZ4, and the compressed data is only one quarter the size. $ ./test-compress-benchmark XZ: compressed & decompressed 2535300963 bytes in 42.30s (57.15MiB/s), mean compresion 99.95%, skipped 3570 bytes LZ4: compressed & decompressed 2535303543 bytes in 1.60s (1510.60MiB/s), mean compresion 99.60%, skipped 990 bytes
* fix #ifdefRonny Chevalier2014-07-083-3/+3
|
* journal/compress: fix calls to decompress_blobZbigniew Jędrzejewski-Szmek2014-07-072-40/+27
|
* coredumpctl: show a useful error on permission problemsZbigniew Jędrzejewski-Szmek2014-07-061-2/+3
|
* compress: add benchmark-style testZbigniew Jędrzejewski-Szmek2014-07-061-0/+113
| | | | | | | | | | | | | | | | | | | This is useful to test the behaviour of the compressor for various buffer sizes. Time is limited to a minute per compression, since otherwise, when LZ4 takes more than a second which is necessary to reduce the noise, XZ takes more than 10 minutes. % build/test-compress-benchmark (without time limit) XZ: compressed & decompressed 2535300963 bytes in 794.57s (3.04MiB/s), mean compresion 99.95%, skipped 3570 bytes LZ4: compressed & decompressed 2535303543 bytes in 1.56s (1550.07MiB/s), mean compresion 99.60%, skipped 990 bytes % build/test-compress-benchmark (with time limit) XZ: compressed & decompressed 174321481 bytes in 60.02s (2.77MiB/s), mean compresion 99.76%, skipped 3570 bytes LZ4: compressed & decompressed 2535303543 bytes in 1.63s (1480.83MiB/s), mean compresion 99.60%, skipped 990 bytes It appears that there's a bug in lzma_end where it leaks 32 bytes.
* journal: add LZ4 as optional compressorZbigniew Jędrzejewski-Szmek2014-07-0610-197/+725
| | | | | | | | | | | | | | Add liblz4 as an optional dependency when requested with --enable-lz4, and use it in preference to liblzma for journal blob and coredump compression. To retain backwards compatibility, XZ is used to decompress old blobs. Things will function correctly only with lz4-119. Based on the benchmarks found on the web, lz4 seems to be the best choice for "quick" compressors atm. For pkg-config status, see http://code.google.com/p/lz4/issues/detail?id=135.
* journal/compress: return early in uncompress_startswithZbigniew Jędrzejewski-Szmek2014-07-061-64/+27
| | | | | | | uncompress_startswith would always decode the whole stream, even if it did not start with the given prefix. Reallocation policy was also strange.
* coredump: vacuum - fix calculation of 10% of fs size for MaxUseThomas Hindoe Paaboel Andersen2014-07-011-2/+2
|
* journald: make MaxFileSec really default to 1monthMichał Bartoszkiewicz2014-06-271-0/+3
| | | | | journald.conf(5) states that the default for MaxFileSec is one month, but the code didn't respect that.
* coredump: simplify compression logic a bitLennart Poettering2014-06-271-58/+89
| | | | | This also make sure we remove the original coredump temporary file if we successfully managed to compress the coredump.
* coredump: replace Compression= setting by simpler Compress= boolean settingLennart Poettering2014-06-272-34/+14
| | | | | | | Let's move things closer to journald's configuration settings, which knows Compress= already, as a boolean. This makes things more uniform, but also gives us more freedom to possibly swap out the used compression algorithm one day.
* coredump: don't expose the compression level as configuration optionLennart Poettering2014-06-272-20/+4
| | | | | | | This sounds overly low-level and implementation-detaily. Let's just use the default level XZ suggests. This gives us more room to possibly swap out the compression algorithm used, as the compression level range will not leak into user configuration.
* journald: invoking fstatvfs() is now redundant in the vacuuming codeLennart Poettering2014-06-271-7/+0
|
* coredump: don't be annoyed if another coredump hook removes our coredump ↵Lennart Poettering2014-06-271-1/+1
| | | | while we work on it
* coredump: fix how the compression level is verifiedLennart Poettering2014-06-271-2/+4
|
* coredump: add simple coredump vacuumingLennart Poettering2014-06-275-13/+358
| | | | | | When disk space taken up by coredumps grows beyond a configured limit start removing the oldest coredump of the user with the most coredumps, until we get below the limit again.
* coredumpctl: fix potential deref of null pointerThomas Hindoe Paaboel Andersen2014-06-271-2/+4
|
* coredump: make sure variable is set if uncompressedThomas Hindoe Paaboel Andersen2014-06-271-5/+5
| | | | | reorder the code so the fstat is done before we can jump to uncompressed
* coredumpctl: remove unused variableThomas Hindoe Paaboel Andersen2014-06-261-2/+1
|
* coredump: fix debug messageThomas Hindoe Paaboel Andersen2014-06-261-1/+1
| | | | typo from 347272731e15d3c4a70fad7ccd7185e8e8059d01
* coredumpctl: fix HAVE_XZ checkDaniel Mack2014-06-261-1/+1
|
* coredumpctl: fix build with !HAVE_XZDaniel Mack2014-06-261-0/+6
| | | | | | | | | | | | | Fixes the following build error: CCLD coredumpctl src/journal/coredumpctl.o: In function `save_core': /src/systemd-master/src/journal/coredumpctl.c:656: undefined reference to `decompress_stream' collect2: error: ld returned 1 exit status make[2]: *** [coredumpctl] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
* man: add coredump.conf(5)Zbigniew Jędrzejewski-Szmek2014-06-261-0/+3
|