Commit graph

31294 commits

Author SHA1 Message Date
Yu Watanabe d852bda105 doc: update TRANSIENT-SETTINGS.md 2017-12-15 09:11:51 +09:00
Yu Watanabe 535e0d19a2 bus-unit-util: add path unit related options 2017-12-15 09:11:39 +09:00
Yu Watanabe 5b9fbf8989 core/path: implement transient path unit 2017-12-15 09:10:34 +09:00
Yu Watanabe 1e3b7b0ec8 core/dbus-timer: improve error messages 2017-12-15 09:10:28 +09:00
Yu Watanabe afcb1cd3a3 bus-unit-util: improve error messages 2017-12-15 09:10:21 +09:00
Yu Watanabe ed7e9b34ce bus-unit-util: remove unnecessary oom check
We cannot detect error by alloca().
2017-12-15 09:10:17 +09:00
Lennart Poettering a1b2c92d82 final v236 update (#7649) 2017-12-14 23:09:57 +01:00
Lennart Poettering a181c67462
Merge pull request #7608 from poettering/more-news-v236
more v236 news improvements
2017-12-14 22:58:22 +01:00
Lennart Poettering f78a88beca
Merge pull request #6598 from kyle-walker/shutdown-limit
core: Limit the time and attempts in shutdown remount/umount efforts
2017-12-14 22:57:57 +01:00
Lennart Poettering e3140015a7
Merge pull request #7640 from keszybz/tainting-updates
Tainting updates
2017-12-14 22:57:17 +01:00
Zbigniew Jędrzejewski-Szmek bdd2bbc445
Merge pull request #7469 from kinvolk/dongsu/nspawn-netns
nspawn: introduce an option for specifying network namespace path
2017-12-14 22:47:57 +01:00
Zbigniew Jędrzejewski-Szmek 590171d1c9 Update TODO 2017-12-14 22:14:39 +01:00
Zbigniew Jędrzejewski-Szmek 49e74d7e2e meson: restore --update-catalog call after install
This got dropped by mistake in 72cdb3e783.
2017-12-14 22:14:38 +01:00
Zbigniew Jędrzejewski-Szmek b2e7486cc7 Make taint message structured and add catalog entry
Dec 14 14:10:54 krowka systemd[1]: System is tainted: overflowgid-not-65534
-- Subject: The system is configured in a way that might cause problems
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The following "tags" are possible:
-- - "split-usr" — /usr is a separate file system and was not mounted when systemd
--   was booted
-- - "cgroups-missing" — the kernel was compiled without cgroup support or access
--   to expected interface files is resticted
-- - "var-run-bad" — /var/run is not a symlink to /run
-- - "overflowuid-not-65534" — the kernel user ID used for "unknown" users (with
--   NFS or user namespaces) is not 65534
-- - "overflowgid-not-65534" — the kernel group ID used for "unknown" users (with
--   NFS or user namespaces) is not 65534
-- Current system is tagged as overflowgid-not-65534.
2017-12-14 22:14:38 +01:00
Zbigniew Jędrzejewski-Szmek 198ce93248 core: drop taints for nobody user/group names
We have a check and warning at compile time. The user cannot do anything about
this at runtime, and all other taints are about checks that happen at runtime
and are specific to that system (and at least potentially correctable).

(The logic in the compilation-time check was updated to treat "nogroup" as OK,
but not the runtime check. But I think it's better to remove the runtime check
for this altogether, so this becomes moot.)
2017-12-14 22:14:38 +01:00
Zbigniew Jędrzejewski-Szmek 6c9c81fce1
Merge pull request #7643 from keszybz/hwdb-update-again
Hwdb update again
2017-12-14 21:13:20 +01:00
Lennart Poettering 14965b94f2
resolve: extend systemd-resolve so that it can push per-interface DNS configuration into systemd-resolved (#7576)
This is useful to debug things, but also to hook up external post-up
scripts with resolved.

Eventually this code might be useful to implement a
resolvconf(8)-compatible interface for compatibility purposes. Since the
semantics don't map entirely cleanly as first step we add a native
interface for pushing DNS configuration into resolved, that exposes the
correct semantics, before adding any compatibility interface.

See: #7202
2017-12-14 20:13:14 +01:00
Lennart Poettering fbd0b64f44
tree-wide: make use of new STRLEN() macro everywhere (#7639)
Let's employ coccinelle to do this for us.

Follow-up for #7625.
2017-12-14 19:02:29 +01:00
Kyle Walker 73ad712fcf core: Implement sync_with_progress()
In similar fashion to the previous change, sync() operations can stall
endlessly if cache is unable to be written out. In order to avoid an
unbounded hang, the sync takes place within a child process. Every 10
seconds (SYNC_TIMEOUT_USEC), the value of /proc/meminfo "Dirty" is checked
to verify it is smaller than the last iteration. If the sync is not making
progress for 3 successive iterations (SYNC_PROGRESS_ATTEMPTS), a SIGKILL is
sent to the sync process and the shutdown continues.
2017-12-14 11:46:03 -05:00
Iago López Galeiras f3d33947ea test: add smoke tests for --network-namespace-path
We create net ns with `ip netns`, pass the created ns to nspawn and
check the loopback interface is DOWN.
2017-12-14 17:34:26 +01:00
Lennart Poettering ea2a3c9e50 NEWS: update NEWS again, and prepare for a release tomorrow 2017-12-14 17:29:30 +01:00
Lennart Poettering cbd73c69ba meson: increase version numbers 2017-12-14 17:29:30 +01:00
Lennart Poettering 1142cbd76a
Merge pull request #7610 from poettering/stdio-nolocking
use __fsetlocking() to turn off thread locking in STDIO where applicable
2017-12-14 16:56:36 +01:00
Zbigniew Jędrzejewski-Szmek 82267a45dd hwdb: update
The changes in pci.ids, usb.ids, and the .hwdb files are almost always
additions. 20-OUI.hwdb drops a few names and replaces them by
"IEEE Registration Authority". I'm not sure what to do about this.
Many other removals do not seem to be removals of real entries, but
rather placeholder or generic names.
2017-12-14 16:01:24 +01:00
Zbigniew Jędrzejewski-Szmek af49df623e hwdb/ids_parser: use replacement chars for invalid characters
We have some more non-utf8 characters. Let's just replace them, this doesn't
matter much.
2017-12-14 15:47:39 +01:00
Zbigniew Jędrzejewski-Szmek c6801f502c meson-hwdb-update: fix undefined variable access
I added the test if an optional parameter is not empty, but that doesn't work
with -u. Provide an empty "fallback" value to fix the issue.

Also group the update steps so that it's easier to see what is going on.
2017-12-14 15:45:21 +01:00
Kyle Walker d5641e0d7e core: Implement timeout based umount/remount limit
Remount, and subsequent umount, attempts can hang for inaccessible network
based mount points. This can leave a system in a hard hang state that
requires a hard reset in order to recover. This change moves the remount,
and umount attempts into separate child processes. The remount and umount
operations will block for up to 90 seconds (DEFAULT_TIMEOUT_USEC). Should
those waits fail, the parent will issue a SIGKILL to the child and continue
with the shutdown efforts.

In addition, instead of only reporting some additional errors on the final
attempt, failures are reported as they occur.
2017-12-14 08:58:56 -05:00
Cong Wang f581267a02 sd-bus: fix a memory leak in message_new_reply() (#7636)
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2017-12-14 13:07:04 +01:00
Lennart Poettering e18c15413d
Merge pull request #7606 from yuwata/run-timer
run: allow to specify multiple timer options
2017-12-14 13:04:30 +01:00
Daniel Black a327431bd1 core: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown (#7214)
With Type=notify services, EXTEND_TIMEOUT_USEC= messages will delay any startup/
runtime/shutdown timeouts.

A service that hasn't timed out, i.e, start time < TimeStartSec,
runtime < RuntimeMaxSec and stop time < TimeoutStopSec, may by sending
EXTEND_TIMEOUT_USEC=, allow the service to continue beyond the limit for
the execution phase (i.e TimeStartSec, RunTimeMaxSec and TimeoutStopSec).

EXTEND_TIMEOUT_USEC= must continue to be sent (in the same way as
WATCHDOG=1) within the time interval specified to continue to reprevent
the timeout from occuring.

Watchdog timeouts are also extended if a EXTEND_TIMEOUT_USEC is greater
than the remaining time on the watchdog counter.

Fixes #5868.
2017-12-14 12:17:43 +01:00
Lennart Poettering e51faad3d5 busctl: let's make use of the log_error_errno() calls 2017-12-14 10:46:19 +01:00
Lennart Poettering 8d3b9edc6b busctl: modernize code a bit
I am puzzled why coccinelle is unwilling to detect these cases...
2017-12-14 10:46:19 +01:00
Lennart Poettering 35bbbf85e0 basic: turn off stdio locking for a couple of helper calls
These helper calls are potentially called often, and allocate FILE*
objects internally for a very short period of time, let's turn off
locking for them too.
2017-12-14 10:46:19 +01:00
Lennart Poettering 0d53667334 tree-wide: use __fsetlocking() instead of fxyz_unlocked()
Let's replace usage of fputc_unlocked() and friends by __fsetlocking(f,
FSETLOCKING_BYCALLER). This turns off locking for the entire FILE*,
instead of doing individual per-call decision whether to use normal
calls or _unlocked() calls.

This has various benefits:

1. It's easier to read and easier not to forget

2. It's more comprehensive, as fprintf() and friends are covered too
   (as these functions have no _unlocked() counterpart)

3. Philosophically, it's a bit more correct, because it's more a
   property of the file handle really whether we ever pass it on to another
   thread, not of the operations we then apply to it.

This patch reworks all pieces of codes that so far used fxyz_unlocked()
calls to use __fsetlocking() instead. It also reworks all places that
use open_memstream(), i.e. use stdio FILE* for string manipulations.

Note that this in some way a revert of 4b61c87511.
2017-12-14 10:42:25 +01:00
Zbigniew Jędrzejewski-Szmek 966c04cf01
Merge pull request #7625 from thom311/th/const-strlen
Don't use strlen() to declare variable-length arrays
2017-12-14 09:41:09 +01:00
Saran Tunyasuvunakool 30cda194e8 networkd: RouteTable option in [IPv6AcceptRA] is now properly processed (#7633)
Fixes: #7632
2017-12-14 14:11:03 +09:00
Lennart Poettering 59f2725cc8 resolved: fix "in-between" logic when boundaries are equal (#7590)
This changes dns_name_between() to deal properly with checking whether B
is between A and C if A and C are equal. Previously we simply returned
-EINVAL in this case, refusing checking. With this change we correct
behaviour: if A and C are equal, then B is "between" both if it is
different from them. That's logical, since we do < and > comparisons, not
<= and >=, and that means that anything "right of A" and "left of C"
lies in between with wrap-around at the ends. And if A and C are equal
that means everything lies between, except for A itself.

This fixes handling of domains using NSEC3 "white lies", for example the
.it TLD.

Fixes: #7421
2017-12-14 14:08:21 +09:00
Yu Watanabe 1bb8d1fce8
Merge pull request #7618 from tiagosh/sysctl_use_read_line
Make systemd-sysctl use read_line() and LONG_LINE_MAX
2017-12-14 13:58:53 +09:00
Daniel Black afbc75e686 man: systemd.unit: move note about clearing lists (#7621)
This is mainly for drop-in files.
2017-12-14 13:51:23 +09:00
Yu Watanabe 314a6c0083
Merge pull request #7627 from poettering/lowercase-systemd
always spell out "systemd" in lowercase letters
2017-12-14 13:44:35 +09:00
Tiago Salem Herrmann 12ec9c3099 sysctl: disable buffer while writing to /proc
fputs() writes only first 2048 bytes and fails
to write to /proc when values are larger than that.
This patch adds a new flag to WriteStringFileFlags
that make it possible to disable the buffer under
specific cases.
2017-12-13 15:03:41 -02:00
Tiago Salem Herrmann a668bfe88a Use read_line() and LONG_LINE_MAX to read values configuration files. 2017-12-13 15:03:33 -02:00
Luca Bruno 2de2abad62 networkd/dhcp: shorten overlong hostname (#7616)
This commit updates networkd behavior to check if the hostname option
received via DHCP is too long for Linux limit, and in case shorten it.
An overlong hostname will be truncated to the first dot or to
`HOST_MAX_LEN`, whatever comes earlier.
2017-12-13 18:00:46 +01:00
Lennart Poettering c96528fae9 catalog: don't say "systemd" when we mean "system"
Yeah, it's hard to type "system", if all you ever type is "systemd", but
it's still a typo in this case.
2017-12-13 17:43:03 +01:00
Lennart Poettering f95b0be742 man: "systemd" is to be written in all lower-case, even at beginnings of sentences
This very important commit is very important.
2017-12-13 17:42:04 +01:00
Lennart Poettering 3ce5a5df2c
Merge pull request #7619 from msekletar/cryptsetup-image-name
cryptsetup: when unlocking always put path to the object into Id
2017-12-13 16:46:57 +01:00
Dongsu Park 25fd814316 test: add CLI smoke tests for --network-namespace-path of nspawn
Since the new option `--network-namespace-path=` of systemd-nspawn
cannot be used together with other network-related options, we need
to add more smoke tests for checking these conditions of options.
2017-12-13 10:21:06 +00:00
Dongsu Park d7bea6b629 nspawn: introduce an option for specifying network namespace path
Add a new option `--network-namespace-path` to systemd-nspawn to allow
users to specify an arbitrary network namespace, e.g. `/run/netns/foo`.
Then systemd-nspawn will open the netns file, pass the fd to
outer_child, and enter the namespace represented by the fd before
running inner_child.

```
$ sudo ip netns add foo
$ mount | grep /run/netns/foo
nsfs on /run/netns/foo type nsfs (rw)
...
$ sudo systemd-nspawn -D /srv/fc27 --network-namespace-path=/run/netns/foo \
  /bin/readlink -f /proc/self/ns/net
/proc/1/ns/net:[4026532009]
```

Note that the option `--network-namespace-path=` cannot be used together
with other network-related options such as `--private-network` so that
the options do not conflict with each other.

Fixes https://github.com/systemd/systemd/issues/7361
2017-12-13 10:21:06 +00:00
Thomas Haller dbcb4a900e tree-wide: use STRLEN() to allocate buffer of constant size
Using strlen() to declare a buffer results in a variable-length array,
even if the compiler likely optimizes it to be a compile time constant.

When building with -Wvla, certain versions of gcc complain about such
buffers. Compiling with -Wvla has the advantage of preventing variably
length array, which defeat static asserts that are implemented by
declaring an array of negative length.
2017-12-13 11:12:19 +01:00
Thomas Haller 6febe75da7 basic/macros: add STRLEN() to get length of string literal as constant expression
While the compiler likely optimizes strlen(x) for string literals,
it is not a constant expression.

Hence,

  char buffer[strlen("OPTION_000") + 1];

declares a variable-length array. STRLEN() can be used instead
when a constant espression is needed.

It's not entirely identical to strlen(), as STRLEN("a\0") counts 2.
Also, it only works with string literals and the macro enforces
that the argument is a literal.
2017-12-13 11:12:07 +01:00