summaryrefslogtreecommitdiff
path: root/src/journal
AgeCommit message (Collapse)Author
2013-03-29journalctl: fix --update-catalog with not --root argZbigniew Jędrzejewski-Szmek
grawity> `journalctl --update-catalog` from latest git prints: "Recursive mkdir .: Invalid argument" and "Failed to write : Invalid argument"
2013-03-28journalctl: support --root for message catalogsZbigniew Jędrzejewski-Szmek
2013-03-28catalog: open up catalog internalsZbigniew Jędrzejewski-Szmek
In order to write tests for the catalog functions, they are made non-static and start taking a 'database' parameter, which is the name of a file with the preprocessed catalog entries. This makes it possible to make test-catalog part of the normal test suite, since it now only operates on files in /tmp. Some more tests are added.
2013-03-28catalog: make sure strings are terminatedZbigniew Jędrzejewski-Szmek
Coverity complains: systemd-199/src/journal/catalog.c:126: buffer_size_warning: Calling strncpy with a maximum size argument of 32 bytes on destination array "i->language" of size 32 bytes might leave the destination string unterminated. ...and unfortunately it was right. The string was defined as a fixed-size string in some parts of the code, and used a null-terminated string in others (e.g. in log statements). There's no point in conserving one byte, so just define the max language tag length to 31 bytes, and use null terminated strings everywhere. Also, wrap some lines, zero-fill less bytes, use '\0' instead of just 0 to be more explicit that this is one byte.
2013-03-28coredump: do not free twicesystemd/v200Zbigniew Jędrzejewski-Szmek
2013-03-27catalog: fix error codes handling in catalog_list_itemsLukas Nykryn
Previously r was set to zero and so if(r<0) was never true.
2013-03-27log: fix error codes handling in catalog_list_itemsLukas Nykryn
It does not make sense to print error code from previous loop.
2013-03-25journal: Add sync timer to journal serverOleksii Shevchuk
Add option to force journal sync with fsync. Default timeout is 5min. Interval configured via SyncIntervalSec option at journal.conf. Synced journal files will be marked as OFFLINE. Manual sync can be performed via sending SIGUSR1.
2013-03-23journald: remove unconditional log_*() use in the main loopKay Sievers
Setting MaxRetentionSec= caused the kernel log to overflow and the journal daemon to enter an endless loop. Logging from the journald main loop gets directed to /dev/kmsg, which wakes up journald again. We skip the import of this message by checking for our own PID, but this still causes the main loop to never go to sleep again because we never stopped logging from there.
2013-03-23journal: don't access j->files after useLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=62605
2013-03-23journalctl: various fixes to the access check logicLennart Poettering
- Reword messages a bit - Correct check whether EACCES is in the set of errors - Don't complain if no journal files are found - allocate Set object for errors lazily since in the best case we don't need it at all. - don't consider it an error if /run/log/journal doesn't exist (because that's the usual case actually, if storage is enabled)
2013-03-22journalctl: be smarter about journal error checksZbigniew Jędrzejewski-Szmek
There are many ways in which we can get those checks wrong, so it is better to warn and then error out on a real access failure. The error messages are wrapped to <80 lines, because their primary use is to be displayed in the terminal, and it is easier to read them this way. Reading them in the journal can be a bit trickier, but this is a bug in logs-show.c.
2013-03-22build-sys: move acl searching code into libsystemd-aclZbigniew Jędrzejewski-Szmek
This loop over acls is a bit too much to keep inside of another loop.
2013-03-22journalctl: give a nice hint about group membership based on ACLs of ↵Lennart Poettering
/var/log/journal If we notice that we unprivileged and not in any of the groups which have access to /var/log/journal, print a nice message about which groups do. This checks and prints all groups that are in the default ACL for /var/log/journal, which is not necessarily correct for all journal files, but pretty close.
2013-03-21Fix vacuum logic errorJan Alexander Steffens (heftig)
The vacuum code used to stop vacuuming after one deletion, even when max_use was still exceeded. Also make usage a uint64_t, as the code already pretends it is one. Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
2013-03-20Remove some unused variablesZbigniew Jędrzejewski-Szmek
2013-03-20macro: don't redefine CLAMP if it is already defined by glib or some other ↵Lennart Poettering
library
2013-03-19journalct: beef up entry listingZbigniew Jędrzejewski-Szmek
The ability to dump catalog entries in full and by id is added.
2013-03-19journalctl: use _cleanup_ in one functionZbigniew Jędrzejewski-Szmek
2013-03-18sd-journal: do not require path to be absoluteZbigniew Jędrzejewski-Szmek
Seems natural to be able to specify relative directory, e.g. with journalctl -D. And even if, this should be checked in front-end code, not in the library.
2013-03-18journal,shared: add _cleanup_journal_close_Zbigniew Jędrzejewski-Szmek
2013-03-18journal: use _cleanup_Zbigniew Jędrzejewski-Szmek
One log_debug() moved to match order in other functions.
2013-03-18journal: use sd_journal_close on error in sd_journal_newZbigniew Jędrzejewski-Szmek
2013-03-16journal: pass the *pid* to sd_pid_get_owner_uid()Kay Sievers
2013-03-13journalctl: show systemd messages about unit for -uZbigniew Jędrzejewski-Szmek
journalctl -u unit is not very useful, because it doesn't show systemd messages about starting, stopping, coredumps, etc, like systemctl status unit does. Make it show the same information using the same rules. If somebody really want to see just messages from by the unit, it is easy enough to use _SYSTEMD_UNIT=...
2013-03-11journald: allow priority of 999, tooLennart Poettering
2013-03-08journal: allow priority 0 in stdout streamMichal Schmidt
Priority 0 is acceptable (it's LOG_EMERG). BTW, I'm not sure why we allow priorities up to 999, but I'm leaving this be for now. http://lists.freedesktop.org/archives/systemd-devel/2013-March/009510.html
2013-03-07journalctl: imply -n1000 when -e is usedLennart Poettering
Make sure the pager does not have to buffer an unbounded number of log messages, by default.
2013-03-07pager: introduce "jump to end" optionHarald Hoyer
$ journalctl -be is what you want :) https://bugzilla.redhat.com/show_bug.cgi?id=867841
2013-03-07libsystemd-journal: return 0 on success in get_data()Zbigniew Jędrzejewski-Szmek
The man page says so. Right now 0 would be returned if the data was encrypted, 1 otherwise.
2013-03-06libsystemd-journal: export new function, increase library versionZbigniew Jędrzejewski-Szmek
Since sd_journal_reliable_fd wasn't exported before, it is as if it was added now. Library "current" number must be bumped. michich> Someone links with the fixed version and produces a RPM with his program. The RPM will happily install on a system with an old systemd version (the deps will appear fine), but the program will fail to run.
2013-03-06journal: properly advertise sd_journal_reliable_fdZbigniew Jędrzejewski-Szmek
sd_journal_reliable_fd was added in 85210bffd836, but it was exported under the wrong name. Not too many users I guess.
2013-03-05journal/tests: free allocated memory in testZbigniew Jędrzejewski-Szmek
2013-03-05journald: introduce new "systemd-journal" group and make it own the journal ↵Lennart Poettering
files Previously all journal files were owned by "adm". In order to allow specific users to read the journal files without granting it access to the full "adm" powers, introduce a new specific group for this. "systemd-journal" has to be created by the packaging scripts manually at installation time. It's a good idea to assign a static UID/GID to this group, since /var/log/journal might be shared across machines via NFS. This commit also grants read access to the journal files by default to members of the "wheel" and "adm" groups via file system ACLs, since these "almost-root" groups should be able to see what's going on on the system. These ACLs are created by "make install". Packagers probably need to duplicate this logic in their postinst scripts. This also adds documentation how to grant access to the journal to additional users or groups via fs ACLs.
2013-03-05journald: stpcpy() + mempcpy() are awesomeLennart Poettering
2013-03-05journald: drop splitting-by-audit entirelyLennart Poettering
Thinking about it we should probably not hide bugs by falling back to audit when we have our own session information anyway.
2013-03-05journald: be a bit more careful when spitting up journals by user idLennart Poettering
2013-03-05journald: check session owner UID rather then audit ID when splitting up ↵Lennart Poettering
journal files We should always go by our own cgroup hierarchy before using foreign schemes such as audit, so let's do that for the split out logic too.
2013-03-04journal: split journal uid only when audit uid data is validKay Sievers
2013-03-03journald: do not barf when setting RateLimitInterval=0Zbigniew Jędrzejewski-Szmek
Assertion 'interval > 0 || burst == 0' failed at src/journal/journald-rate-limit.c:78, function journal_rate_limit_new(). Aborting.
2013-03-01coredump: bump coredump truncation size from 24M to 768MLennart Poettering
In the long run we really should make this runtime configurable.
2013-03-01journalctl: add --user-unit= switchDaniel Wallace
Add --user-unit= to make it possible to query for user logs by the name of the service.
2013-03-01journalctl: add --reverse option to show the newest lines firstLukas Nykryn
2013-02-28Merge branch 'python-systemd-reader'Zbigniew Jędrzejewski-Szmek
* python-systemd-reader: python-systemd: rename Journal to Reader build-sys: upload python documentation to freedesktop.org systemd-python: add Journal class for reading journal python: build html docs using sphinx journalct: also print Python code in --new-id python: utilize uuid.UUID in logging python: add systemd.id128 module ... and 34 other commits In short: python module systemd.id128 is added, and existing systemd.journal gains a new class systemd.journal.Reader, which can be used to iterate over journal entries. Documentation is provided, and accessible under e.g. pydoc3 systemd.journal.Reader or firefox http://www.freedesktop.org/software/systemd/man/python-systemd/
2013-02-26log-show: look at everything in /run/log/journalZbigniew Jędrzejewski-Szmek
Logs written by journald from the initramfs may be written to a directory with the name created from a random machine-id. Afterwards, when the root filesystem has been mounted and machine-id reinitalized, logs will be written to the directory with a name created from the proper machine-id. When logs are flushed to /var/log/journal, everything is copied to one output directory. When journalctl without '-m' is run after the logs have been flushed to /var/log/journal, all messages are shown. However, when run while logs are still in /run/log/journal, those stored under the random machine-id will not be shown. Make journalctl behave the same regardless whether persistent storage has been enabled or not, and slurp all files from /run/log/journal even without '-m'.
2013-02-24journal: fix --untilPaul W. Frields
https://bugs.freedesktop.org/show_bug.cgi?id=58946
2013-02-22journalct: also print Python code in --new-idZbigniew Jędrzejewski-Szmek
2013-02-22journal: sd_journal_get_cursor should return 0 on successZbigniew Jędrzejewski-Szmek
Documentation states that 0 is correct, and all other similar functions return 0 on success. Pointed-out-by: Steven Hiscocks <steven-systemd@hiscocks.me.uk>
2013-02-14added some missing include for a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7Harald Hoyer
2013-02-14honor SELinux labels, when creating and writing config filesHarald Hoyer
Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577