Commit Graph

35077 Commits

Author SHA1 Message Date
Filipe Brandenburger e2d413707f test: use ${builddir}/systemd-runtest.env to set $SYSTEMD_TEST_DATA
This simplifies get_testdata_dir() to simply checking for an environment
variable, with an additional function to locate a systemd-runtest.env file in
the same directory as the test binary and reading environment variable
assignments from that file if it exists.

This makes it possible to:
- Run `ninja test` from the build dir and have it use ${srcdir}/test for
  test unit definitions.
- Run a test directly, such as `build/test-execute` and have it locate
  them correctly.
- Run installed tests (from systemd-tests package) and locate the test
  units in the installed location (/usr/lib/systemd/tests/testdata), in
  which case the absence of the systemd-runtest.env file will have
  get_testdata_dir() use the installed location hardcoded into the
  binaries.

Explicit setting of $SYSTEMD_TEST_DATA still overrides the contents of
systemd-runtest.env.
2018-09-12 09:49:03 -07:00
Filipe Brandenburger 55890a40c3 test: remove support for suffix in get_testdata_dir()
Instead, use path_join() in callers wherever needed.
2018-09-12 09:49:03 -07:00
Zbigniew Jędrzejewski-Szmek 87ead8e298 Set theme jekyll-theme-slate 2018-09-12 11:51:27 +02:00
Yu Watanabe f28255e2d5 bash-completion: systemctl: re-implement __filter_units_by_properties()
This also unifies __filter_units_by_property() and
__filter_units_by_properties(), and makes completion for 'restart',
'reload' or 'stop' show more candidates.
2018-09-12 14:17:22 +09:00
Yu Watanabe eda193578e bus-util: make --property= optionally take value 2018-09-12 12:11:25 +09:00
Michael Biebl 878f2dae77
Merge pull request #10046 from yuwata/fix-10045
test: use installed catalogs when test-catalog is not located at build dir
2018-09-11 23:30:16 +02:00
Dimitri John Ledkov 940bec70bb systemctl: correctly proceed to immediate shutdown if scheduling fails
Actually check the return code from logind_schedule_shutdown() and proceed to
immediate shutdown if that fails. Negative return codes can be returned if
systemctl is compiled without logind support, or if logind otherwise failed
(either too old, disabled/masked, or it is incomplete
systemd-shim/systemd-service implementation).
2018-09-11 10:41:56 +01:00
Yu Watanabe 8aae9a66fa sd-device,libudev: make an argument for *_set_sysattr_value() const 2018-09-11 12:45:21 +09:00
Yu Watanabe 7f9e03952a libudev-monitor: use assert_return() in many places 2018-09-11 12:45:21 +09:00
Yu Watanabe e38242b03a libudev-monitor: add missing error checks in udev_monitor_enable_receiving() 2018-09-11 12:45:21 +09:00
Yu Watanabe a9808d8445 libudev-monitor: introduce udev_monitor_send_sd_device()
And use it in udev_monitor_send_device().
2018-09-11 12:45:21 +09:00
Yu Watanabe 23c457a7fb libudev-monitor: re-implement udev_monitor_receive_sd_device() 2018-09-11 12:45:21 +09:00
Yu Watanabe 759d9f3f8d libudev-monitor: use Hashmap or Set to store filters 2018-09-11 12:45:21 +09:00
Yu Watanabe 5e1e4c247b libudev-monitor: use structured initializer 2018-09-11 12:45:21 +09:00
Yu Watanabe a062a72f1b libudev-monitor: rename monitor_set_nl_address() and make it return negative errno 2018-09-11 12:45:21 +09:00
Yu Watanabe be1791ad6a libudev-monitor: rename udev_has_devtmpfs() and move it to mount-util.c
As the function itself is quite generic.
2018-09-11 12:45:21 +09:00
Yu Watanabe 3d01fa902c libudev-monitor: use structured initializer in bpf_*()
This also drop inline attribute from the functions.
2018-09-11 12:45:21 +09:00
Yu Watanabe 7f79720711 libudev-monitor: use 'unsigned' instead of 'unsigned int' 2018-09-11 12:45:21 +09:00
Yu Watanabe 02e7ae2fdc libudev-device: create sd_device at first in udev_device_new_from_*() 2018-09-11 12:45:21 +09:00
Yu Watanabe a7e9db150b libudev-device: drop prototypes of unexistent functions 2018-09-11 12:45:21 +09:00
Yu Watanabe 536cbd7fa6 libudev: drop a prototype of unexistent function 2018-09-11 12:45:21 +09:00
Yu Watanabe 76387b9abb libudev-device: coding style fixes 2018-09-11 12:45:21 +09:00
Yu Watanabe 33a03e6eff libudev-device: fix return value of udev_device_has_tag() 2018-09-11 12:45:21 +09:00
Yu Watanabe 1b6374d285 libudev-device: use original negative errno 2018-09-11 12:45:21 +09:00
Yu Watanabe 71074e3a10 libudev-device: use structured initializer 2018-09-11 12:45:21 +09:00
Yu Watanabe 60fdee32bd libudev-enumerate: use structured initializer 2018-09-11 12:45:21 +09:00
Yu Watanabe 2b19953a0d libudev-hwdb: use assert_return_errno() 2018-09-11 12:45:21 +09:00
Yu Watanabe 68b80b8557 libudev-hwdb: use structured initializer 2018-09-11 12:45:21 +09:00
Yu Watanabe b485aa5852 libudev-hwdb: drop unused 'struct udev *udev' in udev_hwdb struct 2018-09-11 12:45:21 +09:00
Yu Watanabe f8cdabc0ec libudev-queue: coding style fixes 2018-09-11 12:45:21 +09:00
Yu Watanabe 09f638ebd9 libudev-queue: drop prototypes of nonexistent functions 2018-09-11 12:45:21 +09:00
Yu Watanabe 2dac88a9d1 libudev-queue: use _cleanup_ attribute and TAKE_FD() 2018-09-11 12:45:21 +09:00
Yu Watanabe d35c0e8d53 libudev-queue: use assert_return() 2018-09-11 12:45:21 +09:00
Yu Watanabe ccda7f87f5 libudev-queue: use structured initializer 2018-09-11 12:45:21 +09:00
Yu Watanabe bc54df90e4 libudev: modernize code a bit 2018-09-11 12:45:21 +09:00
Yu Watanabe 5ccb44a53f libudev: use structured initializer 2018-09-11 12:45:21 +09:00
Yu Watanabe 2454727d5a libudev: drop unused element in udev struct 2018-09-11 12:45:21 +09:00
Yu Watanabe ff6f97f0cf libudev: drop outdated comments 2018-09-11 12:45:21 +09:00
Yu Watanabe 3c6ac21929 libudev: use DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC() macro where applicable 2018-09-11 12:45:21 +09:00
Yu Watanabe 50d2158901 libudev-monitor: use safe_close() in udev_monitor_disconnect() 2018-09-11 12:45:21 +09:00
Thomas Haller a507737e5c dhcp: fix assertion starting DHCP client without MAC address (#10054)
An assertion in dhcp_network_bind_raw_socket() is triggered when
starting an sd_dhcp_client without setting a MAC address first.

  - sd_dhcp_client_start()
    - client_start()
      - client_start_delayed()
        - dhcp_network_bind_raw_socket()

In that case, the arp-type and MAC address is still unset. Note that
dhcp_network_bind_raw_socket() already checks for a valid arp-type
and MAC address below, so we should just gracefully return -EINVAL.

Maybe sd_dhcp_client_start() should fail earlier when starting without
MAC address. But the failure here will be correctly propagated and
the start aborted.

Fixes: 76253e73f9
2018-09-11 09:45:47 +09:00
Yu Watanabe d9b6baa699 test: make test-catalog relocatable
Fixes #10045.
2018-09-11 09:19:36 +09:00
Yu Watanabe 8cb10a4f4d test: introduce test_is_running_from_builddir() 2018-09-11 09:17:22 +09:00
Dariusz Gadomski c6d7a5e9a3 hwdb: Update PNP IDs of Goldstar (now: LG Electronics). (#10051)
hwdb: Update PNP IDs of Goldstar (now: LG Electronics)
2018-09-11 00:35:30 +02:00
Franck Bui 03d0f4b58e nspawn: always use mode 555 for /sys
When a network namespace is needed, /sys is mounted as tmpfs (see commit
d8fc6a000f for details).

But in this case mode 755 was used as initial permissions for /sys whereas the
default mode for sysfs is 555.

In practice using 755 doesn't have any impact because /sys is mounted read-only
too but for consistency, let's use the correct mode.

Fixes: #10050
2018-09-11 00:34:00 +02:00
Dimitri John Ledkov cf9cda441a Revert "systemctl: if no logind, don't try to schedule shutdown"
This reverts commit c68867da32.
2018-09-10 19:54:12 +01:00
Dimitri John Ledkov 7f56c3d46e Revert "systemctl: fix compilation w/o logind"
This reverts commit 807690fb7f.
2018-09-10 19:53:59 +01:00
Jürg Billeter da0da5eccf pam_systemd: support use in PID namespaces
Pass 0 as leader PID to CreateSession to let logind use the PID from the
D-Bus credentials. This allows use of pam_systemd in PID namespaces.
2018-09-10 19:04:21 +02:00
Yu Watanabe 2bc54be485 udevadm-util: drop unused function print_version() 2018-09-10 18:27:36 +09:00
Yu Watanabe ee4a776d93 udevadm-info: make info_main() returns negative value on error
Also, this replaces fprintf(stderr, ...) by log_error().
2018-09-10 18:27:36 +09:00