| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
No need to maintain a NULL marker at the end of the table if we know the
size of the array anyway.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is very similar to the existing unit method coldplug() but is
called a bit later. The idea is that that coldplug() restores the unit
state from before any prior reload/restart, i.e. puts the deserialized
state in effect. The catchup() call is then called a bit later, to
catch up with the system state for which we missed notifications while
we were reloading. This is only really useful for mount, swap and device
mount points were we should be careful to generate all missing unit
state change events (i.e. call unit_notify() appropriately) for
everything that happened while we were reloading.
|
| |
|
| |
|
|
|
|
|
|
| |
This is a simple wrapper around udev_device_new_from_devnum(), and uses
the data from a struct stat's .st_rdev field to derive the udev_device
object.
|
|
|
|
|
|
|
| |
Let's separate the validate step out. Also, let's update some comments
which have long ceased to be true.
No change in behaviour.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
let's drop the "now" argument, it's exactly what MANAGER_IS_RUNNING()
returns, hence let's use that instead to simplify things.
Moreover, let's change the add/found argument pair to become found/mask,
which allows us to change multiple flags at the same time into opposing
directions, which will be useful later on.
Also, let's change the return type to void. It's a notifier call where
callers will ignore the return value anyway as it is nothing actionable.
Should not change behaviour.
|
| |
|
| |
|
| |
|
|
|
|
| |
Also, proceed, as there's little we can do in this case.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Async callback memleak fix and documentation cleanups
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the async callbacks didn't get a chance to finish properly, we'd leak
memory.
The output from test-bus-util with additional log line in the callbacks to show
what is happening:
$ build/test-bus-util
/* test_name_async (0) */
Bus test-bus: changing state UNSET → OPENING
Bus test-bus: changing state OPENING → AUTHENTICATING
Bus test-bus: changing state AUTHENTICATING → HELLO
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=2 reply_cookie=0 signature=su error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.732 path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=1 signature=s error-name=n/a error-message=n/a
Bus test-bus: changing state HELLO → RUNNING
Bus test-bus: changing state RUNNING → CLOSED
request_name_destroy_callback n_ref=1
/* test_name_async (20) */
Bus test-bus: changing state UNSET → OPENING
Bus test-bus: changing state OPENING → AUTHENTICATING
Bus test-bus: changing state AUTHENTICATING → HELLO
stage 0: sd_bus_process returned 1
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=2 reply_cookie=0 signature=su error-name=n/a error-message=n/a
stage 1: sd_bus_process returned 1
Got message type=method_return sender=org.freedesktop.DBus destination=:1.733 path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=1 signature=s error-name=n/a error-message=n/a
Bus test-bus: changing state HELLO → RUNNING
stage 2: sd_bus_process returned 1
Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=4294967295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
stage 3: sd_bus_process returned 1
Got message type=signal sender=org.freedesktop.DBus destination=:1.733 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=4294967295 reply_cookie=0 signature=s error-name=n/a error-message=n/a
stage 4: sd_bus_process returned 1
Got message type=error sender=org.freedesktop.DBus destination=:1.733 path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=2 signature=s error-name=org.freedesktop.DBus.Error.AccessDenied error-message=Request to own name refused by policy
Unable to request name, will retry after reloading DBus configuration: Request to own name refused by policy
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=ReloadConfig cookie=3 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
request_name_destroy_callback n_ref=2
stage 5: sd_bus_process returned 1
Got message type=method_return sender=org.freedesktop.DBus destination=:1.733 path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=3 signature= error-name=n/a error-message=n/a
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=4 reply_cookie=0 signature=su error-name=n/a error-message=n/a
request_name_destroy_callback n_ref=1
stage 6: sd_bus_process returned 1
Got message type=error sender=org.freedesktop.DBus destination=:1.733 path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=4 signature=s error-name=org.freedesktop.DBus.Error.AccessDenied error-message=Request to own name refused by policy
Unable to request name, failing connection: Request to own name refused by policy
Bus test-bus: changing state RUNNING → CLOSING
stage 7: sd_bus_process returned 1
Bus test-bus: changing state CLOSING → CLOSED
stage 8: sd_bus_process returned 1
stage 9: sd_bus_process returned -104
Processing failed: Connection reset by peer
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds a function sd_bus_slot_set_destroy_callback() to set a function
which can free userdata or perform other cleanups.
sd_bus_slot_get_destory_callback() queries the callback, and is included
for completeness.
Without something like this, for floating asynchronous callbacks, which might
be called or not, depending on the sequence of events, it's hard to perform
resource cleanup. The alternative would be to always perform the cleanup from
the caller too, but that requires more coordination and keeping of some shared
state. It's nicer to keep the cleanup contained between the callback and the
function that requests the callback.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This shows a minor memleak:
==1883== 24 bytes in 1 blocks are definitely lost in loss record 1 of 1
==1883== at 0x4C2DBAB: malloc (vg_replace_malloc.c:299)
==1883== by 0x4E9D385: malloc_multiply (alloc-util.h:69)
==1883== by 0x4EA2959: bus_request_name_async_may_reload_dbus (bus-util.c:1841)
==1883== by ...
The exchange of messages is truncated at two different points: once right
after the first callback is requested, and the second time after the full
sequence has run (usually resulting in an error because of policy).
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
The only difference is that functions are not individually listed by name,
but that seems completely pointless, since all functions that are documented
are always exported, so the generic text tells the user all she or he needs
to know.
|
|\ \
| | |
| | | |
two small fixes for systemctl's process tree display
|
| | | |
|
| |/ |
|
| | |
|
|\ \
| |/
|/| |
make the integration tests great again
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The test is heavily dependent on timeouts, and if we are run in
potentially very slow QEMU instances there's a good chance we'll miss
some which we normally wouldn't miss. Hence, let's test this one in
nspawn only. Given that the test is purely in service management it
shouldn't matter whether it runs in nspawn or qemu, hence keep running
it in nspawn, but don't bother with qemu.
Similar, do this for TEST-03-JOBS, too, which operates with relatively
short sleep times internally.
Fixes: #9123
|
| |
| |
| |
| |
| |
| |
| |
| | |
As it turns out /usr/share/selinux/devel/ is now included in more RPMs
than just selinux-policy-devel (specifically container-selinux, which is
pulled in by various container related RPMs). Let's hence tighten the
dependency check a bit and look for systemd's .if file, which is what we
actually care about.
|
|\ \
| | |
| | | |
Small follow-up to log_struct NULL removal
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
LOG_MESSAGE is just a wrapper, but it keeps the arguments indented together
with the format string, so put the argument inside of the macro invocation.
(No functional change.)
Also use lowercase for "trust anchor" — it should either be all capitaled or not
at all, and it's not a proper name, so let's make it all lowercase.
Also, add a newline, to make the string more readable. "%s" can expand to
something that is quite long.
|
| | |
| | |
| | |
| | | |
Fixup for a1230ff972. I forgot to press "save" ;(
|
|\ \ \
| |/ /
|/| | |
some smaller changes to make PID1's main() a bit shorter
|
| | |
| | |
| | |
| | |
| | |
| | | |
Let's merge a few if blocks that are conditioned out the same way.
No change in behaviour.
|
| | | |
|
| | |
| | |
| | |
| | | |
and set_manager_defaults() is
|
| | |
| | |
| | |
| | |
| | | |
This new helper combines asprintf() and write_string_file() in one,
which is useful at various places to shorten the code a bit.
|
|/ /
| |
| |
| |
| | |
This doesn't really reduce the code size over all, but it does make main.c
shorter and more readable, and that's always a good thing.
|
| | |
|
|\ \
| | |
| | | |
make use of delete_trailing_chars() more
|
| | |
| | |
| | |
| | | |
delete_trailing_chars()
|
| | | |
|
|\ \ \
| | | |
| | | | |
add "sd_event_add_inotify()" and use it for making PID 1 rescheduler .timer units properly on timezone change
|
| | | | |
|
| | | | |
|