| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise under certain conditions `va_arg()` might get garbage instead
of the expected value, i.e.:
$ sudo build-o0/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 0
Failed to disable unit: Unit file asdfasfaf.service does not exist.
$ sudo build-o1/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 7954875719681572864
Failed to disable unit: Invalid argument
(reproduced on an armv7hl machine)
Resolves: #26568
Follow-up to: bf1bea43f15
Related issue: https://github.com/systemd/systemd/pull/14470#discussion_r362893735
|
|
|
|
|
|
|
|
|
|
|
| |
If the default target is masked, `systemctl get-default` prints
Failed to get default target: Operation not possible due to RF-kill
That's a bit too cryptic, so let's make it clear what's actually
happening.
Fixes #26589.
|
| |
|
|\
| |
| | |
systemctl-list: several cleanups
|
| |
| |
| |
| |
| |
| |
| |
| | |
- Rename struct path_info -> PathInfo,
- Drop struct path_infos,
- Use CLEANUP_ARRAY(),
No functional change, just refactoring.
|
| |
| |
| |
| |
| |
| |
| | |
- Rename struct automount_info -> AutomountInfo,
- use CLEANUP_ARRAY(), and etc.
No functional change, just refactoring.
|
| |
| |
| |
| |
| |
| |
| | |
- Rename struct timer_info -> TimerInfo,
- use CLEANUP_ARRAY().
No functional change, just refactoring.
|
| |
| |
| |
| |
| |
| |
| |
| | |
- Rename struct socket_info -> SocketInfo.
- Drop own_triggered field, and always copy the triggered field.
- Use CLEANUP_ARRAY().
No functional changes, just refactoring.
|
| | |
|
| | |
|
|\ \
| |/
|/| |
Do not say " left" on every timer in LEFT column
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We would print:
NEXT LEFT LAST PASSED UNIT >
Wed 2023-02-22 23:55:00 CET 20min left Wed 2023-02-22 23:25:00 CET 9min ago pmlogger_check.timer >
Wed 2023-02-22 23:55:10 CET 21min left Wed 2023-02-22 23:25:16 CET 8min ago pmlogger_farm_check.timer >
Wed 2023-02-22 23:58:00 CET 23min left Wed 2023-02-22 23:28:02 CET 6min ago pmie_check.timer >
Wed 2023-02-22 23:58:10 CET 24min left Wed 2023-02-22 23:28:11 CET 5min ago pmie_farm_check.timer >
Thu 2023-02-23 00:00:00 CET 25min left Wed 2023-02-22 00:00:10 CET 23h ago logrotate.timer >
Thu 2023-02-23 00:00:00 CET 25min left Wed 2023-02-22 00:00:10 CET 23h ago unbound-anchor.timer >
Thu 2023-02-23 00:08:00 CET 33min left Wed 2023-02-22 00:08:05 CET 23h ago pmie_daily.timer >
Thu 2023-02-23 00:10:00 CET 35min left Wed 2023-02-22 00:10:03 CET 23h ago pmlogger_daily.timer >
Thu 2023-02-23 00:14:14 CET 40min left Wed 2023-02-22 22:35:09 CET 58min ago dnf-makecache.timer >
Thu 2023-02-23 05:05:04 CET 5h 30min left Wed 2023-02-22 03:29:00 CET 20h ago plocate-updatedb.timer >
Thu 2023-02-23 11:34:34 CET 12h left Wed 2023-02-22 11:34:33 CET 11h ago systemd-tmpfiles-clean.timer >
Sun 2023-02-26 01:00:00 CET 3 days left Mon 2023-02-20 07:51:59 CET 2 days ago raid-check.timer >
Mon 2023-02-27 00:19:48 CET 4 days left Mon 2023-02-20 07:51:59 CET 2 days ago fstrim.timer >
Mon 2023-02-27 12:34:36 CET 4 days left Tue 2023-02-21 08:22:14 CET 1 day 15h ago archlinux-keyring-wkd-sync.time>
The "left" part uses precious screen estate and is pretty much implied
by the column name. Drop it.
|
| |
| |
| |
| |
| |
| | |
usec_t is also a uint64_t internally, hence this doesn't actually change
anything. However, on the conceptual level, sd-bus expects a uint64_t
hence give it one.
|
| |
| |
| |
| | |
If the timeout is zero it's not set, let's suppress the output then.
|
| |
| |
| |
| |
| |
| | |
Timespans are probably best right-aligned, in particular if they
systematically end in either " ago" or " left" because they are used as
"relative timestamps".
|
| |
| |
| |
| | |
Fixes #18271
|
|/
|
|
|
|
|
|
| |
Only service and scope units have RuntimeMaxUSec bus property.
To suppress the "Until:" field for other unit types, the entry must be
initialized with USEC_INFINITY.
Fixes #26473.
|
|\
| |
| | |
meson: Use dicts for test/fuzzer definitions
|
| | |
|
|\ \
| |/
|/| |
Add systemctl list-paths
|
| |
| |
| |
| | |
Fixes #6054.
|
| |
| |
| |
| | |
We do it that way in all other list-* functions, so let's be consistent.
|
| | |
|
| | |
|
| |
| |
| |
| | |
It will be used more in subsequent commits.
|
| |
| |
| |
| |
| | |
There is a double free of unit_name when an instance is used, causing
systemctl --user edit service@instance to abort.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
This allows accompanying a signal with a value (as supported for Linux
Realtime signals). This is particularly useful as it allows us to do
stuff like this:
systemctl kill --kill-whom=main --kill-value=0x300 systemd-journald
In order to ask journald to flush its allocation caches and compact
memory.
|
|
|
|
|
| |
We support separate Startup configurations for CPU and I/O, so
add it for memory too. Only cover cgroupsv2 settings.
|
|
|
|
|
|
| |
Meson+ninja+compiler do this for us and are better at it.
https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
|
|
|
|
| |
Follow-up for da20baaeccbcca78350bf64bdc069dec685c95bc.
|
|\
| |
| | |
basic: Add log context
|
| |
| |
| |
| |
| | |
Let's use statement expressions to return values instead of passing
in return arguments to the LIST macros.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A pid can be recycled, but a pidfd is pinned. Add a new method that is safer
as it takes a pidfd as input.
Return not only the D-Bus object path, but also the unit id and the last
recorded invocation id, as they are both useful (especially the id, as
converting from a path object to a unit id from a script requires another
round-trip via D-Bus).
Note that the manager still tracks processes by pid, so theorethically this
is not fully error-proof, but on the other hand the method response is
synchronous and the manager is single-threaded, so once a call is being
processed the unit database will not change anyway. Once the manager
switches to use pidfds everywhere, this can be further hardened.
|
| |
| |
| |
| | |
Closes #25975
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Follow-up for 0f958c8d4fc13ed1c1af928b2a7d91d31c7576eb.
systemctl is called many times by dnf or so, and missing /proc/ is not
a user's fault, but package manager's issue.
With this commit, we can suppress the warning by updating rpm macros if
necessary.
|
|/ |
|
|
|
|
| |
Closes #25856
|
|
|
|
|
|
|
| |
If less than three parameters are passed a simple comparison is the
better choice.
Lo and behold this found two pretty bad typos.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously 'systemctl edit' would only operate on
'override.conf', but users may need more than that.
Thus the new option '--drop-in' is added to allow
users to specify the drop-in file name.
Closes #25767
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-1 was used everywhere, but -EBADF or -EBADFD started being used in various
places. Let's make things consistent in the new style.
Note that there are two candidates:
EBADF 9 Bad file descriptor
EBADFD 77 File descriptor in bad state
Since we're initializating the fd, we're just assigning a value that means
"no fd yet", so it's just a bad file descriptor, and the first errno fits
better. If instead we had a valid file descriptor that became invalid because
of some operation or state change, the other errno would fit better.
In some places, initialization is dropped if unnecessary.
|
| |
|
| |
|
| |
|
| |
|