Commit Graph

56 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 20ad4cfd8e core: add catalog entry and MESSAGE_ID for overmounting 2012-12-05 12:25:50 +01:00
Lennart Poettering 93b73b064c journal: by default do not decompress dat objects larger than 64K
This introduces a new data threshold setting for sd_journal objects
which controls the maximum size of objects to decompress. This is
relieves the library from having to decompress full data objects even
if a client program is only interested in the initial part of them.

This speeds up "systemd-coredumpctl" drastically when invoked without
parameters.
2012-11-21 00:28:00 +01:00
Lennart Poettering 8f1e860f8a journal: add sd_journal_get_catalog_for_message_id() as API to get catalog entry for any message ID without requiring an open journal file 2012-11-20 21:39:16 +01:00
Lennart Poettering 5d6a86d7a0 catalog: add catalog entries for all of systemd's own journal messages 2012-11-16 03:03:22 +01:00
Lennart Poettering d4205751d4 journal: implement message catalog
The message catalog can be used to attach short help texts to log lines,
keyed by their MESSAGE_ID= fields. This is useful to help the
administrator understand the context and cause of a message, find
possible solutions and find further related documentation.

Since this is keyed off MESSAGE_ID= this will only work for native
journal messages.

The message catalog supports i18n, and is useful to augment english
language system messages with explanations in the local language.

This commit only includes short explanatory messages for a few example
message IDs, we'll add more complete documentation for the relevant
systemd messages later on.
2012-11-15 23:09:07 +01:00
Lennart Poettering 85210bffd8 journal: provide an API that allows client to figure out whether they need to recheck the journal manually for changes in regular intervals
Network file systems generally do not offer inotify() that would work
across the network. We hence cannot rely on inotify() exclusiely in
those case. Provide an API to determine these cases, and suggest doing
manual regular rechecks.

Note that this is not complete yet, as we need to rescan journal dirs on
network file systems explicitly to find new/removed files
2012-10-26 20:07:33 +02:00
Zbigniew Jędrzejewski-Szmek 23635a8547 systemd: use structured logging for unit changes
Information which unit a log entry pertains to enables systemctl
status to display more log messages.
2012-10-18 21:33:52 +02:00
Lennart Poettering 3c1668da62 journal: add ability to list values a specified field can take in all entries of the journal
The new 'unique' API allows listing all unique field values that a field
specified by a field name can take in all entries of the journal. This
allows answering queries such as "What units logged to the journal?",
"What hosts have logged into the journal?", "Which boot IDs have logged
into the journal?".

Ultimately this allows implementation of tools similar to lastlog based
on journal data.

Note that listing these field values will not work for journal files
created with older journald, as the field values are not indexed in
older files.
2012-10-18 03:35:18 +02:00
Lennart Poettering 183de6d7d9 id128: introduce new SD_ID128_CONST_STR() macro 2012-10-16 17:02:51 +02:00
Lennart Poettering 706911fba8 journal: don't export MESSAGE_ID() macro
If it is exported it would need to be prefixed, but since we need it
exclusively internally so far, simply move it to an internal header.
2012-10-16 16:26:41 +02:00
Zbigniew Jędrzejewski-Szmek 1ca6783f5e log: introduce a macro to format message id
The MESSAGE_ID=... stanza will appear in countless number of places.
It is just too long to write it out in full each time.

Incidentally, this also fixes a typo of MESSSAGE is three places.
2012-10-13 14:26:30 +02:00
Lennart Poettering c6511e859c journal: when browsing the journal via browse.html allow clicking on entries to show their details 2012-10-10 22:41:03 +02:00
Lennart Poettering c2893c4b34 journald: log how big the journal files may grow 2012-09-21 22:50:26 +02:00
Lennart Poettering 178cc7700c journald: log when we fail to forward messages to syslog
https://bugzilla.redhat.com/show_bug.cgi?id=847207
2012-09-17 23:59:26 +02:00
Eelco Dolstra 0675cc4a02 daemon: Fix broken links to sd-daemon.c 2012-09-13 20:08:54 +02:00
Lennart Poettering e50d504865 journal: fix 128bit IDs of unit reload entries 2012-09-13 18:22:17 +02:00
Lennart Poettering a1a03e3075 journal: add call to determine current journal file disk usage 2012-09-07 23:20:28 +02:00
Lennart Poettering 877d54e9b0 journal: generate structured journal messages for a number of events 2012-09-03 18:59:04 -07:00
Lennart Poettering 8e4e8df5ea id128: don't use C99 bool in public headers 2012-08-10 17:58:46 +02:00
Lennart Poettering cee5e9a7ca journald: never read the same kernel msg twice, and generate message when we lose one 2012-08-09 17:52:05 +02:00
Lennart Poettering 18c7ed186b journal: add sd_journal_perror() to API 2012-08-01 19:53:23 +02:00
Lennart Poettering 4171a6676c man: document sd_journal_get_data() and friends 2012-07-13 19:00:48 +02:00
Lennart Poettering a81df0ad90 man: document sd_journal_stream_fd() 2012-07-13 02:18:45 +02:00
Lennart Poettering cb07866b1b man: move header file man pages from section 7 to 3
This way we can include documentation about minor macros/inline function
within the introducionary man page in a sane way.
2012-07-13 01:50:05 +02:00
Lennart Poettering cbdca8525b journal: beef up journal matches considerably
we now can take multiple matches, and they will apply as AND if they
apply to different fields and OR if they apply to the same fields. Also,
terms of this kind can be combined with an overreaching OR.
2012-07-13 00:32:32 +02:00
Lennart Poettering a963990ff4 journal: rework directory enumeration/watch logic
There's now sd_journal_new_directory() for watching specific journal
directories. This is exposed in journalctl -D.

