| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Let's log about which bus we're trying to connect to and what transport
we're using to do it.
|
| |
|
| |
|
|
|
|
| |
Let's expose the diskseq a bit more prominently.
|
| |
|
|
|
|
| |
Let's add a JSON output mode, like we have it for so many of our tools.
|
|
|
|
|
|
|
|
|
|
| |
The "systemd-mount" tool is the one outlier in our codebase to specify
upper case column names. And it's quite pointless given that our table
output logic uppercases this anyway on output. Hence, let's fix that.
(This would be a compat break, if we'd support JSON output of this
table, but we do not currently. JSON fields use the literal column
name after all.)
|
|
|
|
|
| |
The functions in the file were *not* using the spawn prefix,
and the prefix seems completely unnecessary.
|
|
|
|
|
| |
Otherwise the default log target is the console and we won't use
the journal socket even if it is available.
|
| |
|
|
|
|
|
| |
Change the 'quiet' flag to `bus_wait_for_jobs()` to an enum, so we can
select with more granularity the type of information logged.
|
|
|
|
|
|
|
| |
Otherwise bad thing would've happened is this was a hard assert:
+ systemd-mount --umount /dev/loop0
Assertion 'device' failed at src/libsystemd/sd-device/sd-device.c:2202, function sd_device_get_property_value(). Ignoring.
|
|\
| |
| | |
mount-tool: trivial tweaklets
|
| | |
|
| |
| |
| |
| |
| | |
Let the table logic handle the special casing ov unavailable data,
rather than doing that ourselves.
|
| | |
|
|/
|
|
|
| |
We chck the same props in various places, add a single implementation of
a call to inquire this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
path_simplify_full()/path_simplify() are changed to allow a NULL path, for
which a NULL is returned. Generally, callers have already asserted before that
the argument is nonnull. This way path_simplify_full()/path_simplify() and
path_simplify_alloc() behave consistently.
In sd-device.c, logging in device_set_syspath() is intentionally dropped: other
branches don't log.
In mount-tool.c, logging in parse_argv() is changed to log the user-specified
value, not the simplified string. In an error message, we should show the
actual argument we got, not some transformed version.
|
|
|
|
| |
Follow-up for 9269296df05a724c6b121bcbb0b420c8b4088f2f
|
|
|
|
|
|
|
|
|
|
|
| |
The kernel default for tmpfs mounts is rwxrwxrwt, i.e. world-writable with the
sticky bit set. This makes sense for /tmp and /var/tmp, but less so for other
directories. Users will not use systemd-mount to mount /tmp and /var/tmp, so
the existing behaviour is surprising. The defaults are overriden to the
same defaults we use for "internal tmpfs mounts", i.e. no sticky bit, nosuid,
nodev, and limits of size=10%, nr_inodes=400k.
--tmpfs is new, so we can modify the behaviour without breaking compatibility.
|
| |
|
|
|
|
|
| |
We were consistenly using --umount everywhere, but add a comment to make this
clearer. Also, reword a few things for clarity.
|
|
|
|
|
|
| |
Mount units can do it, but the command line tool cannot, as it needs a
valid 'what'. If --tmpfs/-T if passed, parse the argument as 'where'
and send a literal 'tmpfs' as the 'what' if not specified.
|
|
|
|
|
|
| |
The script is mostly equivalent to 'mkdir -p' and 'ln -sfr'.
Let's replace it with install_emptydir() builtin function and
inline meson call.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Let's be more accurate about what this function does: it checks whether
the underlying reported inode is the same. Internally, this already uses
a better named stat_inode_same() call, hence let's similarly name the
wrapping function following the same logic.
Similar for files_same_at() and path_equal_or_same_files().
No code changes, just some renaming.
|
|
|
|
|
|
|
|
|
| |
Chasing symlinks is a core function that's used in a lot of places
so it deservers a less verbose names so let's rename it to chase()
and chaseat().
We also slightly change the pattern used for the chaseat() helpers
so we get chase_and_openat() and similar.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In various tools and services we have a per-system and per-user concept.
So far we sometimes used a boolean indicating whether we are in system
mode, or a reversed boolean indicating whether we are in user mode, or
the LookupScope enum used by the lookup path logic.
Let's address that, in introduce a common enum for this, we can use all
across the board.
This is mostly just search/replace, no actual code changes.
|
| |
|
|
|
|
| |
No functional change, just refactoring.
|
|
|
|
|
| |
No functional change, just refactoring and preparation for later
commits.
|
|
|
|
| |
No functional change, just refactoring.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is useful for systems which don't have any fsck.
We already skip emitting the fsck dependency when the fsck.$fstype helper
is missing, but fstab-generator doesn't necessarily know the fstype when
handling the root= parameter.
Previously, systemd-fsck was started for these mounts and then exited
immediately because it couldn't find the fsck.$fstype helper.
|
|
|
|
| |
And pass it through to bus_wait_for_jobs()
|
|
|
|
| |
As in the previous commit, 'de' is used as the iterator variable name.
|
|\
| |
| | |
A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
|
| | |
|
|/
|
|
|
|
|
|
| |
(Or when -H is used, since -H and -M are incompatible.)
Note that the slightly unusual form with separate boolean variables (hint_vars,
hint_addr) instead of e.g. a const char* variable to hold the message, because this
way we don't trigger the warning about non-literal format.
|
| |
|
|
|
|
|
|
|
|
| |
When we are in --user mode there's no point in doing PolicyKit/ask-pw
because both of these systems are only used by system-level services.
Let's disable the two agents for that automaticlly hence.
Prompted by: #20576
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In general we almost never hit those asserts in production code, so users see
them very rarely, if ever. But either way, we just need something that users
can pass to the developers.
We have quite a few of those asserts, and some have fairly nice messages, but
many are like "WTF?" or "???" or "unexpected something". The error that is
printed includes the file location, and function name. In almost all functions
there's at most one assert, so the function name alone is enough to identify
the failure for a developer. So we don't get much extra from the message, and
we might just as well drop them.
Dropping them makes our code a tiny bit smaller, and most importantly, improves
development experience by making it easy to insert such an assert in the code
without thinking how to phrase the argument.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We recently started making more use of malloc_usable_size() and rely on
it (see the string_erase() story). Given that we don't really support
sytems where malloc_usable_size() cannot be trusted beyond statistics
anyway, let's go fully in and rework GREEDY_REALLOC() on top of it:
instead of passing around and maintaining the currenly allocated size
everywhere, let's just derive it automatically from
malloc_usable_size().
I am mostly after this for the simplicity this brings. It also brings
minor efficiency improvements I guess, but things become so much nicer
to look at if we can avoid these allocation size variables everywhere.
Note that the malloc_usable_size() man page says relying on it wasn't
"good programming practice", but I think it does this for reasons that
don't apply here: the greedy realloc logic specifically doesn't rely on
the returned extra size, beyond the fact that it is equal or larger than
what was requested.
(This commit was supposed to be a quick patch btw, but apparently we use
the greedy realloc stuff quite a bit across the codebase, so this ends
up touching *a*lot* of code.)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
argv[0] might be prefixed by a path, and we shouldn't get confused by
that. Hence provide a simple helper call that abstracts the checking
away, which we can use everywhere, and expose the same behaviour, even
if argv[0] is not set.
(While we are at it, port all other multi-call binaries over to the new
helper, too)
Follow-up for: d41a9e4fc1e1bcdefc8d358da2744a97aac5820a
|