Commit Graph

35319 Commits

Author SHA1 Message Date
Lennart Poettering 42d0958195 update TODO 2018-10-08 18:49:45 +02:00
Lennart Poettering 787dfb82f5 portabled: generate a more useful error when invalid image types are attempted to be attached
Fixes: #10095
2018-10-08 18:49:45 +02:00
Lennart Poettering b281b12105 sd-bus: add three missing entries from bus-common.c that are listed in the .h file 2018-10-08 18:49:45 +02:00
Lennart Poettering 80f39b81f3 portable: move portablectl to /usr/bin
Let's declare this a supported API. After all feedback I got at
conferences I think we are good to consider this stable now and make it
official API.
2018-10-08 18:49:45 +02:00
Lennart Poettering d09d85a2a0 portable: create/remove the 'attached' unit file directory when we can
Let's not litter the system with this unit directory unnecessarily, and
let's try to create/remove it when necessary.
2018-10-08 18:49:45 +02:00
Lennart Poettering 2ace445da7 man: explain the two search paths in the SYNOPSIS with a header 2018-10-08 18:49:45 +02:00
Lennart Poettering 83f72cd65f man,docs: document the new unit file directory for attached images 2018-10-08 18:49:45 +02:00
Lennart Poettering 339731dba1 portable: properly handle if the unit file directory for portable service images doesn't exist
if the dir doesn#t exist then let's consider this indication for "this
image isn't attached".
2018-10-08 18:49:45 +02:00
Lennart Poettering 40a7b232de portable: make use of the new unit file path
Note that this breaks compatibility with older versions, as the detach
code won't find unit files attached with older releases anymore. But
given that the portable service logic was not deemed stable so far, and
this was explicitly documented and enforced through portablectl's
installation to /usr/lib/systemd/ such a compat breakage should be fine.
2018-10-08 18:49:45 +02:00
Lennart Poettering 0cd4628de9 path-lookup: define explicit unit file directory for attached unit files
Let's separate out the unit files copied from attached portable service
image files from the admin's own files. Let's introduce
/etc/systemd/system.attached/ + /run/systemd/system.attached/ for the
files of portable services, and leave /etc/systemd/system/ and
/run/systemd/system/ for the admin.
2018-10-08 18:49:45 +02:00
Lennart Poettering 61c22b0be6 path-lookup: TAKE_PTRify more things 2018-10-08 18:49:45 +02:00
Zbigniew Jędrzejewski-Szmek ef07c97b0f
Merge pull request #10281 from yuwata/follow-up-10277
meson: add more compile tests
2018-10-08 18:42:47 +02:00
Yu Watanabe 56f56d5ad8 meson: use c_args in generator scripts (#10289)
May be useful in some cases.
2018-10-08 18:37:06 +02:00
Lennart Poettering 1099ceebce nspawn: optionally don't mount a tmpfs over /tmp (#10294)
nspawn: optionally, don't mount a tmpfs on /tmp

Fixes: #10260
2018-10-08 18:32:03 +02:00
Michael Olbrich b9fa9b71c6 meson: only build src/shared/tests.c if tests are enabled
It's only needed for tests and leaks build directories into
libsystemd-shared.
2018-10-08 18:29:36 +02:00
Yu Watanabe aacd352d8c libsystemd: drop *_unrefp from symbol list
Follow-up for 3f608087bd and
6083c4b763.
2018-10-08 18:28:58 +02:00
Ray Strode ad1bf59c67 logind: ensure seat0 CanGraphical state is written
For non-`seat0` seats, attaching a graphics card to a seat can
lead to it getting created. This is because the graphics device
is a "master device" which means that device is a seat-defining
device.

`seat0` may get created, even before the graphics driver is loaded,
though. This is because the graphics driver is loaded
asynchronously at startup, and `seat0` is the primary seat of
system, associated with the system VTs.

When a graphics card is attached to a seat the `CanGraphical`
property on that seat will flip to `true`.

For seats that haven't been created yet (non-`seat0` seats), this
leads to `seat_start` getting called which ultimately causes the
seat to get serialized to `/run/systemd/seats`.

For `seat0`, which is already created, `seat_start` will return
immediately, which means the updated `CanGraphical` state will
never get written to `/run/systemd/seats`.

The end result is that clients querying `sd_seat_can_graphical`
won't get the correct answer for `seat0` in cases where the
graphics device takes a long time to load until some other peice
of seat state is updated.

This commit fixes the problem by calling `seat_save` explicitly
for already running seats at the time a graphics device is
attached.
2018-10-06 16:52:48 +02:00
Yu Watanabe dcf0b8a5be
Merge pull request #10293 from poettering/cryptsetup-fixes
two tiny cryptsetup-generator fixes
2018-10-06 23:35:28 +09:00
Lennart Poettering e3ca6580ae cryptsetup: use PATH_IN_SET() instead of STR_IN_SET() when comparing paths
It's formally more correct.
2018-10-05 22:39:02 +02:00
Lennart Poettering 2abe64666e cryptsetup: don't use %m if there's no error to show
We are not the ones receiving an error here, but the ones generating it,
hence we shouldn't show it with %m, that's just confusing, as it
suggests we received an error from some other call.
2018-10-05 22:37:58 +02:00
Thomas Haller afbae3e9f2 path-util: fix path_simplify() with kill_dots and "."
Previously, together with kill_dots true, patch like
".", "./.", ".//.//" would all return an empty string.

That is wrong. There must be one "." left to reference
the current directory.

Also, the comment with examples was wrong.
2018-10-05 21:41:33 +02:00
Yu Watanabe c250bf671b core/dbus-execute: fix parsing CPUScheduling* and Nice for transient services
Fixes #10290.
2018-10-05 21:41:05 +02:00
Frank Schaefer 14ee72b7d8 * hack around deficiencies in prctl() PR_SET_MM_* 2018-10-05 21:40:41 +02:00
Lennart Poettering ad191df836
Merge pull request #10134 from keszybz/test-runner
Some test-related fixed and a test runner for installed tests
2018-10-05 20:35:30 +02:00
Yu Watanabe 8a89c5392d man: fix explanation about UID/GID field in tmpfiles.d(5)
Fixes #9495.
2018-10-05 19:06:10 +02:00
Lennart Poettering dacd723620
Merge pull request #10117 from keszybz/undynamicify
Set DynamicUser=no for networkd, resolved, timesyncd
2018-10-05 17:41:56 +02:00
Alan Jenkins 923f910115 man/systemd.exec: MountFlags=shared behaviour was changed (fixed?)
The behaviour described *was* observed on Fedora 28
(systemd-238-9.git0e0aa59), with and without SELinux.  I don't actually
know why though!  It contradicts my understanding of the code, including an
explicit comment in the code.

Testing in a VM upgraded to v239-792-g1327f272d, this behaviour goes away.


Test case:

# /etc/systemd/system/mount-test.service
[Service]
MountFlags=shared
Type=oneshot
ExecStart=/usr/bin/ls -l /proc/1/ns/mnt /proc/self/ns/mnt
ExecStart=/usr/bin/grep ext4 /proc/self/mountinfo


Weird old behaviour: new mount namespace but / is fully shared.

lrwxrwxrwx. 1 root root 0 Sep 14 11:18 /proc/1/ns/mnt -> mnt:[4026531840]
lrwxrwxrwx. 1 root root 0 Sep 14 11:48 /proc/self/ns/mnt ->
mnt:[4026532851]

968 967 253:0 / / rw,relatime shared:1 - ext4 /dev/mapper/alan_dell_2016...


Current behaviour: / is not fully shared

lrwxrwxrwx. 1 root root 0 Sep 14 11:39 /proc/1/ns/mnt -> mnt:[4026531840]
lrwxrwxrwx. 1 root root 0 Sep 14 11:41 /proc/self/ns/mnt ->
mnt:[4026532329]

591 558 8:3 / / rw,relatime shared:313 master:1 - ext4 /dev/sda3 rw,secl...
2018-10-05 17:38:38 +02:00
Lennart Poettering 334415b16e
Merge pull request #10094 from keszybz/wants-loading
Fix bogus fragment paths in units in .wants/.requires
2018-10-05 17:36:31 +02:00
Lennart Poettering 083d27b654
Merge pull request #10152 from yuwata/udev-use-extract
udev: small cleanups
2018-10-05 17:11:43 +02:00
Patrik Flykt aabcb75409 networkd-link: Don't start a DHCPv6 informational exchange automatically
When a link is configured, wait until there is a Router Advertisement before
attempting to start DHCPv6. The intended DHCPv6 mode will be evaluated in
ndisc_router_handler() in networkd-ndisc.c.
2018-10-05 16:58:06 +02:00
Yu Watanabe 35f2cb2841 sd-resolve: make struct addrinfo defined 2018-10-05 17:09:26 +09:00
Yu Watanabe d6263ee4d5 meson: also run compile tests for not installed systemd headers
Follow-up for b62f900866 (#10277).
2018-10-05 17:08:10 +09:00
Yu Watanabe e913b7988f
test-execute: add a test for systemcall filter (#10273)
This adds a test for issue #9939 which is fixed by
a5404992cc (#9942).
2018-10-05 14:46:30 +09:00
Yu Watanabe 30782b4396 sd-netlink: sort headers and include net/ethernet.h 2018-10-05 14:27:32 +09:00
Thomas Haller b62f900866 dhcp6: don't include internal header "sparse-endian.h" in "sd-dhcp6-client.h"
Arguably, libsystemd-network is (still) entirely internal API.
However there is the aim of maybe exposing it as public API.
For that reason, it cannot include internal headers from
"src/basic/".

Note how files "src/systemd/sd-*.h" don't include any systemd
headers which don't themself have an "sd-" prefix.

Fixes: d89a400ed6
2018-10-04 21:29:35 +02:00
Stephen Gallagher a3e0bba8a9 Add DOCUMENTATION_URL as a standard value for /etc/os-release
It is very useful for distributions to be able to set a primary
documentation URL in a standard location so that users and
applications on the system can identify it. For example, many
headless systems these days use the "Cockpit" admin console. It
would be ideal if we could specify this location directly in the
os-release file so that any application or service could have a
well-known location for retrieving this and displaying it
appropriately. Users could likewise examine /etc/os-release to
learn this location.

Related: https://github.com/cockpit-project/cockpit/issues/10198

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2018-10-04 21:29:18 +02:00
Lennart Poettering 880512fe6a
Merge pull request #10263 from keszybz/test-fs-util-generalization
test-fs-util generalization
2018-10-04 13:23:41 +02:00
Yu Watanabe b81b9d406d test: fix memleak in test-fs-util
Fixes #10267 and CID#1395997.
2018-10-04 16:24:44 +09:00
Zbigniew Jędrzejewski-Szmek 2796485404 test-fs-util: run all tests on the specified directory
This removes $RENAME_NOREPLACE_DIR and uses a command-line argument instead.
Logging is added, and tests are skipped if we get -EPERM or friends
(which happens on FAT and other filesystems).
2018-10-04 16:18:58 +09:00
Zbigniew Jędrzejewski-Szmek 7158b4b3fc test-fs-util: simplify testdir creation 2018-10-03 13:42:08 +02:00
Zbigniew Jędrzejewski-Szmek 9a21d8b9fd
Merge pull request #10251 from poettering/renameat-racy
rename_noreplace() fallback for file systems where neither RENAME_REPLACE nor link()/unlinkat() is available
2018-10-03 13:37:53 +02:00
Zbigniew Jędrzejewski-Szmek 1ee55f52a8
Merge pull request #10257 from pfl/dhcp6_pd_enable_later_link
DHCP6 PD enable later link
2018-10-03 11:04:41 +02:00
Zbigniew Jędrzejewski-Szmek ac7b333009
Merge pull request #10261 from yuwata/test-network
test: small improvements for systemd-networkd-test.py
2018-10-03 10:03:34 +02:00
Yu Watanabe b7172f3471 test-execute: also tests under the condition that unshare() is filtered
This is mainly for testing 1beab8b0d0.
2018-10-03 08:33:23 +02:00
Zbigniew Jędrzejewski-Szmek 7bcf8123c0
Merge pull request #10213 from yuwata/oss-fuzz-10746
dhcp6: fix issue oss-fuzz#10746
2018-10-03 08:31:55 +02:00
Yu Watanabe 6aea927681 test: make systemd-networkd-tests.py run on arbitrary directory 2018-10-03 14:38:30 +09:00
Yu Watanabe ec6a47044a test: replace stop+start by restart
This suppress the following warnings:
```
Warning: Stopping systemd-networkd.service, but it can still be activated by:
  systemd-networkd.socket
```
2018-10-03 14:36:34 +09:00
Yu Watanabe 5b054bfc10 test: add a testcase for oss-fuzz#10746 2018-10-03 08:53:42 +09:00
Yu Watanabe 84452783b8 dhcp6: check option length before reading values
Fixes oss-fuzz#10746
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10746.
2018-10-03 08:49:55 +09:00
Yu Watanabe 9380d34c2a test: add test for sd_device 2018-10-02 23:04:55 +02:00