summaryrefslogtreecommitdiff
path: root/src/journal
AgeCommit message (Collapse)Author
2013-12-16journal: fix against (theoretical) undefined behaviorShawn Landden
While all the libc implementations I know return NULL when memchr's size parameter is 0, without accessing any memory, passing NULL to memchr is still invalid: C11 7.24.1p2: Where an argument declared as "size_t n" specifies the length of the array for a function, n can have the value zero on a call to that function. Unless explicitly stated otherwise in the description of a particular function in this subclause, pointer arguments on such a call shall still have valid values, as described in 7.1.4. On such a call, a function that locates a character finds no occurrence, a function that compares two character sequences returns zero, and a function that copies characters copies zero characters. see http://llvm.org/bugs/show_bug.cgi?id=18247
2013-12-16journal-file: protect against alloca(0)Thomas Hindoe Paaboel Andersen
2013-12-15catalog: fix language detectionZbigniew Jędrzejewski-Szmek
Detection would fail if language was not specified in the filename but a dot appeared somewhere higher in the path.
2013-12-15bus: _printf_ attributes should be on prototypes not function definitions ↵Lennart Poettering
for non-static functions
2013-12-15test-journal-syslog: use streq_ptr since we pass in NULLThomas Hindoe Paaboel Andersen
2013-12-14Add more _printf_'s for format-nonliteralsThomas Hindoe Paaboel Andersen
Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there.
2013-12-13event: be more conservative when returning errors from event handler callbacksLennart Poettering
We really should return errors from event handlers if we have a continous problem and don't know any other solution.
2013-12-13event: rework sd-event exit logicLennart Poettering
With this change a failing event source handler will not cause the entire event loop to fail. Instead, we just disable the specific event source, log a message at debug level and go on. This also introduces a new concept of "exit code" which can be stored in the event loop and is returned by sd_event_loop(). We also rename "quit" to "exit" everywhere else. Altogether this should make things more robus and keep errors local while still providing a way to return event loop errors in a clear way.
2013-12-11journal: pipe journalctl help output into a pagerDjalal Harouni
journalctl help output might run off the screen, so be consistent as other systemd tools do and pipe it into a pager.
2013-12-11journald: make sure the stdout/stderr stream fd is removed from epoll before ↵Lennart Poettering
we close it
2013-12-11journald: cache cgroup root path, instead of querying it on every incoming ↵Lennart Poettering
log message
2013-12-11journal: when listing logs of a container make sure we don't accidentally ↵Lennart Poettering
show messages from host too
2013-12-11journald: cache hostname, boot_id and machine_id fields instead of ↵Lennart Poettering
generating them fresh for each log entry
2013-12-11journal: don't go belly up when an stdout/stderr client terminates the ↵Lennart Poettering
connection
2013-12-11journal: add ability to browse journals of running OS containersLennart Poettering
This adds the new library call sd_journal_open_container() and a new "-M" switch to journalctl. Particular care is taken that journalctl's "-b" switch resolves to the current boot ID of the container, not the host.
2013-12-11journald: port to sd-event and enable watchdog supportLennart Poettering
2013-12-10journald: malloc less when streaming messagesZbigniew Jędrzejewski-Szmek
2013-12-10journald: use a bit more cleanup magic!Lennart Poettering
2013-12-10Ensure unit is journaled for short-lived or oneshot processesDan McGee
In the time it takes to process incoming log messages, the process we are logging details for may exit. This means the cgroup data is no longer available from '/proc'. Unfortunately, the way the code was structured before, we never log _SYSTEMD_UNIT if we don't have this cgroup information. Add an else if case that allows the passed in unit_id to be logged even if we couldn't capture cgroup information. This ensures a command like `journalctl -u run-XXX` will return all log messages from a oneshot process.
2013-12-08Fix memory leak in stdout journal streamsDan McGee
Just as 'identifier' is strdup-ed and freed, we need to do the same for unit_id.
2013-12-06Get rid of our reimplementation of basenameZbigniew Jędrzejewski-Szmek
The only problem is that libgen.h #defines basename to point to it's own broken implementation instead of the GNU one. This can be fixed by #undefining basename.
2013-12-03trivial coding style clean upsThomas Hindoe Paaboel Andersen
- Add space between if/for and the opening parentheses - Place the opening brace on same line as the function (not for udev) From the CODING_STYLE Try to use this: void foo() { } instead of this: void foo() { }
2013-12-03journal: fail silently in sd_j_sendv() if journal is unavailableZbigniew Jędrzejewski-Szmek
"syslog(3) and sd_journal_print() may largely be used interchangeably functionality-wise" according to sd_journal_print(3). This socket should be always available except in rare circumstatances, and we don't random applications to fail on logging, so let's do what syslog did. The alternative of forcing all callers to do error handling for this rare case doesn't really have any benefits, since if they can't log there isn't much they can do anyway. https://bugzilla.redhat.com/show_bug.cgi?id=1023041
2013-12-02catalog: determine language from the filenameZbigniew Jędrzejewski-Szmek
2013-12-02Use assert_return in more of the public APIThomas Hindoe Paaboel Andersen
2013-11-27journald: mention how long we needed to flush to /var in the logsLennart Poettering
2013-11-27journal: simplify pre-allocation logicLennart Poettering
let's just do a single fallocate() as far as possible, and don't distuingish between allocated space and file size. This way we can save a syscall for each append, which makes quite some benefits.
2013-11-27journal: add a test case for flushing messages out of a series of journal ↵Lennart Poettering
files into a single new one
2013-11-27journal: allow journal_file_copy_entry() to work on non-local filesLennart Poettering
2013-11-27journal: fix iteration when we go backwards from the beginning of an array ↵Lennart Poettering
chain element
2013-11-26journal: optimize bisection logic a bit by caching the last positionLennart Poettering
This way we can do a quick restart limiting a bit how wildly we need to jump around during the bisection process.
2013-11-26journald: keep statistics on how of we hit/miss the mmap cacheLennart Poettering
2013-11-26journal: make table constLennart Poettering
2013-11-26journal: when appending to journal file, allocate larger blocks at onceLennart Poettering
2013-11-26tree-wide usage of %m specifier instead of strerror(errno)Daniel Buch
Also for log_error() except where a specific error is specified e.g. errno ? strerror(errno) : "Some user specified message"
2013-11-25conf-parser: distinguish between multiple sections with the same nameTom Gundersen
Pass on the line on which a section was decleared to the parsers, so they can distinguish between multiple sections (if they chose to). Currently no parsers take advantage of this, but a follow-up patch will do that to distinguish [Address] Address=192.168.0.1/24 Label=one [Address] Address=192.168.0.2/24 Label=two from [Address] Address=192.168.0.1/24 Label=one Address=192.168.0.2/24 Label=two
2013-11-18Remove duplicate includesKarel Zak
2013-11-13journal: timestamp support on console messagesUmut Tezduyar Lindskog
journald mimics the kernel here: timestamps will be printed if /sys/module/printk/parameters/time contains "Y".
2013-11-12bus: introduce concept of a default bus for each thread and make use of it ↵Lennart Poettering
everywhere We want to emphasize bus connections as per-thread communication primitives, hence introduce a concept of a per-thread default bus, and make use of it everywhere.
2013-11-08Remove dead code and unexport some callsLennart Poettering
"make check-api-unused" informs us about code that is not used anymore or that is exported but only used internally. Fix these all over the place.
2013-11-08journal: fix minor memory leakLennart Poettering
2013-11-07bus: use new property retrieval calls everywhereLennart Poettering
2013-11-06clients: unify how we invoke getopt_long()Lennart Poettering
Among other things this makes sure we always expose a --version command and show it in the help texts.
2013-11-06util: unify reading of /proc/cmdlineLennart Poettering
Instead of individually checking for containers in each user do this once in a new call proc_cmdline() that read the file only if we are not in a container.
2013-10-28journalctl: add --list-boots to show boot IDs and timesZbigniew Jędrzejewski-Szmek
Suggested by David Wilkins <dwilkins@maths.tcd.ie> in https://bugzilla.redhat.com/show_bug.cgi?id=967521: > [Specific boot ID is a] bit of a palaver to obtain. I consulted the > verbose dump of the journal to discover the _BOOT_ID for the > timestamp, and then generated the journal dump for that boot using > journalctl _BOOT_ID=foo -o short-monotonic.
2013-10-16timedated: use libsystemd-bus instead of libdbus for bus communicationLennart Poettering
Among other things this also adds a few things necessary for the change: - Considerably more powerful error returning APIs in libsystemd-bus - Adapter for connecting an sd_bus to an sd_event - As I reworked the PolicyKit logic to the new library I also made it asynchronous, so that PolicyKit requests of one user cannot block out another user anymore. - We always use the macro names for common bus error. That way it is harder to mistype them since the compiler will notice
2013-10-16macro: clean up usage of gcc attributesLennart Poettering
Always use our own macros, and name all our own macros the same style.
2013-10-14list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering
each invocation We can determine the list entry type via the typeof() gcc construct, and so we should to make the macros much shorter to use.
2013-10-14util: allow trailing semicolons on define_trivial_cleanup_func linesLennart Poettering
Emacs C indenting really gets confused by these lines if they carry no trailing semicolon, hence let's make this nicer for good old emacs. The other macros which define functions already do this too, so let's copy the scheme here. Also, let's use an uppercase name for the macro. So far our rough rule was that macros that are totally not function-like (like this ones, which define a function) are uppercase. (Well, admittedly it is a rough rule only, for example function and variable decorators are all lower-case SINCE THE CONSTANT YELLING IN THE SOURCES WOULD SUCK, and also they at least got underscore prefixes.) Also, the macros that define functions that we already have are all uppercase, so let's do the same here...
2013-10-13Introduce udev object cleanup functionsZbigniew Jędrzejewski-Szmek