summaryrefslogtreecommitdiff
path: root/src/journal/coredump.c
AgeCommit message (Collapse)Author
2015-10-27util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering
2015-10-26util-lib: split out user/group/uid/gid calls into user-util.[ch]Lennart Poettering
2015-10-25util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering
There are more than enough to deserve their own .c file, hence move them over.
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-10-24util: split out escaping code into escape.[ch]Lennart Poettering
This really deserves its own file, given how much code this is now.
2015-09-10tree-wide: never use the off_t unless glibc makes us use itLennart Poettering
off_t is a really weird type as it is usually 64bit these days (at least in sane programs), but could theoretically be 32bit. We don't support off_t as 32bit builds though, but still constantly deal with safely converting from off_t to other types and back for no point. Hence, never use the type anymore. Always use uint64_t instead. This has various benefits, including that we can expose these values directly as D-Bus properties, and also that the values parse the same in all cases.
2015-09-09util: introduce safe_fclose() and port everything over to itLennart Poettering
Adds a coccinelle script to port things over automatically.
2015-06-15util: when creating temporary file names, allow including extra id string in itLennart Poettering
This adds a "char *extra" parameter to tempfn_xxxxxx(), tempfn_random(), tempfn_ranomd_child(). If non-NULL this string is included in the middle of the newly created file name. This is useful for being able to distuingish the kind of temporary file when we see one. This also adds tests for the three call. For now, we don't make use of this at all, but port all users over.
2015-04-10shared: add process-util.[ch]Ronny Chevalier
2015-03-27fix gcc warnings about uninitialized variablesHarald Hoyer
like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-02-03util: rework strappenda(), and rename it strjoina()Lennart Poettering
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
2015-01-29coredump: drop caps while we are processing the coredumpLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=87354
2015-01-22tmpfiles: add 'a' type to set ACLsZbigniew Jędrzejewski-Szmek
2014-12-12copy: use btrfs reflinking only whe we know we copy full filesLennart Poettering
2014-12-12util: when using basename() for creating temporary files, verify the ↵Lennart Poettering
resulting name is actually valid Also, rename filename_is_safe() to filename_is_valid(), since it actually does a full validation for what the kernel will accept as file name, it's not just a heuristic.
2014-11-29coredump: Support coredump.conf.d directories in the usual search pathsJosh Triplett
2014-11-28coredump: simplify a few things by allocating small fields on the stack ↵Lennart Poettering
rather than heap
2014-11-28coredump: rework compose_open_fds()Lennart Poettering
Use FOREACH_DIRENT() and FOREACH_LINE() macros instead of manual loops. Don't clobber return parameters on failure. Simplify some other things.
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-11-28treewide: more log_*_errno + return simplificationsMichal Schmidt
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-27coredump: use openatZbigniew Jędrzejewski-Szmek
2014-11-27coredump: collect all /proc data useful for bug reportingJakub Filak
/proc/[pid]: - status - maps - limits - cgroup - cwd - root - environ - fd/ & fdinfo/ joined in open_fds
2014-11-07copy: change error code when hitting copy limit to EFBIGLennart Poettering
After all, this is about files, not arguments, hence EFBIG is more appropriate than E2BIG
2014-11-06s/commandline/command line/gHarald Hoyer
2014-10-24journald: removed gendered pronouns in commentKlaus Purer
2014-08-15coredump: display libdw fail string on stack trace failUmut Tezduyar Lindskog
- 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.
2014-07-31Always prefer our headers to system headersZbigniew Jędrzejewski-Szmek
In practice this shouldn't make much difference, but sometimes our headers might be newer, and we want to test them.
2014-07-26Always check asprintf return codeKarel Zak
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.
2014-07-16Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek
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.
2014-07-15Clear up confusion wrt. ENTRY_SIZE_MAX and DATA_SIZE_MAXZbigniew Jędrzejewski-Szmek
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.
2014-07-15Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek
2014-07-11Fix build without any compression enabledZbigniew Jędrzejewski-Szmek
2014-07-06journal: add LZ4 as optional compressorZbigniew Jędrzejewski-Szmek
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.
2014-06-27coredump: simplify compression logic a bitLennart Poettering
This also make sure we remove the original coredump temporary file if we successfully managed to compress the coredump.
2014-06-27coredump: replace Compression= setting by simpler Compress= boolean settingLennart Poettering
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.
2014-06-27coredump: don't expose the compression level as configuration optionLennart Poettering
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.
2014-06-27coredump: don't be annoyed if another coredump hook removes our coredump ↵Lennart Poettering
while we work on it
2014-06-27coredump: fix how the compression level is verifiedLennart Poettering
2014-06-27coredump: add simple coredump vacuumingLennart Poettering
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.
2014-06-27coredump: make sure variable is set if uncompressedThomas Hindoe Paaboel Andersen
reorder the code so the fstat is done before we can jump to uncompressed
2014-06-26coredump: fix debug messageThomas Hindoe Paaboel Andersen
typo from 347272731e15d3c4a70fad7ccd7185e8e8059d01
2014-06-26coredump+coredumpctl: add COREDUMP_FILENAME, use in coredumpctlZbigniew Jędrzejewski-Szmek
2014-06-26coredump: make compression configurableZbigniew Jędrzejewski-Szmek
Add Compression={none,xz} and CompressionLevel=0-9 settings. Defaults are xz/6. Compression=filesystem may be added later. I picked "xz" for the compression "type", since we might want to add different compressors later on. XZ is fairly memory and CPU intensive, and embedded users will likely want to use LZO or some other lightweight compression mechanism.
2014-06-26coredump: compress core filesZbigniew Jędrzejewski-Szmek
Unfortunately the core is first written uncompressed, then compressed by reading from disk and writing to the output file. This is ugly and slow, but I don't see a way around, if we want to get the backtrace without keeping everything in memory.
2014-06-23coredump: log coredump even if core dumping failsZbigniew Jędrzejewski-Szmek
Journal might be functional even if we cannot write to /var/lib/systemd/coredump.
2014-06-23coredump: retrieve comm information from /procZbigniew Jędrzejewski-Szmek
Kernel mangles comm information in an irreversible way when comm constains repeated spaces. Retrieve comm information from /proc, and only fallback to the information provided on the commandline when retrieving information from /proc fails. Add exe information to the list of saved xattr. https://bugs.freedesktop.org/show_bug.cgi?id=62043