| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(#34893)
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Otherwise the default log target is the console and we won't use
the journal socket even if it is available.
|
|
|
|
| |
Prompted by c5d675472588815dedf67af8c36da0fac398fb3e
|
| |
|
| |
|
| |
|
|
|
|
| |
We use singular "event" everywhere else, so let's use it here as well.
|
|
|
|
|
|
|
| |
This also fixes bugs in the previous code where we pass the server
object as userdata to sd_event_add_signal which means that sd-event
tries to use the value of the server pointer as its exit code when
a signal is triggered.
|
|
|
|
| |
No functional change, just refactoring.
|
| |
|
|\
| |
| | |
Read kernel-install config from /run/kernel too
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This means the main config file is loaded also from /run and /usr.
We should load the main config file from all the places where we load drop-ins.
I realize I had a giant blind spot: I always assumed that we load config files
from /etc, /run, /usr/local/lib, /usr/lib. But it turns out that we only used
those paths for drop-ins. For the main config file, we only looked in /etc. The
docs actually partially described this behaviour, i.e. most SYNOPSIS sections
and some parts of the text, but not others.
This is strange, because 6495361c7d5e8bf640841d1292ef6cfe1ea244cf was completely
bogus with the behaviour before this patch. We had a huge discussion before it
was merged, and clearly nobody noticed this. Similarly, in the previous version
of the current pull request, we had a long discussion about the appropriate
order of directories, and apparently nobody noticed that there was no order,
because only looked in one directory. So the blind spot seems to have been
shared.
Also, systemd-analyze cat-config behaved incorrectly, i.e. its behaviour matches
the new behaviour.
Possibly, in the future it'll make it easier to add support for --root.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This essentially reverts 5656cdfeeabc16b5489f5ec7a0a36025a2ec1f23. I find it
much easier to understand what is going on when the
path-relative-to-the-search-path is passed in full, instead of being constructed
from two parts, with one of the parts being implicit in some places.
Also, we call 'systemd-analyze cat-config <path>' with <path> with the same
meaning, so this makes the internal and external APIs more consistent.
|
| |
| |
| |
| |
| |
| | |
Dynamically load liblz4, libzstd and liblzma with dlopen().
This helps to reduce the size of the initrd image when these libraries
are not really needed.
|
|/
|
|
| |
args list
|
|
|
|
|
| |
This allows log messages forwarded over an AF_UNIX or AF_VSOCK socket by
journald to be received by systemd-journal-remote.
|
|
|
|
|
|
|
|
|
| |
journal_file_open_reliably()
I understand that the original motivation to introduce the template
argument here is to make journal_file_open() and _reliabrly() take the
same arguments. But, yeah, that's completely unused, not necessary to
complicate the code even the difference is not big.
|
|
|
|
| |
Co-authored-by: Costa Tsaousis <costa@netdata.cloud>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We would use alloca to extend the format string with "\n". We do this
automatically in order to not forget appending the newline everywhere.
We can simplify the whole thing by using a macro to append the newline instead,
which means that we don't need to copy the string.
Because we concatenate the string argument with another literal string, we know
it must a literal string. Thus it's not a problem that it is "evaluated" two
times.
Quoting Hristo Venev:
> Since commit f5e757f1ce84c1d6ae932cf2b604238fb4cedc00, mhd_respond() adds a
> newline to its argument before passing it on to mhd_respond_internal(). This
> is done via an alloca()-allocated buffer. However, MHD_RESPMEM_PERSISTENT is
> given as a flag to MHD_create_response_from_buffer(), leading to a
> use-after-free later when the response is sent. Replacing
> MHD_RESPMEM_PERSISTENT with MHD_RESPMEM_MUST_COPY appears to fix the issue.
MHD_RESPMEM_MUST_COPY would work, but we also use mhd_respond() for mhd_oom(),
and we don't want to allocate in an oom scenario in order to maximize the
possibility that an answer will be delivered. Using the macro magic makes this
nicer and we get rid of the code doing alloca.
Fixes an issue reported by Hristo Venev.
Fixes https://github.com/systemd/systemd/issues/9858.
|
| |
|
| |
|
|
|
|
| |
CID#1529420
|
|
|
|
|
|
|
| |
Request with Range header like 'entries=<cursor>:' (with a colon at the end,
invalid syntax per the doc), is now rejected with error 400 Bad Request.
fix #4883
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FORK_DEATHSIG_SIGTERM
Sometimes it makes sense to hard kill a client if we die. Let's hence
add a third FORK_DEATHSIG flag for this purpose: FORK_DEATHSIG_SIGKILL.
To make things less confusing this also renames FORK_DEATHSIG to
FORK_DEATHSIG_SIGTERM to make clear it sends SIGTERM. We already had
FORK_DEATHSIG_SIGINT, hence this makes things nicely symmetric.
A bunch of users are switched over for FORK_DEATHSIG_SIGKILL where we
know it's safe to abort things abruptly. This should make some kernel
cases more robust, since we cannot get confused by signal masks or such.
While we are at it, also fix a bunch of bugs where we didn't take
FORK_DEATHSIG_SIGINT into account in safe_fork()
|
|
|
|
|
|
|
|
|
| |
We usually check return value of syscalls or glibc functions by it is
negative or not, something like that `if (stat(path, &st) < 0)`.
Let's also use the same style for lseek() and friends even the type of
their return value is off_t.
Note, fseeko() returns int, instead of off_t.
|
|
|
|
|
|
|
|
|
|
| |
Make sure we don't log anything when running in "fuzzing" mode. Also,
when at it, unify the setup logic into a helper, pretty similar to
the test_setup_logging() one.
Addresses:
- https://github.com/systemd/systemd/pull/29558#pullrequestreview-1676060607
- https://github.com/systemd/systemd/pull/29558#discussion_r1358940663
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows distros to install configuration file templates in /usr/lib/systemd
for example.
Currently we install "empty" config files in /etc/systemd/. They serve two
purposes:
- The file contains commented-out values that show the default settings.
- It is easier to edit the right file if it is already there, the user doesn't
have to type in the path correctly, and the basic file structure is already in
place so it's easier to edit.
Things that have happened since this approach was put in place:
- We started supporting drop-ins for config files, and drop-ins are the
recommended way to create local configuration overrides.
- We have systemd-analyze cat-config which takes care of iterating over
all possible locations (/etc, /run, /usr, /usr/local) and figuring out
the right file.
- Because of the first two points, systemd-analyze cat-config is much better,
because it takes care of finding all the drop-ins and figuring out the
precedence. Looking at files manually is still possible of course, but not
very convenient.
The disadvantages of the current approach with "empty" files in /etc:
- We clutter up /etc so it's harder to see what the local configuration actually is.
- If a user edits the file, package updates will not override the file (e.g.
systemd.rpm uses %config(noreplace). This means that the "documented defaults"
will become stale over time, if the user ever edits the main config file.
Thus, I think that it's reasonable to:
- Install the main config file to /usr/lib so that it serves as reference for
syntax and option names and default values and is properly updated on package
upgrades.
- Recommend to users to always use drop-ins for configuration and
systemd-analyze cat-config to view the documentation.
This setting makes this change opt-in.
Fixes #18420.
[zjs: add more text to the description]
|
|\
| |
| | |
config files: update their header to reflect that they can be install…
|
| |
| |
| |
| | |
Follow-up for c76f2fb0e59340222ce21f85c17d384c114db9de.
|
| | |
|
| |
| |
| |
| | |
Now journal-remote can be built without libjournal_core.
|
| |
| |
| |
| |
| |
| |
| | |
shared/journal-file-util.[ch]
The files are used by both journald and journal-remote.
Let's move them to src/shared.
|
| |
| |
| |
| |
| | |
The ManagedJournalFile object is a trivial wrapper of JournalFile.
Let's drop it, and also drop 'managed_' prefix from the functions.
|
| |
| |
| |
| |
| | |
No functional change, just refactoring and preparation for later
commits.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 9289e093ae6fd5484f9119e1ee07d1dffe37cd10 we started using install_emptydir().
When running unprivileged, 'DESTDIR=… meson install -C build --quiet --no-rebuild'
would emit two warnings:
'…/var/log/journal': Unable to set owner 'root' and group 'root': Operation not permitted, ignoring...
'…/var/log/journal/remote': Unable to set owner 'root' and group 'root': Operation not permitted, ignoring...
Those were the only two install_emptydir()s that specified ownership.
Let's drop the user/group specification to get rid of the warning.
When installing as root, we will create a root-owned directory anyway.
When not running as root, we cannot create a root-owned directory.
So this specification only makes a difference if we are running as root,
and the directory already existed, and was not owned by root. In that case,
I think it's actually better to leave the existing modification in place.
(E.g. maybe the admin chgrp'ed the ownership for whatever reason. We might
just as well leave that in place.)
|
|
|
|
| |
Follow-up for 3b0754b16c5.
|
|
|
|
| |
Follow-up for: 3746131aac4798cacf67b60cfc4e2e1c80ec4efb
|
|
|
|
|
|
| |
The script is mostly equivalent to 'mkdir -p' and 'ln -sfr'.
Let's replace it with install_emptydir() builtin function and
inline meson call.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Follow-up for 9f6e0bd417fa287dd1e7b541bfe0c60f04cc29e4.
Note that sd_journal_open() is a simple wrapper of sd_journal_open_namespace(),
hence we can merge the two branch.
|
| |
|
|
|
|
| |
Prompted by 2411e990a480affe30bd99a2a33ab6b94a3fe5dd.
|
| |
|
|
|
|
| |
To make them consistent throughout the file.
|