| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
invoked in a container
The auditing subsystem is still not virtualized for containers, hence the two
values don't really make sense inside them, they will just leak
information from outside into the container. Hence don't make use of the
data if we detect we are run inside of a container.
This has visible effects: logind will no longer try to reuse the
auditing session ids as its own session ids when run inside a container.
While are at it, modernize the calls in more ways:
1. switch to pidref behaviour, all but one of our uses are using pidref
anyway already.
2. use read_virtual_file() + proc_mounted()
3. reasonable distinguish ENOENT errors when reading the process proc
files: distinguish the case where /proc is not mounted, from the case
where the process is already gone, from where auditing is not enabled
in the kernel build.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Users will generally know what a qrcode is, so let's not treat them as dumb and
explain that it can be scanned. OTOH, we should say what the qrcode contains
and it is useful to give a hint why the users would want to scan it. Reword
messages accordingly.
(Also, don't say "to your phone", when somebody might be using a stolen phone,
or something else then a phone.)
|
| |
| |
| |
| |
| |
| |
| | |
People know what a qrcode is. We don't need to tell them to scan it.
Instead, we should say what the code contains.
While at it, rename "stream" to "f" in line with the usual style.
|
| |
| |
| |
| |
| |
| | |
When invoked on a running system, bsod would not print the qrcode.
The check for "color support" on stdout is pointless, since we're not
printing to stdout but to a terminal fd that is opened separately.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We often used a pattern like if (!FLAGS_SET(flags, SD_JSON_FORMAT_OFF)),
which is rather verbose and also contains a double negative, which we try
to avoid. Add a little helper to avoid an explicit bit check.
This change clarifies an aditional thing: in some cases we treated
SD_JSON_FORMAT_OFF as a flag (flags & SD_JSON_FORMAT_OFF), while in other cases
we treated it as an independent enum value (flags == SD_JSON_FORMAT_OFF).
In the first form, flags like SD_JSON_FORMAT_SSE do _not_ turn the json
output on, while in the second form they do. Let's use the first form
everywhere.
No functional change intended.
Initially I wasn't sure if this helper should be made public or just internal,
but it seems such a common pattern that if we expose the flags, we might just
as well expose it too, to make life easier for any consumers.
|
|
|
|
|
|
|
| |
Otherwise, if the process forks child processes, then the arguments
cannot be used from them.
To avoid potential issues like the one fixed by
6d3012bab4ce4c1ed260598d05b4e9f2ea471658.
|
|
|
|
|
| |
Even optarg is erased, copied string was not erased.
Let's erase the copied key for safety.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This tries to get rid of most manual sigprocmask() changes, in favour
of:
1. The SD_EVENT_SIGNAL_PROCMASK flag to sd_event_add_signal()
2. The sd_event_set_signal_exit() call for handling SIGTERM/SIGINT
3. Move masking of SIGWINCH into ptyfwd, out of nspawn/vmspawn/run
And while we are at it get rid of a bunch of event source fields whose
lifetime is bound to the sd_event object they belong to anyway, and make
use of the "floating" event source feature of sd-event instead.
|
|
|
|
|
|
|
|
|
|
| |
Let's make clearer what we are going to use /dev/kmsg for: read/write or just
writing. This hopefully should avoid confusion, such as the one #33975
is result of.
(Also while we are at it, add one extra debug message).
Fixes: #33975
|
|
|
|
|
|
|
|
|
|
|
|
| |
We typically want to deal in usec_t, hence let's change the prototype
accordingly, and do proper range checks. Also, make sure are not
confused by negative times.
Do something similar for mktime_or_timegm().
This is a more comprehensive alternative to #34065
Replaces: #34065
|
|
|
|
| |
Also, unify MSG_TRUNC handling all across the codebase.
|
|
|
|
|
| |
This makes the macros use log_syntax_parse_error(), hopefully which provides
more informative log message in general, and reduces binary size.
|
|
|
|
| |
which combines sigbus_install() and bumping fd limit.
|
| |
|
|\
| |
| | |
journal: do not rotate journal when MaxRetentionSec= is set
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The setting is about vacuuming archived journal files. It is not
necessary to rotate the current journal. Note, journal file rotation is
controlled by MaxFileSec=.
Fixes #31315.
|
|/
|
|
|
|
|
| |
As at this stage, a persistent journal file has been already opened, and
saved seqnum has been reset, and any later journal entries will be stored
to the file. Hence we should not open the runtime journal file by
server_system_journal_open() again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the following error:
===
In file included from ../src/basic/macro.h:13,
from ../src/basic/dirent-util.h:8,
from ../src/journal/journalctl-misc.c:3:
../src/journal/journalctl-misc.c: In function 'show_log_ids':
../src/journal/journalctl-misc.c:107:22: error: comparison is always true due to limited range of data type [-Werror=type-limits]
107 | assert(n_ids < INT64_MAX);
| ^
../src/fundamental/macro-fundamental.h:70:44: note: in definition of macro '_unlikely_'
70 | #define _unlikely_(x) (__builtin_expect(!!(x), 0))
| ^
../src/basic/macro.h:165:22: note: in expansion of macro 'assert_message_se'
165 | #define assert(expr) assert_message_se(expr, #expr)
| ^~~~~~~~~~~~~~~~~
../src/journal/journalctl-misc.c:107:9: note: in expansion of macro 'assert'
107 | assert(n_ids < INT64_MAX);
| ^~~~~~
cc1: all warnings being treated as errors
===
Follow-up for 0a8c1f6212a874b542a57ed5416e7d3575d2da93.
|
|
|
|
|
|
|
|
|
| |
The --list-invocations command is similar to --list-boots, but shows
invocation IDs of specified unit. This should be useful when showing
a specific invocation of a unit.
The --invocation option is similar to --boot, but takes a invocation ID
or an offset. The -I option is equivalent to --invocation=0.
|
| |
|
|
|
|
| |
No functional change, just refactoring and prepraration for later change.
|
| |
|
|
|
|
|
|
|
| |
The struct itself is generic, and can be used for other ID.
Let's rename it to more generic one.
No functional change, just refactoring and preparation for later
commits.
|
|
|
|
|
|
|
|
|
| |
This is a lot of stuff, and sometimes quite wild, let's turn this into
its own header.
All stuff color-related that just generates sequences is now in
ansi-color.h (no .c file!), and everything more complex that
probes/ineracts with terminals remains in termina-util.[ch]
|
|
|
|
|
|
|
|
| |
terminal_set_cursor_position()
Let's prefix these functions with the subsystem name, and clean them up
a bit. Specifically, drop the error logging, it's entirely duplicative,
since every single caller does it anyway.
|
|
|
|
|
|
|
|
|
|
| |
It's time. sd-json was already done earlier in this cycle, let's now
make sd-varlink public too.
This is mostly just a search/replace job of epical proportions.
I left some functions internal (mostly IDL handling), and I turned some
static inline calls into regular calls.
|
|\
| |
| | |
journal: partially revert recent changes
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This partially reverts commit a9357c2ce2d188b5b63592fd271f14d335867c23.
Some kmsg sent before sleep may be received by systemd-journald after
sleep. In that case, map_clock_usec() does not provide correct
timestamp.
So, we cannot provide reliable _SOURCE_MONOTONIC_TIMESTAMP.
|
|/ |
|
|
|
|
|
|
|
|
|
| |
Then, fix the monotonic timestamp.
The _SOURCE_MONOTONIC_TIMESTAMP field is already used in other projects.
Hence, we cannot remove the field. But, let's store the correct value.
The existence of the new _SOURCE_BOOTTIME_TIMESTAMP field can indicate
that the monotonic timestamp field is reliable or not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is preparation for making our Varlink API a public API. Since our
Varlink API is built on top of our JSON API we need to make that public
first (it's a nice API, but JSON APIs there are already enough, this is
purely about the Varlink angle).
I made most of the json.h APIs public, and just placed them in
sd-json.h. Sometimes I wasn't so sure however, since the underlying data
structures would have to be made public too. If in doubt I didn#t risk
it, and moved the relevant API to src/libsystemd/sd-json/json-util.h
instead (without any sd_* symbol prefixes).
This is mostly a giant search/replace patch.
|
|
|
|
| |
sd_event_source_set_enabled() does the same check internally.
|
|
|
|
|
|
| |
If the runtime journal is opened, we will anyway write journal entries
to the runtime journal, even if the persistent journal is writable.
Hence, we need to flush the runtime journal file later.
|
| |
|
|
|
|
|
| |
Then, we can use SD_JOURNAL_ASSUME_IMMUTABLE flag, and the performance
of reading runtime journal should be improved.
|
|
|
|
|
|
|
| |
config_parse_forward_to_socket() is not used for parsing unit files
either.
Follow-up-for: f31cff849d3db074d0d8157e4117d9b8372c03e8
|
|
|
|
|
|
|
|
|
| |
config_parse_compress() is not used for parsing unit files, hence unit
is always NULL.
Fixes #32856
Follow-up-for: 6813be2eba24a2f864d5d47326437dbff38cd675
|
|
|
|
|
|
| |
with OrderedHashmap
No functional change, just refactoring.
|
|
|
|
| |
No functional change, just refactoring.
|
|
|
|
| |
This also makes journal_ratelimit_group_new() use structured initializer.
|
|
|
|
| |
'r' is usually used for storing return value.
|
| |
|
|
|
|
| |
To make it follow our recent coding style.
|
| |
|
| |
|
| |
|