summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
AgeCommit message (Collapse)Author
2014-10-25journalctl: correct help text for --untilSantiago Vila
http://bugs.debian.org/766598
2014-10-24journalctl: Unify boot id lookup into common function get_bootsJan Janssen
2014-10-23journal: make sd_journal::files a OrderedHashmapMichal Schmidt
Anything that uses hashmap_next() almost certainly cares about the order and needs to be an OrderedHashmap.
2014-10-23journalctl: add new --flush command and make use of it in ↵Lennart Poettering
systemd-journal-flush.service This new command will ask the journal daemon to flush all log data stored in /run to /var, and wait for it to complete. This is useful, so that in case of Storage=persistent we can order systemd-tmpfiles-setup afterwards, to ensure any possibly newly created directory in /var/log gets proper access mode and owners.
2014-10-22journalctl: don't introduce numeric constants with special names, give them ↵Lennart Poettering
names
2014-10-09journalctl: use pager for --list-bootsZbigniew Jędrzejewski-Szmek
2014-10-09sd-journal: change check to assertZbigniew Jędrzejewski-Szmek
As of 0f99f74a14 'sd-journal: verify that object start with the field name' this condition should never happen.
2014-10-08time: functions named "internal" really shouldn't be exportedLennart Poettering
Also, let's try to make function names descriptive, instead of using bools for flags.
2014-10-03journalctl: make --utc work everywhereJan Synacek
The --utc option was introduced by commit 9fd290443f5f99fca0dcd4216b1de70f7d3b8db1. Howerver, the implementation was incomplete.
2014-10-02journalctl: add --utc optionJan Synacek
Introduce option to display time in UTC.
2014-09-29journalctl: do not output --reboot-- markers when running non-interactivelyZbigniew Jędrzejewski-Szmek
They are not legal in the export format.
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-08-31journalctl: Allow to disable line cap with --lines=allJan Janssen
2014-08-21journalctl: add "-t --identifier=STRING" optionHarald Hoyer
This turns journalctl to the counterpart of systemd-cat. Messages sent with systemd-cat --identifier foo --prioritiy debug can now be shown with journalctl --identifier foo --prioritiy debug "--identifier" is not merged with "--unit" to make a clear distinction between syslog and systemd units. syslog identifiers can be chosen freely by anyone.
2014-08-03Unify parse_argv styleZbigniew Jędrzejewski-Szmek
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.
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-26Add utility function to append root to pathZbigniew Jędrzejewski-Szmek
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-19journalctl,man: allow + only between termsZbigniew Jędrzejewski-Szmek
https://bugzilla.redhat.com/show_bug.cgi?id=1110712
2014-07-15journal-upload: use journal as the sourceZbigniew Jędrzejewski-Szmek
2014-04-05journalctl: free arg_file on exitZbigniew Jędrzejewski-Szmek
2014-03-18util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering
safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
2014-02-27journalctl: refuse extra arguments with --verify and similarZbigniew Jędrzejewski-Szmek
Positional arguments only make sense with the default action. For other actions, complain instead of ignoring them silently.
2014-02-19make gcc shut upLennart Poettering
If -flto is used then gcc will generate a lot more warnings than before, among them a number of use-without-initialization warnings. Most of them without are false positives, but let's make them go away, because it doesn't really matter.
2014-02-17doc: update punctuationJan Engelhardt
Resolve spotted issues related to missing or extraneous commas, dashes.
2014-01-28always use the same code for creating temporary filesLennart Poettering
Let's unify our code here, and also always specifiy O_CLOEXEC.
2014-01-11journalctl: allow globbing in --unit and --user-unitZbigniew Jędrzejewski-Szmek
This is a continuation of e3e0314b systemctl: allow globbing in commands which take multiple unit names. Multiple patterns can be specified, as separate arguments, or as one argument with patterns seperated by commas. If patterns are given, at least one unit must be matched (by any of the patterns). This is different behaviour than systemctl, but here it is necessary because otherwise anything would be matched, which is unlikely to be the intended behaviour. https://bugs.freedesktop.org/show_bug.cgi?id=59336
2013-12-26Use enums to make it obvious what boolean params meanZbigniew Jędrzejewski-Szmek
Suggested-by: Russ Allbery <rra@debian.org>
2013-12-26systemctl: allow globbing in commands which take multiple unit namesZbigniew Jędrzejewski-Szmek
2013-12-26journalctl: make sure -b --foobar cannot be misunderstood as --boot=--foobarLennart Poettering
2013-12-26Revert "journalctl: remove unexpected behavior of journalctl -b"Lennart Poettering
This reverts commit cf5bccc2bb9569030cb04debbc4208aaca0fe5b4. We should fix thinks properly if they aren't perfect, not just break other things...
2013-12-25journalctl: remove unexpected behavior of journalctl -bDave Reisner
This flag shouldn't try and consume the following argument. It should behave like every other flag which takes an optional argument when parsed by getopt_long.
2013-12-18journalctl,zsh-completion: fix several issues in --help message textJason St. John
-- fix grammar and reword some descriptions for clarity -- add a useful description of what --follow does -- fix the description for --after-cursor -- properly introduce the FSS acronym for "Forward Secure Sealing" in both sections -- clarify the --disk-usage command [zj: perform similar changes to zsh completions] squash! journalctl: fix several issues in --help message text
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-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-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-11-18Remove duplicate includesKarel Zak
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-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-13Never call qsort on potentially NULL arraysZbigniew Jędrzejewski-Szmek
This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero.
2013-10-07journalctl: flip to --full by defaultZbigniew Jędrzejewski-Szmek
We already shew lines in full when using a pager or not on a tty. The commit disables ellipsization in the sole remaining case, namely when --follow is used. This has been a popular request for a long time, and indeed, full output seems much more useful. Old behaviour can still be requested by using --no-full. Old options retain their behaviour for compatiblity, but aren't advertised as much. This change applies only to jornalctl, not to systemctl, when ellipsization is useful to keep the layout. https://bugzilla.redhat.com/show_bug.cgi?id=984758
2013-09-10journald: be a bit more verbose when vacuumingZbigniew Jędrzejewski-Szmek
Vacuuming behaviour is a bit confusing, and/or we have some bugs, so those additional messages should help to find out what's going on. Also, rotation of journal files shouldn't be happening too often, so the level of the messages is bumped to info, so that they'll be logged under normal operation.
2013-08-20logs-show: add short-precise mode with us timestampsZbigniew Jędrzejewski-Szmek
Also, always show us timestamps in verbose mode. https://bugzilla.redhat.com/show_bug.cgi?id=991678
2013-08-11systemctl: show hint about --full when lines don't fitZbigniew Jędrzejewski-Szmek
2013-08-04systemd-delta: Only print colors when on a ttyDaniel Schaal
This make systemd-delta follow the behaviour of systemctl and journalctl. https://bugs.freedesktop.org/show_bug.cgi?id=67656 [zj: unify color query methods between those three programs.]
2013-07-26journalctl: use _COMM= match for scriptsZbigniew Jędrzejewski-Szmek
In case of scripts, _EXE is set to the interpreter name, and _COMM is set based on the file name. Add a match for _COMM, and _EXE if the interpreter is not a link (e.g. for yum, the interpreter is /usr/bin/python, but it is a link to /usr/bin/python2, which in turn is a link to /usr/bin/python2.7, at least on Fedora, so we end up with _EXE=/usr/bin/python2.7). I don't think that such link chasing makes sense, because the final _EXE name is more likely to change.
2013-07-18journalctl: add ”short-iso” output format with verbose ISO8601 timestampsTomasz Torcz
Example: 2013-07-18T10:10:01+0200 sandworm CROND[20957]: (root) CMD (/usr/lib64/sa/sa1 1 1)
2013-07-18journalctl: fix signedness warning and boot-id syntax checkZbigniew Jędrzejewski-Szmek
2013-07-17journalctl: remove ":" from the --boot syntaxZbigniew Jędrzejewski-Szmek
Instead of :-0, :1, :5, etc., use -0, 1 or +1, 5, etc. For BOOT_ID+OFFSET, use BOOT_ID+offset or BOOT_ID-offset (either + or - is required). Also make error handling a bit more robust and verbose. Modify the man page to describe the most common case (-b) first, and the second most common case (-b -1) second.
2013-07-16journalctl,systemctl: fix tiny memleakZbigniew Jędrzejewski-Szmek