| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
in the output
"systemctl status systemd-logind" otherwise looks a bit weird, since the
tasks and the fdstore lines are so close to each other but formatted
quite differently when it comes to coloring.
|
|
|
|
|
|
|
|
|
| |
schedule one
The previous behavior of systemctl --when= seems absurd, i.e.
if we fail to schedule shutdown in the future it's performed
immediately. Let's instead hard fail, which also removes the need
of specializing on certain errnos (preparation for later commits).
|
| |
|
|\
| |
| | |
logind: drop new delay-weak inhibitor
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The change was supposed to be about respecting inhibitors, but
it was extended to also error out when there are active user
sessions, which was not intentional. Previously systemctl skipped
all checks if the caller was root or root-equivalent. Restore the
previous behaviour and again avoid blocking systemctl reboot by root
if there are active sessions, as long as there are no active
inhibitors.
Fixes https://github.com/systemd/systemd/issues/34086
Follow-up for 804874d26ac73e0af07c4c5d7165c95372f03f6d
|
|\ \
| | |
| | | |
Various logging improvements
|
| | |
| | |
| | |
| | |
| | | |
Let's log about which bus we're trying to connect to and what transport
we're using to do it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Just for readability.
Before:
$ build/systemctl status -n 0 systemd-networkd.service | grep Memory:
Memory: 4.7M (peak: 14.3M swap: 1M swap peak: 1.1M)
After:
$ build/systemctl status -n 0 systemd-networkd.service | grep Memory:
Memory: 4.7M (peak: 14.3M, swap: 1M, swap peak: 1.1M)
|
|\ \ \
| | | |
| | | | |
Add ExtraFileDescriptor property to StartTransientUnit dbus API
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This adds the ExtraFileDescriptor property to StartTransient dbus API
with format "a(hs)" - array of (file descriptor, name) pairs. The FD
will be passed to the unit via sd_notify like Socket and OpenFile.
systemctl show also shows ExtraFileDescriptorName for these transient
units. We only show the name passed to dbus as the FD numbers will
change once passed over the unix socket and are duplicated, so its
confusing to display the numbers.
We do not add this functionality for systemd-run or general systemd
service units as it is not useful for general systemd services.
Arguably, it could be useful for systemd-run in bash scripts but we
prefer to be cautious and not expose the API yet.
Fixes: #34396
|
|/ / |
|
|\ \
| | |
| | | |
systemctl: also show job id in status output
|
| | |
| | |
| | |
| | | |
Prompted by one ASG talk ;)
|
| | | |
|
|/ /
| |
| |
| |
| |
| | |
The type is a(ss), so a custom printer is required.
Fixes https://github.com/systemd/systemd/issues/33967.
|
| | |
|
|/
|
| |
The error code `r` from the read function is being logged, but the error code `rc` from the table data insertion function should be logged instead.
|
|\
| |
| | |
handle gmtime_r() errors more robustly
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
| |
The identifier 'stdin' is reserved in C. It can be #defined to any
statement that evaluates to a FILE*. We do not want that for our field,
so change to a more descriptive name.
|
|
|
|
|
| |
We are eating the error message if `--force` is set, so do not return
a non-zero exit code either.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These operations might require slow I/O, and thus might block PID1's main
loop for an undeterminated amount of time. Instead of performing them
inline, fork a worker process and stash away the D-Bus message, and reply
once we get a SIGCHILD indicating they have completed. That way we don't
break compatibility and callers can continue to rely on the fact that when
they get the method reply the operation either succeeded or failed.
To keep backward compatibility, unlike reload control processes, these
are ran inside init.scope and not the target cgroup. Unlike ExecReload,
this is under our control and is not defined by the unit. This is necessary
because previously the operation also wasn't ran from the target cgroup,
so suddenly forking a copy-on-write copy of pid1 into the target cgroup
will make memory usage spike, and if there is a MemoryMax= or MemoryHigh=
set and the cgroup is already close to the limit, it will cause an OOM
kill, where previously it would have worked fine.
|
|
|
|
| |
which combines sigbus_install() and bumping fd limit.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--boot-loader-entry=help
This fixes the following assertion:
===
SYSTEMD_LOG_LEVEL=debug systemctl --user -H foo --boot-loader-entry=help
Assertion 'transport != BUS_TRANSPORT_REMOTE || runtime_scope == RUNTIME_SCOPE_SYSTEM' failed at src/shared/bus-util.c:284, function bus_connect_transport(). Ignoring.
Failed to connect to bus: Operation not supported
===
Fixes a bug introduced by 97af80c5a7029c3f92e982dcf9338b9e67ad9cde.
Fixes #33661.
Fixes oss-fuzz#70153.
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the following assertion:
===
systemctl --capsule=hoge --system reboot
Assertion 'runtime_scope == RUNTIME_SCOPE_USER' failed at src/shared/bus-util.c:479, function bus_connect_transport(). Aborting.
Aborted (core dumped)
===
Follow-up for 56cb74c3cd1358d7d0b3f613feaf2eeab601a6bd.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently inhibitors are bypassed unless an explicit request is made to
check for them, or even in that case when the requestor is root or the
same uid as the holder of the lock.
But in many cases this makes it impractical to rely on inhibitor locks.
For example, in Debian there are several convoluted and archaic
workarounds that divert systemctl/reboot to some hacky custom scripts
to try and enforce blocking accidental reboots, when it's not expected
that the requestor will remember to specify the command line option
to enable checking for active inhibitor locks.
Also in many cases one wants to ensure that locks taken by a user are
respected by actions initiated by that same user.
Change logind so that inhibitors checks are not skipped in these
cases, and systemctl so that locks are checked in order to show a
friendly error message rather than "permission denied".
Add new block-weak and delay-weak modes that keep the previous
behaviour unchanged.
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
| |
Also, instead of silently continuing when template units
are specified with enable --now, print a warning and skip them.
Closes #31541
|
|
|
|
|
|
| |
- Drop one more use of basename()
- Clean up logging in normalize_*()
- Use assertions where appropriate
|
| |
|
| |
|
|\
| |
| | |
Allow interactive auth in inhibit
|
| |
| |
| |
| |
| | |
The functions in the file were *not* using the spawn prefix,
and the prefix seems completely unnecessary.
|
| |
| |
| |
| |
| | |
The functions in the file were *not* using the spawn prefix,
and the prefix seems completely unnecessary.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update frameworks that work automatically in the background
occasionally need to schedule reboots. Systemd-logind already
provides a nice mechanism to schedule shutdowns, send notfications
and block logins short before the time. Systemd has a framework for
calendar events, so we may conveniently use logind to define a
maintenance time for reboots.
The existing ScheduleShutdown DBus method in logind expects a usec_t
with an absolute time. Passing USEC_INFINITY as magic value now tells
logind to take the time from the configured maintenance time if set.
"shutdown -r" leverages that and uses the maintenance time
automatically if configured. The one minute default is still used if
nothing was specified.
Similarly the new 'auto' setting for the --when parameter of systemctl
uses the maintenance time if configured or a one minute timer like the
shutdown command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The rest of the basename()s are easy to drop.
|
|
|
|
| |
Fixes #32837.
|
|
|
|
|
| |
It is always equivalent to getuid(). Let's call getuid() in the
function instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow-up for f380473edfa899706d630bb64750ab50c5c04961
This cleans up the code a bit. Also, before this commit,
if MemoryAvailable is set but show_memory_available
is false, and we have nothing else to output, empty
parenthesis is shown. This can be easily reproduced
on -.slice:
> systemctl status -- -.slice
> ...
> Memory: 1.8G ()
> ...
|
|
|
|
|
|
|
|
| |
In the majority of cases, this is caused by
sleep_supported() returning error. Hence it's
very likely that it would fail again, so
the fallback is not really useful. Instead,
honor the --force option for these verbs.
|
|
|
|
|
|
| |
friends
Fixes #32599.
|
|
|
|
|
|
| |
TEST-26-SYSTEMCTL is racy as we call systemctl is-active immediately
after systemctl kill. Let's implement --wait for systemctl kill and
use it in TEST-26-SYSTEMCTL to avoid the race.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current output of 'systemctl list-jobs' with the --after and/or --before
switches seems backwards. With artificial units
# check-oil.service
[Unit]
Description=Check the oil level
Before=engine-ready.target
# fill-gas.service
[Unit]
Description=Fill the tank with gasoline
Before=engine-ready.target
# engine-ready.target
[Unit]
Description=The engine is ready
[Unit]
Description=Start the engine!
After=engine-ready.target
Wants=engine-ready.target
running 'systemctl list-jobs --before --after' produces
JOB UNIT TYPE STATE
93 check-oil.service start running
└─ waiting for job 94 (engine-ready.target/start) - -
102 fill-gas.service start running
└─ waiting for job 94 (engine-ready.target/start) - -
94 engine-ready.target start waiting
└─ waiting for job 111 (start-engine.service/start) - -
└─ blocking job 93 (check-oil.service/start) - -
└─ blocking job 102 (fill-gas.service/start) - -
111 start-engine.service start waiting
└─ waiting for job 1 (multi-user.target/start) - -
└─ blocking job 94 (engine-ready.target/start) - -
Obviously, job 93 is not waiting for job 94, but rather blocking it.
|
|\
| |
| | |
pid1: send shutdown type and reboot argument to supervisor via sd_notify()
|
| |
| |
| |
| |
| |
| |
| | |
reboots
This doesn't hurt anyway, and is useful now that we propagate the string
via sd_notify() too.
|
| |
| |
| |
| | |
Follow-up for: afba41995de65d8f378b138ea6d9804be32625a3
|