Remove src/journal-remote
Assorted format fixes Types used for pids and uids in various interfaces are unpredictable. Too bad.
journal-upload: enable curl debug output conditionally https://bugs.freedesktop.org/show_bug.cgi?id=86464
journal: install sigbus handler for journal tools too This makes them robust regarding truncation. Ideally, we'd export this as an API, but given how messy SIGBUS handling is, and the uncertain ownership logic of signal handlers we should not do this (unless libc one day invents a scheme how to sanely install SIGBUS handlers for specific memory areas only). However, for now we can still make all our own tools robust. Note that external tools will only have read-access to the journal anyway, where SIGBUS is much more unlikely, given that only writes are subject to disk full problems.
journald-remote,journal-upload: Support .d directories in the usual search paths
treewide: another round of simplifications Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
treewide: use log_*_errno whenever %m is in the format string 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.
treewide: simplify log_*_errno(r,...) immediately followed by "return r"
treewide: more log_*_errno() conversions, multiline calls Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
treewide: no need to negate errno for log_*_errno() It corrrectly handles both positive and negative errno values.
treewide: auto-convert the simple cases to log_*_errno() 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().
journal-upload: return proper exit code Even when termninated normally, systemd-journal-upload would return something positive which would be interpreted as failure.
journal-upload: fix --trust=all option
journal-upload: avoid calling printf with maximum precision Precision of INT_MAX does not work as I expected it to. https://bugzilla.redhat.com/show_bug.cgi?id=1154334
journal-upload: verify state file can be saved before uploading Do our best verify that we can actually write the state file before upload commences to avoid duplicate messages on the server.
journal-upload: do not require port to be set
systemd-upload: print paths in help()
journal-upload: fix socket activation
journal-upload: Remove compilation warning When compiling we see this curl warning popping up: src/journal-remote/journal-upload.c:194:17: warning: call to ‘_curl_easy_setopt_err_error_buffer’ declared with attribute warning: curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option [enabled by default] This patch removes the warning (which occurs twice).
notify: send STOPPING=1 from our daemons