1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
Commit Graph

38583 Commits

Author SHA1 Message Date
Lennart Poettering
f2ccf8320a analyze: optionally, show more than one elapse time for calendar expressions 2019-02-22 09:10:54 +01:00
Martin Pitt
95a32e9750
units: re-drop ProtectHostname from systemd-hostnamed.service (#11792)
This was an overzealous setting from commit 99894b867f. Without this,
`hostnamectl set-hostname` fails with

    Could not set property: Access denied

as `sethostname()` fails with `EPERM`.
2019-02-22 08:04:37 +01:00
emersion
772afb7616 libsystemd: check if _POSIX_C_SOURCE is defined
This can cause issues if sd-event.h is included in a source file that doesn't
define _POSIX_C_SOURCE and is compiled with -Wundef.
2019-02-22 10:09:48 +09:00
Yu Watanabe
3dd2d52414 test-udev: fix alignment and drop unnecessary white spaces 2019-02-22 06:50:21 +09:00
Yu Watanabe
84a0819c9d test-udev: add more tests for line continuation 2019-02-22 06:50:20 +09:00
Yu Watanabe
e8b2737f20 udev-rules: do not ignore short lines
Otherwise, a short line continues the previous continuation.

This fixes a bug introduced by f10aa08e3e.
2019-02-22 06:50:12 +09:00
Hans de Goede
7e85b073c7 hwdb: Add accelerometer orientation quirk for the Medion Akoya E2212T
Add accelerometer orientation quirk for the Medion Akoya E2212T 2-in-1.
2019-02-21 16:40:51 +01:00
Lennart Poettering
9fa326b18a
Merge pull request #11608 from taro-yamada/add_persistent_randmized_delay
core: add "Persistent=delay" to delay persistent timers after boot
2019-02-21 15:15:37 +01:00
Lennart Poettering
953a1af082
Merge pull request #11776 from keszybz/networkd-ordered-sets
Store domains lists in OrderedSets in networkd
2019-02-21 15:15:11 +01:00
Lennart Poettering
6f0475879a
Merge pull request #11784 from martinpitt/networkd-tests
Various networkd test fixes
2019-02-21 14:05:26 +01:00
Zbigniew Jędrzejewski-Szmek
08995a6b47 Add a work-around for memsan
Fixes #11735.
2019-02-21 14:05:10 +01:00
Martin Pitt
f5cf985e9c networkd-test: fix test_dropin()
- This test needs resolved, so make sure it is started. In some Debian
   environments it is not.
 - It was an unnecessary, and now failing assumption that name servers
   get atomically written to the resolved's resolv.conf. Wait until both
   expected name servers are in the file.
2019-02-21 12:37:08 +01:00
Martin Pitt
ca56805c8d networkd-test: use a complete domain name in test_route_only_dns()
Since version 241 (commit ea4678?), querying MX type records for
single-label domains does not actually forward the query to the DNS
server any more. Use "example.com" instead, which is the recommended
test domain anyway.
2019-02-21 12:37:08 +01:00
Martin Pitt
6592c9c850 networkd-test: disable DNSSEC in domain-restricted DNS test
dnsmasq 2.80 changed behaviour when being queried by resolved with
enabled DNSSEC: It returns errors for SOA and DS queries which cause the
entire query to fail. As we don't configure DNSSEC in this test anyway,
just disable it so that we retain compatibility with old and new dnsmasq
versions.
2019-02-21 12:37:06 +01:00
Taro Yamada
a87c1d3a97 core: delay persistent timers by "RandomizedDelaySec=" at boot.
Fixes #5659.
Currently, if Persistent=true and the machine is off at the scheduled time of the timer unit, the timer
will be triggered immediately at the next boot even if RandomizedDelaySec= is specified.

As a result, if multiple timers meet that condition, they will be triggered at the same time and too
much CPU/IO work makes boot slow down.

With this commit, if the scheduled time of the persistent timer has already elapsed at boot,
set the time when systemd first started as the scheduled time and RandomizedDelaySec= is applied to it.
2019-02-21 20:33:21 +09:00
Zbigniew Jędrzejewski-Szmek
95b2903bde tests: shorten the fuzz test case
The test was failing in Ubuntu CI with a 30s timeout. It makes
sense to keep the file so exercise the set allocation logic, but
we can make it shorter.
2019-02-21 12:30:13 +01:00
Zbigniew Jędrzejewski-Szmek
b61658fd9a shared/hashmap: trivial style updates 2019-02-21 12:04:27 +01:00
Zbigniew Jędrzejewski-Szmek
5e2a51d588 networkd: use OrderedSets instead of strvs to store lists of domains
We were already using OrderedSets in the manager object, but strvs in the
configuration parsing code. Using sets gives us better scaling when many
domains are used.

In oss-fuzz #13059 the attached reproducer takes approximately 30.5 s to be
parsed. Converting to sets makes this go down to 10s. This is not _vastly_
faster, but using sets seems like a nicer approach anyway. In particular, we
avoid the quadratic de-unification operation after each addition.
2019-02-21 12:04:27 +01:00
Zbigniew Jędrzejewski-Szmek
53ae3f6467 basic/ordered-set: export networkd function to print string sets
Tests are added.
2019-02-21 12:00:05 +01:00
Zbigniew Jędrzejewski-Szmek
ef79eae09a basic/ordered-set: add functions to operate on OrderedSets of strings 2019-02-21 12:00:05 +01:00
Yu Watanabe
528a74a1ad socket-util: re-implement socket_address_parse_netlink() by using extract_first_word()
This drops support of trailing white space when a multicast group is
specified.

Fixes one of issues in #11738.
2019-02-21 11:30:49 +01:00
Lennart Poettering
09ba1fcc57
Merge pull request #11748 from yuwata/fix-11711
network: handle disable_ipv6 sysctl property
2019-02-21 11:28:35 +01:00
Lennart Poettering
83159fa039
Merge pull request #11772 from c0d3z3r0/master
Make systemd-boot compliant with the Linux Boot / EFI Handover Protocol
2019-02-21 11:09:35 +01:00
Yu Watanabe
30f9e0bfe5 resolve: fix null pointer dereferences
Follow-up for 8227cfa137.

Fixes CID#1398986.
2019-02-21 11:07:32 +01:00
Szabolcs Fruhwald
5fe74e893c cgtop: Fix processing of controllers other than CPU
After debugging the issue with gdb, I found that the following change

 94ddb08 "cgtop: Still try to get CPU statistics if controller-free"

has introduced a bug, which prevents process(..) method processing
memory and io controllers when cpu_accounting_is_cheap() is true.
The obvious fix is to move this branch to be the last one, keeping
the intended behavior of the above change, without having a negative
effect on the other controllers.

Fixes #11773 [systemd-cgtop no longer shows memory (and io) usage]
2019-02-21 11:00:10 +01:00
Zbigniew Jędrzejewski-Szmek
804f8e1729 generator: rename systemd-mkfs@.service to systemd-makefs@.service
The second name was used in documentation, and the first in the code that
generated the unit. 'systemd-makefs' is the name we want, for example for
consistency with the systemd-makefs executable.

In principle this breaks compatibility, but in practice this is unlikely to be
noticeable. Each instance of the unit is created by writing out a full
definition, so the template was never defined. So the name could only be used
for ordering, and there is not reason to order things against this unit from
the outside: the ordering would rather be against the final mount unit.

Fixes #11769.
2019-02-21 10:59:27 +01:00
Yu Watanabe
4da3315452 test-network: add testcases for handling disable_ipv6 sysctl property 2019-02-21 11:08:07 +09:00
Yu Watanabe
ecdd039246 test-network: update cosmetic workaround
Almost all tests call copy_unit_to_networkd_unit_path() at first.
So, let's move the line break there.
2019-02-21 10:55:46 +09:00
Yu Watanabe
4b600505dd network: check whether ipv6 is enabled in sysctl
Currently, the value is read only once.

Fixes #11711.
2019-02-21 10:55:13 +09:00
Yu Watanabe
826a3602d8 network: use sysctl_read_ip_property() 2019-02-21 10:38:10 +09:00
Yu Watanabe
a6b3b0aace sysctl-util: add sysctl_read_ip_property() 2019-02-21 10:38:10 +09:00
Yu Watanabe
62e021a95d network: use sysctl_write_ip_property() and friends 2019-02-21 10:38:10 +09:00
Yu Watanabe
3decde0226 sysctl-util: introduce sysctl_write_ip_property() and friends 2019-02-21 10:38:10 +09:00
Michael Niewöhner
6247c33614 Make systemd-boot compliant with the Linux Boot / EFI Handover Protocol
The current implementation copied the *complete* header to boot_params,
thus making the kernel ignore many of the fields.

As mentioned in the code comment for the sentinel variable in
bootparam.h a bootloader should only copy the setup_header, set some
fields in boot_params and zero out anything else.

This change makes systemd-boot (mostly) compliant with the Linux Boot
Protocol and the EFI Handover Protocol described in bootparam.h and
Documentation/boot.txt to fix various issues:

- Secure boot not being detected corretly by Linux (#11717)
- tboot error message / warning on boot (#11717)
- Strange purple text color when booting in qemu with OVMF
- Hopefully even more ...
2019-02-20 22:59:52 +01:00
unixsysadmin
56ee4d7001 Fix typo - "do note use guessable names"
Fix typo - "do note use guessable names" to "do not use guessable names"
2019-02-20 22:46:16 +01:00
Zbigniew Jędrzejewski-Szmek
1b78172b5a test-ordered-set: add a copy of test-set adapted to OrderedSet 2019-02-20 22:12:48 +01:00
Zbigniew Jędrzejewski-Szmek
ab24039ff9 networkd: wrap long log lines 2019-02-20 21:30:06 +01:00
Michael Niewöhner
5f7df68c11 Revert "Set secure_boot flag in Kernel Zero-Page (#7482)"
This reverts commit b4f9f2a62f.

Revert this because a) the quiet bug is fixed in linux and b)
Documentation/boot.txt says "All other fields should be zero."
2019-02-20 20:14:15 +01:00
Benjamin Dahlhoff
d3b8e06dee hwdb: rotation for Trekstor Surf Tab Twin 11.6 aka VolksTablet (#11771) 2019-02-20 19:05:25 +01:00
Zbigniew Jędrzejewski-Szmek
0b0bfdb53f
Merge pull request #11512 from poettering/resolved-stub-pipeline
support incoming pipelined TCP stream queries in DNS stub server
2019-02-20 19:03:13 +01:00
Zbigniew Jędrzejewski-Szmek
41d3c9c2e9
Merge pull request #11725 from poettering/temp-dir
docs: document semantics of /tmp and /var/tmp
2019-02-20 18:37:05 +01:00
Zbigniew Jędrzejewski-Szmek
ac5c138137
Merge pull request #11482 from poettering/tmpfiles-bsd-lock
adds a fully safe way how apps can pin files into /tmp temporarily, excepting them from the tmpfiles aging algorithm, based on BSD file locks on dirs we descend into
2019-02-20 18:34:03 +01:00
Lennart Poettering
25f77a4ba2 man,units: link up new documentation about temporary directories 2019-02-20 18:31:18 +01:00
Lennart Poettering
b04d849085 docs: document semantics of /tmp and /var/tmp 2019-02-20 18:31:18 +01:00
Anita Zhang
7ca69792e5 core: add ':' prefix to ExecXYZ= skip env var substitution 2019-02-20 17:58:14 +01:00
Lennart Poettering
542e546010
Merge pull request #11556 from yuwata/udev-ctrl-use-sd-event
udev: make `udevadm control` send multiple control commands in a single connection
2019-02-20 17:55:28 +01:00
Lennart Poettering
eb5149ba74
Merge pull request #11682 from topimiettinen/private-utsname
core: ProtectHostname feature
2019-02-20 14:12:15 +01:00
Topi Miettinen
99894b867f units: enable ProtectHostname=yes 2019-02-20 10:50:44 +02:00
Topi Miettinen
aecd5ac621 core: ProtectHostname= feature
Let services use a private UTS namespace. In addition, a seccomp filter is
installed on set{host,domain}name and a ro bind mounts on
/proc/sys/kernel/{host,domain}name.
2019-02-20 10:50:44 +02:00
Franck Bui
37ed15d7ed namespace: make MountFlags=shared work again
Since commit 0722b35934, the root mountpoint is
unconditionnally turned to slave which breaks units that are using explicitly
MountFlags=shared (and no other options that would implicitly require a slave
root mountpoint).

Here is a test case:

  $ systemctl cat test-shared-mount-flag.service
  # /etc/systemd/system/test-shared-mount-flag.service
  [Service]
  Type=simple
  ExecStartPre=/usr/bin/mkdir -p /mnt/tmp
  ExecStart=/bin/sh -c "/usr/bin/mount -t tmpfs -o size=10M none /mnt/tmp && sleep infinity"
  ExecStop=-/bin/sh -c "/usr/bin/umount /mnt/tmp"
  MountFlags=shared

  $ systemctl start test-shared-mount-flag.service
  $ findmnt /mnt/tmp
  $

Mount on /mnt/tmp is not visible from the host although MountFlags=shared was
used.

This patch fixes that and turns the root mountpoint to slave when it's really
required.
2019-02-20 06:20:40 +09:00