summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* device: simplify device_found_to_string_many() a tiny bitLennart Poettering2018-06-071-3/+2
| | | | | No need to maintain a NULL marker at the end of the table if we know the size of the array anyway.
* core: add a new unit method "catchup()"Lennart Poettering2018-06-073-11/+47
| | | | | | | | | | | | 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.
* core: use safe_fclose() where appropriateLennart Poettering2018-06-071-2/+1
|
* core: split out early-boot preset logic into a function of its ownLennart Poettering2018-06-071-13/+24
|
* udev: add helper udev_device_new_from_stat_rdev()Lennart Poettering2018-06-075-22/+50
| | | | | | 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.
* core: split out device validation from device_found_node()Lennart Poettering2018-06-071-38/+58
| | | | | | | Let's separate the validate step out. Also, let's update some comments which have long ceased to be true. No change in behaviour.
* core: rework device_found_node() prototypeLennart Poettering2018-06-074-33/+33
| | | | | | | | | | | | | | 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.
* core: split out reload propagation into its own functionLennart Poettering2018-06-071-14/+20
|
* core: improve error logging a bitLennart Poettering2018-06-071-8/+18
|
* core: split out bus initialization from manager_setup()Lennart Poettering2018-06-071-14/+21
|
* core: log when unit_add_dependency() fails for some reasonLennart Poettering2018-06-071-3/+2
| | | | Also, proceed, as there's little we can do in this case.
* core: modernize device_update_description() a bitLennart Poettering2018-06-071-7/+6
|
* core: use device_found_to_string_many() result only on successLennart Poettering2018-06-071-2/+2
|
* core: use FLAGS_SET() macro at one more placeLennart Poettering2018-06-071-1/+1
|
* core: modernize device_set_sysfs() a bitLennart Poettering2018-06-071-4/+2
|
* hwdb: HP ZBook Studio G4 wireless switchAlessandro Casale2018-06-071-0/+4
|
* man: update url to latest 802.1AB (2016) standardStefan Schweter2018-06-071-1/+1
|
* Merge pull request #9208 from keszybz/async-callback-memleakLennart Poettering2018-06-0750-440/+381
|\ | | | | Async callback memleak fix and documentation cleanups
| * test-bus-util: add a test for destroy callbacksZbigniew Jędrzejewski-Szmek2018-06-061-0/+43
| |
| * shared/bus-util: use the new cleanup functionality to avoid a memleakZbigniew Jędrzejewski-Szmek2018-06-061-11/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * bus: optionally call a callbacks for cleanupZbigniew Jędrzejewski-Szmek2018-06-067-0/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * man: also mention EINVAL in sd_bus_slot_set_floating(3)Zbigniew Jędrzejewski-Szmek2018-06-061-1/+7
| |
| * test-bus-util: add a simple test for bus_request_name_async_may_reload_dbus()Zbigniew Jędrzejewski-Szmek2018-06-062-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * bus-util: avoid unneeded initalization to zeroZbigniew Jędrzejewski-Szmek2018-06-061-4/+6
| |
| * man: xinclude the generic text to talk about libsystemd pkgconfigZbigniew Jędrzejewski-Szmek2018-06-0641-424/+87
| | | | | | | | | | | | | | 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.
* | Merge pull request #9214 from poettering/systemctl-get-processes-fixLennart Poettering2018-06-072-2/+2
|\ \ | | | | | | two small fixes for systemctl's process tree display
| * | pid: fix ENOENT error checkLennart Poettering2018-06-061-1/+1
| | |
| * | systemctl: when GetProcesses() doesn't work, say for which unitLennart Poettering2018-06-061-1/+1
| |/
* | hwdb: Logitech Anywhere MX wheel data (#9203)Ivan Shapovalov2018-06-071-0/+5
| |
* | Merge pull request #9201 from poettering/integration-test-unfuckZbigniew Jędrzejewski-Szmek2018-06-065-2/+7
|\ \ | |/ |/| make the integration tests great again
| * test: turn off the kernel's passive agressive /dev/kmsg ratelimit for our testsLennart Poettering2018-06-061-0/+1
| |
| * test: make sure output of test TEST-03 test service ends up on consoleLennart Poettering2018-06-062-1/+3
| |
| * test: disable QEMU based testing for TEST-16-EXTEND-TIMEOUTLennart Poettering2018-06-062-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * tests: tighten check for TEST-06-SELINUX dependencies a bitLennart Poettering2018-06-061-1/+1
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #9212 from keszybz/null-removal-part-twoLennart Poettering2018-06-063-6/+5
|\ \ | | | | | | Small follow-up to log_struct NULL removal
| * | resolved: reformat message about a revoked trust anchorZbigniew Jędrzejewski-Szmek2018-06-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Remove NULL terminator from two log_struct callsZbigniew Jędrzejewski-Szmek2018-06-062-4/+2
| | | | | | | | | | | | Fixup for a1230ff972. I forgot to press "save" ;(
* | | Merge pull request #9197 from poettering/make-main-shorterZbigniew Jędrzejewski-Szmek2018-06-067-106/+138
|\ \ \ | |/ / |/| | some smaller changes to make PID1's main() a bit shorter
| * | main: combine a some if checksLennart Poettering2018-06-061-65/+61
| | | | | | | | | | | | | | | | | | Let's merge a few if blocks that are conditioned out the same way. No change in behaviour.
| * | main: use rlimit_free_all() at one more placeLennart Poettering2018-06-061-4/+1
| | |
| * | core: comment verbosely what the difference betweem set_manager_settings() ↵Lennart Poettering2018-06-061-0/+8
| | | | | | | | | | | | and set_manager_defaults() is
| * | util: add new write_string_filef() helperLennart Poettering2018-06-064-22/+30
| | | | | | | | | | | | | | | This new helper combines asprintf() and write_string_file() in one, which is useful at various places to shorten the code a bit.
| * | main: split out reading of /proc/sys/fs/nr_open into its own functionLennart Poettering2018-06-064-15/+38
|/ / | | | | | | | | 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.
* | man: add example for sd_event_add_inotifyZbigniew Jędrzejewski-Szmek2018-06-062-0/+66
| |
* | Merge pull request #9210 from poettering/use-delete-trailing-charsZbigniew Jędrzejewski-Szmek2018-06-062-19/+3
|\ \ | | | | | | make use of delete_trailing_chars() more
| * | string-util: put together strstrip() from skip_leading_chars() and ↵Lennart Poettering2018-06-061-13/+2
| | | | | | | | | | | | delete_trailing_chars()
| * | process-util: make use of delete_trailing_chars() in get_process_cmdline()Lennart Poettering2018-06-061-6/+1
| | |
* | | Merge pull request #9121 from poettering/sd-event-inotifyZbigniew Jędrzejewski-Szmek2018-06-0622-94/+1437
|\ \ \ | | | | | | | | add "sd_event_add_inotify()" and use it for making PID 1 rescheduler .timer units properly on timezone change
| * | | update TODOLennart Poettering2018-06-061-6/+3
| | | |
| * | | sd-event: use structure initialization instead of new0() where possibleLennart Poettering2018-06-061-17/+38
| | | |