summaryrefslogtreecommitdiff
path: root/src/journal-remote/journal-upload.c
AgeCommit message (Collapse)Author
2016-02-23tree-wide: minor formatting inconsistency cleanupsVito Caputo
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2015-11-10defs: rework CONF_DIRS_NULSTR() macroLennart Poettering
The macro is generically useful for putting together search paths, hence let's make it truly generic, by dropping the implicit ".d" appending it does, and leave that to the caller. Also rename it from CONF_DIRS_NULSTR() to CONF_PATHS_NULSTR(), since it's not strictly about dirs that way, but any kind of file system path. Also, mark CONF_DIR_SPLIT_USR() as internal macro by renaming it to _CONF_PATHS_SPLIT_USR() so that the leading underscore indicates that it's internal.
2015-11-03util-lib: move CONF_DIRS_NULSTR definition to def.hLennart Poettering
After all, this is not some compiler or C magic, but something very specific to how systemd works, hence let's move it into def.h, and out of macro.h
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-27util-lib: split out globbing related calls into glob-util.[ch]Lennart Poettering
2015-10-27util-lib: split string parsing related calls from util.[ch] into parse-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-09-29util: introduce common version() implementation and use it everywhereLennart Poettering
This also allows us to drop build.h from a ton of files, hence do so. Since we touched the #includes of those files, let's order them properly according to CODING_STYLE.
2015-09-09tree-wide: replace while(1) by for(;;) everywhereLennart Poettering
Another Coccinelle script.
2015-07-29tree-wide: port everything over to fflush_and_check()Lennart Poettering
Some places invoked fflush() directly with their own manual error checking, let's unify all that by using fflush_and_check(). This also unifies the general error paths of fflush()+rename() file writers.
2015-06-15everywhere: port everything to sigprocmask_many() and friendsLennart Poettering
This ports a lot of manual code over to sigprocmask_many() and friends. Also, we now consistly check for sigprocmask() failures with assert_se(), since the call cannot realistically fail unless there's a programming error. Also encloses a few sd_event_add_signal() calls with (void) when we ignore the return values for it knowingly.
2015-05-29util: split out signal-util.[ch] from util.[ch]Lennart Poettering
No functional changes.
2015-04-10shared: add formats-util.hRonny Chevalier
2015-01-22Assorted format fixesZbigniew Jędrzejewski-Szmek
Types used for pids and uids in various interfaces are unpredictable. Too bad.
2015-01-06journal-upload: enable curl debug output conditionallyZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=86464
2015-01-05journal: install sigbus handler for journal tools tooLennart Poettering
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.
2014-11-29journald-remote,journal-upload: Support .d directories in the usual search pathsJosh Triplett
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: simplify log_*_errno(r,...) immediately followed by "return r"Michal Schmidt
2014-11-28treewide: more log_*_errno() conversions, multiline callsMichal Schmidt
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.
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-10-23journal-upload: return proper exit codeZbigniew Jędrzejewski-Szmek
Even when termninated normally, systemd-journal-upload would return something positive which would be interpreted as failure.
2014-10-23journal-upload: fix --trust=all optionZbigniew Jędrzejewski-Szmek
2014-10-23journal-upload: avoid calling printf with maximum precisionZbigniew Jędrzejewski-Szmek
Precision of INT_MAX does not work as I expected it to. https://bugzilla.redhat.com/show_bug.cgi?id=1154334
2014-10-23journal-upload: verify state file can be saved before uploadingZbigniew Jędrzejewski-Szmek
Do our best verify that we can actually write the state file before upload commences to avoid duplicate messages on the server.
2014-10-23journal-upload: do not require port to be setZbigniew Jędrzejewski-Szmek
2014-10-23systemd-upload: print paths in help()Zbigniew Jędrzejewski-Szmek
2014-10-23journal-upload: fix socket activationZbigniew Jędrzejewski-Szmek
2014-09-18journal-upload: Remove compilation warningPhilippe De Swert
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).
2014-08-21notify: send STOPPING=1 from our daemonsLennart Poettering
2014-08-20journal-upload: make sure that 'r' is initializedLukas Nykryn
2014-08-20journal-upload: allow the tool to startLennart Poettering
2014-08-20cmdline: for new tools avoid introduce new negative switches, and properly ↵Lennart Poettering
align --help texts Negative switches are a bad un-normalized thing. We alerady have some, but we should try harder to avoid intrdoucing new ones. Hence, instead of adding two switches: --foobar --no-foobar Let's instead use the syntax --foobar --foobar=yes --foobar=no Where the first two are equivalent. The boolean argument is parsed following the usual rules. Change all new negative switches this way. This patch also properly aligns the --help table, so that single char switches always get a column separate of the long switches.
2014-08-03journal-remote: rename KEY_FILE to avoid confict with <linux/input.h>Zbigniew Jędrzejewski-Szmek
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-15journal-upload: add config fileZbigniew Jędrzejewski-Szmek
2014-07-15journal-remote: let user specify just the main part of the urlZbigniew Jędrzejewski-Szmek
We can append /upload ourselves.
2014-07-15journal-remote: improve some messagesZbigniew Jędrzejewski-Szmek
2014-07-15journal-remote: allow splitting incoming logs by source hostZbigniew Jędrzejewski-Szmek
Previously existing scheme where the file name would be based on the source was just too ugly and unpredicatable. Now there are only two options: 1. just one file (until rotation), 2. one file per source host, using the hostname as filename part. For the cases where the source is specified by the user, only option one is allowed, and the full of the file must be specified.
2014-07-15journal-upload: add watchdog supportZbigniew Jędrzejewski-Szmek
2014-07-15journal-upload: make state persistentZbigniew Jędrzejewski-Szmek
2014-07-15journal-upload: use journal as the sourceZbigniew Jędrzejewski-Szmek
2014-07-15journal-upload: HTTPS supportZbigniew Jędrzejewski-Szmek
2014-07-15journal-upload: a tool to push messages to systemd-journal-remoteZbigniew Jędrzejewski-Szmek