Commit Graph

35564 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 1af294fc82 Drop empty lines in proc-cmdline.c 2018-10-08 17:05:18 +02:00
Zbigniew Jędrzejewski-Szmek 2d3bfb6904 shared/bootspec: remember the full path to boot entry and use it in logging
It's much easier to understand what is going on when the full path is
logged.
2018-10-08 17:05:17 +02:00
Zbigniew Jędrzejewski-Szmek 1b20d88987 Move logic to find default sd-boot entry from systemctl to shared
In preparation for use in other places. No functional change.
2018-10-08 16:06:26 +02:00
Zbigniew Jędrzejewski-Szmek e83419d043 hib-res-generator: add "noresume"
This is an override parameter, to totally skip dehiberanation.
2018-10-08 16:06:16 +02:00
Zbigniew Jędrzejewski-Szmek a79858bfd1 hib-res-generator: open logging before emitting the first message
Also add a debug message when we are not in initrd, because it can be
confusing why nothing is happenning.
2018-10-08 16:06:05 +02:00
Zbigniew Jędrzejewski-Szmek 0307ea49c7 Add $SYSTEMD_IN_INITRD=yes|no override for debugging 2018-10-08 16:04:51 +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
Joe Hershberger d81186ef4f udev: Allow acpi_index and index to be "0"
0 can be a valid index returned by the BIOS, so allow that by using the
parsing function safe_atolu() to check for errors without excluding the
valid value "0".

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2018-10-02 22:58:15 +02:00
Patrik Flykt 107523437c networkd-dhcp6: Request prefix delegation for a new link
Request prefix delegation for a new downstream link that is enabled
after any number of upstream DHCPv6 links. Submit the request after
the link has been configured with a link-local address.

If the upstream DHCPv6 client has already been configured to request
prefixes, attempt to re-assign any possible prefixes between the
already existing links and the new one. If no prefixes are yet
acquired, nothing will happen right away and any prefixes will be
distributed after a reply from the DHCPv6 server.

If none of the already existing downstream links have requested
DHCPv6 prefixes to be assigned, enable prefix delegation for each
client and restart them one by one if they are already running. This
causes the DHCPv6 clients to re-acquire addresses and prefixes and
to re-distribute them to all links when receiving an updated
response from their respective DHCPv6 servers. If the DHCPv6 client
in question was not already running, it is set to request prefixes
but not restarted.

When an error occurs while setting or restarting the DHCPv6 client,
log the incident and move over to the next link.

Fixes #9758.
2018-10-02 12:32:46 -06:00
Patrik Flykt 03d4fc2ed2 networkd-dhcp: Rename function and reduce its logging
Rename dhcp6_verify_link() to dhcp6_get_prefix_delegation() in order
to be clearer in what it does. Reduce unnecessary logging.
2018-10-02 12:32:46 -06:00
David Strauss bca676e3d3 Docs: Update CoC with email alias for David Strauss 2018-10-02 09:22:45 -07:00
Lennart Poettering 1384653e71 update TODO 2018-10-02 18:00:10 +02:00
Zbigniew Jędrzejewski-Szmek 0f0159e313
Merge pull request #10252 from poettering/recv-log-msg-bump
tiny sd-ravd/sd-ndisc logging fixes
2018-10-02 17:56:31 +02:00
Zbigniew Jędrzejewski-Szmek e80ef269a1
Merge pull request #10255 from poettering/hide-new-id128
drop references to "journalctl --new-id128"
2018-10-02 17:54:36 +02:00
Lennart Poettering 29088d374e
Merge pull request #9898 from keszybz/id128
Add a new tool 'systemd-id128'
2018-10-02 17:43:37 +02:00
Lennart Poettering eb74d3b97a
Merge pull request #10249 from keszybz/lgtm-fixes
Fixes for issues found by LGTM
2018-10-02 17:42:55 +02:00
Lennart Poettering b9d016d684 tree-wide: drop all references to "journalctl --new-id128"
Let's advertise "systemd-id128 new" instead.
2018-10-02 16:43:54 +02:00