sd_journal_wait() and sd_journal_process() now return whether changes in
the journal are invalidating or just appending.

We now create inotify kernel watches only when we actually need them
2012-07-11 01:08:38 +02:00
Lennart Poettering e02d1cf72d journal: introduce sd_journal_wait() to simplify writing synchronous clients 2012-07-10 21:46:11 +02:00
Lennart Poettering a8eedf4953 man: document sd_print() and friends 2012-07-09 15:46:21 +02:00
David Strauss e911672372 journal: typo fix in sd-journal.h 2012-06-26 12:25:11 +02:00
Lennart Poettering 20747498c6 login: wrap CanTTY and CanGraphical seat attributes in libsystemd-login 2012-06-21 16:52:54 +02:00
Lennart Poettering 0604381b9d logind: introduce a state for session, being one of online, active, closing
online = logged in
active = logged in and session is in the fg
closing = nominally logged out but some left-over processes still around

Related to:

https://bugzilla.gnome.org/show_bug.cgi?id=677556
2012-06-21 16:14:53 +02:00
Lennart Poettering 089842938d journal: expose and make use of cutoff times of journal
This helps explaining when the log output of "systemctl status" is
incomplete because the logs got rotated since the service was started.
2012-06-17 00:03:12 +02:00
Lennart Poettering ee1f44bd9a sd-login: update header docs a bit 2012-05-14 22:41:30 +02:00
Lennart Poettering 5430f7f2bc relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.

Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.

The bits that used to be MIT continue to be MIT.

The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends.
2012-04-12 00:24:39 +02:00
Lennart Poettering 04ebb59567 shutdownd: rework interface, allow subscribing to scheduled shutdowns
This extends the shutdownd interface to expose schedule shutdown
information in /run/systemd/shutdown/schedule.

This also cleans up the shutdownd protocol and documents it in a header
file sd-shutdown.h.

This is supposed to be used by client code that wants to control and
monitor scheduled shutdown.
2012-04-11 02:04:46 +02:00
Lennart Poettering b070e7f3c9 journal: implicitly add code location to all messages logged with the native interface
This logic can be turned off by defining SD_JOURNAL_SUPPRESS_LOCATION
before including sd-journal.h.

This also saves/restores errno in all logging functions, in order to be
useful as logging calls without side-effects.

This also adds a couple of __unlikely__ around the early checks in the
logging calls, in order to minimize the runtime impact.
2012-04-02 19:29:48 +02:00
Lennart Poettering e09a9a35a1 sd-login: c++ compatibility 2012-03-05 15:16:10 +01:00
Lennart Poettering fc8af9ff3f login: introduce sd_session_get_display() 2012-02-15 04:56:10 +01:00
Lennart Poettering 51f58f083a login: add new sd_session_get_type() and sd_session_get_class API calls 2012-02-14 21:54:00 +01:00
Michael Biebl a26c9cc604 Fix broken Git repository URLs 2012-02-13 17:49:09 +01:00
Michael Olbrich a6927d7ffc service: add watchdog timestamp
This patch adds WatchdogTimestamp[Monotonic] to the systemd service
D-Bus API. The timestamp is updated to the current time when the
service calls 'sd_nofity("WATCHDOG=1\n")'.
Using a timestamp instead of an 'alive' flag has two advantages:
1. No timeout is needed to define when a service is no longer alive.
   This simplifies both configuration (no timeout value) and
   implementation (no timeout event).
2. It is more robust. A 'dead' service might not be detected should
    systemd 'forget' to reset an 'alive' flag. It is much less likely
    to get a valid new timestamp if a service died.
2012-02-01 19:29:19 +01:00
Lennart Poettering a558d00381 journal: move journal TODO into main TODO 2012-01-23 22:01:29 +01:00
Lennart Poettering f5e04665eb journal: hook up coredumping with journal 2012-01-14 01:54:33 +01:00
Lennart Poettering f987397649 api: add C++ guards to all headers 2012-01-13 00:49:21 +01:00
Lennart Poettering 19a2bd80c1 sd-journal: implement a number of non-implemented calls from the API for now 2012-01-11 03:23:04 +01:00
Lennart Poettering 731a676c20 systemd: reconnect to syslog as soon as the journal is fully up 2012-01-11 03:16:24 +01:00
Lennart Poettering 7e4ab3c5a6 shutdown: exclude processes with argv[0][0] from killing 2012-01-10 05:03:59 +01:00
Lennart Poettering aaf53376aa journald: remove inner loop debug message 2012-01-07 04:10:21 +01:00
Lennart Poettering e4bac488f9 sd-id128: let's make our API a bit smaller, since sd_id128_make_v4_uuid() is dispensable 2012-01-07 01:37:39 +01:00
Lennart Poettering eff406331a login: implement sd_session_get_service() 2012-01-05 23:14:22 +01:00