platform/upstream/systemd.git
7 years agoexit-status: kill is_clean_exit_lsb(), move logic to sysv-generator
Lennart Poettering [Mon, 10 Oct 2016 19:48:08 +0000 (21:48 +0200)]
exit-status: kill is_clean_exit_lsb(), move logic to sysv-generator

Let's get rid of is_clean_exit_lsb(), let's move the logic for the special
handling of the two LSB exit codes into the sysv-generator by writing out
appropriate SuccessExitStatus= lines if the LSB header exists. This is not only
semantically more correct, bug also fixes a bug as the code in service.c that
chose between is_clean_exit_lsb() and is_clean_exit() based this check on
whether a native unit files was available for the unit. However, that check was
bogus since a long time, since the SysV generator was introduced and native
SysV script support was removed from PID 1, as in that case a unit file always
existed.

7 years agoinstall: let's always refer to the actual setting in errors
Lennart Poettering [Mon, 10 Oct 2016 18:11:49 +0000 (20:11 +0200)]
install: let's always refer to the actual setting in errors

7 years agoexit-status: reorder the exit status switch table
Lennart Poettering [Mon, 10 Oct 2016 18:11:21 +0000 (20:11 +0200)]
exit-status: reorder the exit status switch table

Let's make sure it's in the same order as the actual enum defining the exit
statuses.

7 years agoexit-status: remove ExitStatus typedef
Lennart Poettering [Mon, 10 Oct 2016 18:08:41 +0000 (20:08 +0200)]
exit-status: remove ExitStatus typedef

Do not make up our own type for ExitStatus, but use the type used by POSIX for
this, which is "int".  In particular as we never used that type outside of the
definition of exit_status_to_string() where we internally cast the paramter to
(int) every single time we used it.

Hence, let's simplify things, drop the type and use the kernel type directly.

7 years agoupdate TODO
Lennart Poettering [Mon, 10 Oct 2016 17:53:37 +0000 (19:53 +0200)]
update TODO

7 years agonetworkd: rename Rename CheckSum → Checksum (#4312)
Susant Sahani [Mon, 10 Oct 2016 17:52:12 +0000 (23:22 +0530)]
networkd: rename Rename CheckSum → Checksum (#4312)

7 years agoMerge pull request #4332 from keszybz/nspawn-arguments-3
Lennart Poettering [Mon, 10 Oct 2016 17:51:51 +0000 (19:51 +0200)]
Merge pull request #4332 from keszybz/nspawn-arguments-3

nspawn --private-users parsing, v2

7 years agotree-wide: pass return value of make_null_stdio() to warning instead of errno (#4328)
0xAX [Mon, 10 Oct 2016 17:51:33 +0000 (20:51 +0300)]
tree-wide: pass return value of make_null_stdio() to warning instead of errno (#4328)

as @poettering suggested in the #4320

7 years agoMerge pull request #4310 from keszybz/nspawn-autodetect
Evgeny Vereshchagin [Mon, 10 Oct 2016 17:47:25 +0000 (20:47 +0300)]
Merge pull request #4310 from keszybz/nspawn-autodetect

Autodetect systemd version in containers started by systemd-nspawn

7 years agonspawn: better error messages for parsing errors
Zbigniew Jędrzejewski-Szmek [Mon, 10 Oct 2016 15:22:45 +0000 (11:22 -0400)]
nspawn: better error messages for parsing errors

In particular, the check for arg_uid_range <= 0 is moved to the end, so that
"foobar:0" gives "Failed to parse UID", and not "UID range cannot be 0.".

7 years agonspawn,man: fix parsing of numeric args for --private-users, accept any boolean
Zbigniew Jędrzejewski-Szmek [Mon, 10 Oct 2016 15:12:57 +0000 (11:12 -0400)]
nspawn,man: fix parsing of numeric args for --private-users, accept any boolean

This is like the previous reverted commit, but any boolean is still accepted,
not just "yes" and "no". Man page is adjusted to match the code.

7 years agoRevert "nspawn: fix parsing of numeric arguments for --private-users"
Zbigniew Jędrzejewski-Szmek [Mon, 10 Oct 2016 14:04:31 +0000 (10:04 -0400)]
Revert "nspawn: fix parsing of numeric arguments for --private-users"

This reverts commit bfd292ec35c7b768f9fb5cff4d921f3133e62b19.

7 years agologin: drop fedora-specific PAM config, add note to DISTRO_PORTING (#4314)
Felipe Sateler [Mon, 10 Oct 2016 13:40:05 +0000 (10:40 -0300)]
login: drop fedora-specific PAM config, add note to DISTRO_PORTING (#4314)

It is impossible to ship a fully generic PAM configuration upstream.
Therefore, ship a minimal configuration with the systemd --user requirements,
and add a note to DISTRO_PORTING documenting this.

Fixes #4284

7 years agounit: drop console-shell.service (#4298) (#4325)
Franck Bui [Mon, 10 Oct 2016 10:06:26 +0000 (12:06 +0200)]
unit: drop console-shell.service (#4298) (#4325)

console-shell.service was supposed to be useful for normal clean boots
(i.e. multi-user.target or so), as a replacement for logind/getty@.service for
simpler use cases.

But due to the lack of documentation and sanity check one can easily be
confused and enable this service in // with getty@.service.

In this case we end up with both services sharing the same tty which ends up in
strange results.

Even worse, console-shell.service might be failing while getty@.service tries
to acquire the terminal which ends up in the system to poweroff since
console-shell.service uses:

  "ExecStopPost=-/usr/bin/systemctl poweroff".

Another issue: this service doesn't work well if plymouth is also used since it
lets the splash screen program run and mess the tty (at least a "plymouth quit"
is missing).

So let's kill it for now.

7 years agoMerge pull request #4323 from keszybz/resolved-in-userns
Lennart Poettering [Mon, 10 Oct 2016 07:37:01 +0000 (09:37 +0200)]
Merge pull request #4323 from keszybz/resolved-in-userns

A fix to get resolved to start in userns

7 years agomain: initialize default unit little later (#4321)
0xAX [Mon, 10 Oct 2016 02:57:03 +0000 (05:57 +0300)]
main: initialize default unit little later (#4321)

systemd fills arg_default_unit during startup with default.target
value. But arg_default_unit may be overwritten in parse_argv() or
parse_proc_cmdline_item().

Let's check value of arg_default_unit after calls of parse_argv()
and parse_proc_cmdline_item() and fill it with default.target if
it wasn't filled before. In this way we will not spend unnecessary
time to for filling arg_default_unit with default.target.

7 years agotree-wide: print warning in a failure case of make_null_stdio() (#4320)
0xAX [Mon, 10 Oct 2016 02:55:24 +0000 (05:55 +0300)]
tree-wide: print warning in a failure case of make_null_stdio() (#4320)

The make_null_stdio() may fail. Let's check its result and print
warning message instead of keeping silence.

7 years agoresolved: also disable stub listener on EPERM
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 19:04:59 +0000 (15:04 -0400)]
resolved: also disable stub listener on EPERM

When running in a user namespace without private networking, resolved would
fail to start. There isn't much difference between EADDRINUSE and EPERM,
so treat them the same, except for the warning message text.

7 years agoresolved: simplify error handling in manager_dns_stub_{udp,tcp}_fd()
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 18:19:06 +0000 (14:19 -0400)]
resolved: simplify error handling in manager_dns_stub_{udp,tcp}_fd()

Make sure an error is always printed… When systemd-resolved is started in a
user namespace without private network, it would fail on setsockopt, but the
error wouldn't be particularly informative:
"Failed to start manager: permission denied."

7 years agoMerge pull request #4319 from keszybz/nspawn-arguments
Evgeny Vereshchagin [Mon, 10 Oct 2016 00:26:17 +0000 (03:26 +0300)]
Merge pull request #4319 from keszybz/nspawn-arguments

Nspawn arguments parsing and man page update

7 years agosd-boot: trigger to record further logs to tcg 2.0 final event log area (#4302)
Lans Zhang [Sun, 9 Oct 2016 22:59:54 +0000 (06:59 +0800)]
sd-boot: trigger to record further logs to tcg 2.0 final event log area (#4302)

According to TCG EFI Protocol Specification for TPM 2.0 family,
all events generated after the invocation of EFI_TCG2_GET_EVENT_LOG
shall be stored in an instance of an EFI_CONFIGURATION_TABLE aka
EFI TCG 2.0 final events table. Hence, it is necessary to trigger the
internal switch through calling get_event_log() in order to allow
to retrieve the logs from OS runtime.

msekletar:
> I've looked at EDK2 and indeed log entry is added to FinalEventsTable only after
> EFI_TCG2_PROTOCOL.GetEventLog was called[1][2]. Also, same patch was currently
> merged to shim by Peter Jones [3].

[1] https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c#L698
[2] https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c#L824
[3] rhinstaller/shim#64

7 years agoman: describe how to reverse systemd-nspawn -U
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 15:48:01 +0000 (11:48 -0400)]
man: describe how to reverse systemd-nspawn -U

Now that systemd-nspawn@.service includes -U, more users might be interested
in this tidbit ;)

7 years agonspawn: fix parsing of numeric arguments for --private-users
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 15:44:03 +0000 (11:44 -0400)]
nspawn: fix parsing of numeric arguments for --private-users

The documentation says lists "yes", "no", "pick", and numeric arguments.
But parse_boolean was attempted first, so various numeric arguments were
misinterpreted.

In particular, this fixes --private-users=0 to mean the same thing as
--private-users=0:65536.

While at it, use strndupa to avoid some error handling.
Also give a better error for an empty UID range. I think it's likely that
people will use --private-users=0:0 thinking that the argument means UID:GID.

7 years agonspawn: reindent table
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 15:18:22 +0000 (11:18 -0400)]
nspawn: reindent table

7 years agonspawn: also fall back to legacy cgroup hierarchy for old containers
Zbigniew Jędrzejewski-Szmek [Sat, 8 Oct 2016 23:03:53 +0000 (19:03 -0400)]
nspawn: also fall back to legacy cgroup hierarchy for old containers

Current systemd version detection routine cannot detect systemd 230,
only systmed >= 231. This means that we'll still use the legacy hierarchy
in some cases where we wouldn't have too. If somebody figures out a nice
way to detect systemd 230 this can be later improved.

7 years agomachinectl: enable pager on help (#4313)
0xAX [Sat, 8 Oct 2016 21:49:33 +0000 (00:49 +0300)]
machinectl: enable pager on help (#4313)

as its output is fairly long.

7 years agonspawn: use mixed cgroup hierarchy only when container has new systemd
Zbigniew Jędrzejewski-Szmek [Sat, 8 Oct 2016 06:18:26 +0000 (02:18 -0400)]
nspawn: use mixed cgroup hierarchy only when container has new systemd

systemd-soon-to-be-released-232 is able to deal with the mixed hierarchy.
So make an educated guess, and use the mixed hierarchy in that case.

Tested by running the host with mixed hierarchy (i.e. simply using a recent
kernel with systemd from git), and booting first a container with older systemd,
and then one with a newer systemd.

Fixes #4008.

7 years agonspawn: fix spurious reboot if container process returns 133
Zbigniew Jędrzejewski-Szmek [Fri, 7 Oct 2016 14:31:47 +0000 (10:31 -0400)]
nspawn: fix spurious reboot if container process returns 133

7 years agonspawn: move the main loop body out to a new function
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 19:32:38 +0000 (21:32 +0200)]
nspawn: move the main loop body out to a new function

The new function has 416 lines by itself!

"return log_error_errno" is used to nicely reduce the volume of error
handling code.

A few minor issues are fixed on the way:
- positive value was used as error value (EIO), causing systemd-nspawn
  to return success, even though it shouldn't.
- In two places random values were used as error status, when the
  actual value was in an unusual place (etc_password_lock, notify_socket).

Those are the only functional changes.

There is another potential issue, which is marked with a comment, and left
unresolved: the container can also return 133 by itself, causing a spurious
reboot.

7 years agonspawn: check env var first, detect second
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 18:07:22 +0000 (20:07 +0200)]
nspawn: check env var first, detect second

If we are going to use the env var to override the detection result
anyway, there is not point in doing the detection, especially that
it can fail.

7 years agopath-util: add a function to peek into a container and guess systemd version
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 13:51:27 +0000 (15:51 +0200)]
path-util: add a function to peek into a container and guess systemd version

This is a bit crude and only works for new systemd versions which
have libsystemd-shared.

7 years agosystemd-resolve: use sha256 for local-part of openpgp key (#4193)
Stefan Schweter [Sat, 8 Oct 2016 11:59:34 +0000 (13:59 +0200)]
systemd-resolve: use sha256 for local-part of openpgp key (#4193)

7 years agonetworkd: address add support to configure flags (#4201)
Susant Sahani [Sat, 8 Oct 2016 11:05:41 +0000 (16:35 +0530)]
networkd: address add support to configure flags (#4201)

This patch enables to configure

IFA_F_HOMEADDRESS
IFA_F_NODAD
IFA_F_MANAGETEMPADDR
IFA_F_NOPREFIXROUTE
IFA_F_MCAUTOJOIN

7 years agoMerge pull request #4061 from dm0-/coreos-1545
Lennart Poettering [Fri, 7 Oct 2016 21:38:03 +0000 (23:38 +0200)]
Merge pull request #4061 from dm0-/coreos-1545

resolved: add an option to disable the stub resolver

7 years agoresolved: add an option to control the DNS stub listener
David Michael [Wed, 31 Aug 2016 22:34:29 +0000 (15:34 -0700)]
resolved: add an option to control the DNS stub listener

7 years agoMerge pull request #4304 from poettering/notify-nul-check
Lennart Poettering [Fri, 7 Oct 2016 16:30:53 +0000 (18:30 +0200)]
Merge pull request #4304 from poettering/notify-nul-check

3 minor improvements for notification message handling

7 years agocore: only warn on short reads on signal fd
Zbigniew Jędrzejewski-Szmek [Fri, 7 Oct 2016 13:39:42 +0000 (09:39 -0400)]
core: only warn on short reads on signal fd

7 years agonetworkd: remote checksum offload for vxlan (#4110)
Susant Sahani [Fri, 7 Oct 2016 13:46:18 +0000 (19:16 +0530)]
networkd: remote checksum offload for vxlan (#4110)

This patch adds support to remote checksum checksum offload to VXLAN.
This patch adds RemoteCheckSumTx and RemoteCheckSumRx vxlan configuration
to enable remote checksum offload for transmit and receive on the VXLAN tunnel.

7 years agoarchitecture: Add support for the RISC-V architecture. (#4305)
rwmjones [Fri, 7 Oct 2016 12:56:27 +0000 (13:56 +0100)]
architecture: Add support for the RISC-V architecture. (#4305)

RISC-V is an open source ISA in development since 2010 at UCB.
For more information, see https://riscv.org/

I am adding RISC-V support to Fedora:
https://fedoraproject.org/wiki/Architectures/RISC-V

There are three major variants of the architecture (32-, 64- and
128-bit).  The 128-bit variant is a paper exercise, but the other
two really exist in silicon.  RISC-V is always little endian.

On Linux, the default kernel uname(2) can return "riscv" for all
variants.  However a patch was added recently which makes the kernel
return one of "riscv32" or "riscv64" (or in future "riscv128").  So
systemd should be prepared to handle any of "riscv", "riscv32" or
"riscv64" (in future, "riscv128" but that is not included in the
current patch).  If the kernel returns "riscv" then you need to use
the pointer size in order to know the real variant.

The Fedora/RISC-V kernel only ever returns "riscv64" since we're
only doing Fedora for 64 bit at the moment, and we've patched the
kernel so it doesn't return "riscv".

As well as the major bitsize variants, there are also architecture
extensions.  However I'm trying to ensure that uname(2) does *not*
return any other information about those in utsname.machine, so that
we don't end up with "riscv64abcde" nonsense.  Instead those
extensions will be exposed in /proc/cpuinfo similar to how flags
work in x86.

7 years agomanager: tighten incoming notification message checks
Lennart Poettering [Fri, 7 Oct 2016 10:14:33 +0000 (12:14 +0200)]
manager: tighten incoming notification message checks

Let's not accept datagrams with embedded NUL bytes. Previously we'd simply
ignore everything after the first NUL byte. But given that sending us that is
pretty ugly let's instead complain and refuse.

With this change we'll only accept messages that have exactly zero or one NUL
bytes at the very end of the datagram.

7 years agomanager: be stricter with incomining notifications, warn properly about too large...
Lennart Poettering [Fri, 7 Oct 2016 10:12:10 +0000 (12:12 +0200)]
manager: be stricter with incomining notifications, warn properly about too large ones

Let's make the kernel let us know the full, original datagram size of the
incoming message. If it's larger than the buffer space provided by us, drop the
whole message with a warning.

Before this change the kernel would truncate the message for us to the buffer
space provided, and we'd not complain about this, and simply process the
incomplete message as far as it made sense.

7 years agomanager: don't ever busy loop when we get a notification message we can't process
Lennart Poettering [Fri, 7 Oct 2016 10:08:51 +0000 (12:08 +0200)]
manager: don't ever busy loop when we get a notification message we can't process

If the kernel doesn't permit us to dequeue/process an incoming notification
datagram message it's still better to stop processing the notification messages
altogether than to enter a busy loop where we keep getting notified but can't
do a thing about it.

With this change, manager_dispatch_notify_fd() behaviour is changed like this:

- if an error indicating a spurious wake-up is seen on recvmsg(), ignore it
  (EAGAIN/EINTR)

- if any other error is seen on recvmsg() propagate it, thus disabling
  processing of further wakeups

- if any error is seen on later code in the function, warn about it but do not
  propagate it, as in this cas we're not going to busy loop as the offending
  message is already dequeued.

7 years agoMerge pull request #4300 from keszybz/mkosi
Lennart Poettering [Fri, 7 Oct 2016 07:58:25 +0000 (09:58 +0200)]
Merge pull request #4300 from keszybz/mkosi

Various mkosi bits

7 years agocore: add possibility to set action for ctrl-alt-del burst (#4105)
Lukáš Nykrýn [Fri, 7 Oct 2016 01:08:21 +0000 (03:08 +0200)]
core: add possibility to set action for ctrl-alt-del burst (#4105)

For some certification, it should not be possible to reboot the machine through ctrl-alt-delete. Currently we suggest our customers to mask the ctrl-alt-delete target, but that is obviously not enough.

Patching the keymaps to disable that is really not a way to go for them, because the settings need to be easily checked by some SCAP tools.

7 years agoMerge pull request #4299 from poettering/variety
Evgeny Vereshchagin [Thu, 6 Oct 2016 20:43:08 +0000 (23:43 +0300)]
Merge pull request #4299 from poettering/variety

ioctl socket fixes, sd-bus error updates, resolved error addition, PAM stub process priv fix

7 years agouser-util: rework maybe_setgroups() a bit
Lennart Poettering [Thu, 6 Oct 2016 15:54:12 +0000 (17:54 +0200)]
user-util: rework maybe_setgroups() a bit

Let's drop the caching of the setgroups /proc field for now. While there's a
strict regime in place when it changes states, let's better not cache it since
we cannot really be sure we follow that regime correctly.

More importantly however, this is not in performance sensitive code, and
there's no indication the cache is really beneficial, hence let's drop the
caching and make things a bit simpler.

Also, while we are at it, rework the error handling a bit, and always return
negative errno-style error codes, following our usual coding style. This has
the benefit that we can sensible hanld read_one_line_file() errors, without
having to updat errno explicitly.

7 years agotree-wide: drop some misleading compiler warnings
Lennart Poettering [Thu, 6 Oct 2016 15:44:51 +0000 (17:44 +0200)]
tree-wide: drop some misleading compiler warnings

gcc at some optimization levels thinks thes variables were used without
initialization. it's wrong, but let's make the message go anyway.

7 years agocore: leave PAM stub process around with GIDs updated
Lennart Poettering [Thu, 6 Oct 2016 14:03:01 +0000 (16:03 +0200)]
core: leave PAM stub process around with GIDs updated

In the process execution code of PID 1, before
096424d1230e0a0339735c51b43949809e972430 the GID settings where changed before
invoking PAM, and the UID settings after. After the change both changes are
made after the PAM session hooks are run. When invoking PAM we fork once, and
leave a stub process around which will invoke the PAM session end hooks when
the session goes away. This code previously was dropping the remaining privs
(which were precisely the UID). Fix this code to do this correctly again, by
really dropping them else (i.e. the GID as well).

While we are at it, also fix error logging of this code.

Fixes: #4238

7 years agosd-bus: add DNS errors to the errno translation table
Lennart Poettering [Thu, 6 Oct 2016 14:01:44 +0000 (16:01 +0200)]
sd-bus: add DNS errors to the errno translation table

We generate these, hence we should also add errno translations for them.

7 years agoresolved: properly handle BADCOOKIE DNS error
Lennart Poettering [Thu, 6 Oct 2016 14:01:05 +0000 (16:01 +0200)]
resolved: properly handle BADCOOKIE DNS error

Add this new error code (documented in RFC7873) to our list of known errors.

7 years agosd-bus: add a few missing entries to the error translation tables
Lennart Poettering [Thu, 6 Oct 2016 13:50:30 +0000 (15:50 +0200)]
sd-bus: add a few missing entries to the error translation tables

These were forgotten, let's add some useful mappings for all errors we define.

7 years agosd-device/networkd: unify code to get a socket for issuing netdev ioctls on
Lennart Poettering [Thu, 6 Oct 2016 13:48:15 +0000 (15:48 +0200)]
sd-device/networkd: unify code to get a socket for issuing netdev ioctls on

As suggested here:

https://github.com/systemd/systemd/pull/4296#issuecomment-251911349

Let's try AF_INET first as socket, but let's fall back to AF_NETLINK, so that
we can use a protocol-independent socket here if possible. This has the benefit
that our code will still work even if AF_INET/AF_INET6 is made unavailable (for
exmple via seccomp), at least on current kernels.

7 years agomkosi: install Fedora 25
Zbigniew Jędrzejewski-Szmek [Thu, 6 Oct 2016 15:53:07 +0000 (11:53 -0400)]
mkosi: install Fedora 25

No need to look back at the past. Fedora 25 is here (almost).

7 years agomkosi: drop git clean
Zbigniew Jędrzejewski-Szmek [Thu, 6 Oct 2016 15:52:36 +0000 (11:52 -0400)]
mkosi: drop git clean

This is required after systemd/mkosi#25.

7 years agomkosi: disable our own cache
Zbigniew Jędrzejewski-Szmek [Tue, 4 Oct 2016 15:02:22 +0000 (11:02 -0400)]
mkosi: disable our own cache

No point in spamming the fs.

7 years agomkosi: create .mkosi directory
Zbigniew Jędrzejewski-Szmek [Tue, 4 Oct 2016 15:00:02 +0000 (11:00 -0400)]
mkosi: create .mkosi directory

Since it looks like we'll wind up with a bunch of mkosi files for different
distros, it's probably better to keep them in a subdirectory.

7 years agoupdate TODO
Lennart Poettering [Thu, 6 Oct 2016 09:54:03 +0000 (11:54 +0200)]
update TODO

7 years agoMerge pull request #4280 from giuseppe/unprivileged-user
Lennart Poettering [Thu, 6 Oct 2016 13:44:27 +0000 (15:44 +0200)]
Merge pull request #4280 from giuseppe/unprivileged-user

[RFC] run systemd in an unprivileged container

7 years agounits: systemd-udevd: add AF_INET and AF_INET6 to RestrictAddressFamilies= (#4296)
Yu Watanabe [Thu, 6 Oct 2016 13:40:53 +0000 (22:40 +0900)]
units: systemd-udevd: add AF_INET and AF_INET6 to RestrictAddressFamilies= (#4296)

The udev builtin command `net_setup_link` requires AF_INET and AF_INET6.

Fixes #4293.

7 years agoMerge pull request #4199 from dvdhrm/hwdb-order
Lennart Poettering [Thu, 6 Oct 2016 09:58:13 +0000 (11:58 +0200)]
Merge pull request #4199 from dvdhrm/hwdb-order

hwdb: return conflicts in a well-defined order

7 years agocore: do not fail in a container if we can't use setgroups
Giuseppe Scrivano [Wed, 28 Sep 2016 16:37:39 +0000 (18:37 +0200)]
core: do not fail in a container if we can't use setgroups

It might be blocked through /proc/PID/setgroups

7 years agoaudit: disable if cannot create NETLINK_AUDIT socket
Giuseppe Scrivano [Wed, 28 Sep 2016 16:26:25 +0000 (18:26 +0200)]
audit: disable if cannot create NETLINK_AUDIT socket

7 years agonetworkd: fix coding style (#4294)
Susant Sahani [Thu, 6 Oct 2016 09:45:07 +0000 (15:15 +0530)]
networkd: fix coding style (#4294)

7 years agojournald, ratelimit: fix inaccurate message suppression in journal_rate_limit_test...
Yuki Inoguchi [Thu, 6 Oct 2016 09:44:51 +0000 (18:44 +0900)]
journald, ratelimit: fix inaccurate message suppression in journal_rate_limit_test() (#4291)

Currently, the ratelimit does not handle the number of suppressed messages accurately.
Even though the number of messages reaches the limit, it still allows to add one extra messages to journal.

This patch fixes the problem.

7 years agocatalog,po: update Polish translation (#4290)
Piotr Drąg [Wed, 5 Oct 2016 20:59:37 +0000 (22:59 +0200)]
catalog,po: update Polish translation (#4290)

7 years agoFix typo
Giuseppe Scrivano [Tue, 4 Oct 2016 08:51:25 +0000 (10:51 +0200)]
Fix typo

7 years agonetworkd: use BridgeFDB as well on bridge ports (#4253)
Tobias Jungel [Wed, 5 Oct 2016 15:06:40 +0000 (17:06 +0200)]
networkd: use BridgeFDB as well on bridge ports (#4253)

[BridgeFDB] did not apply to bridge ports so far. This patch adds the proper
handling. In case of a bridge interface the correct flag NTF_MASTER is now set
in the netlink call. FDB MAC addresses are now applied in
link_enter_set_addresses to make sure the link is setup.

7 years agoAdded ArchLinux config for mkosi (#4274)
Zeal Jagannatha [Wed, 5 Oct 2016 12:00:06 +0000 (14:00 +0200)]
Added ArchLinux config for mkosi (#4274)

7 years agoseccomp: add support for the s390 architecture (#4287)
hbrueckner [Wed, 5 Oct 2016 11:58:55 +0000 (13:58 +0200)]
seccomp: add support for the s390 architecture (#4287)

Add seccomp support for the s390 architecture (31-bit and 64-bit)
to systemd.

This requires libseccomp >= 2.3.1.

7 years agonspawn: add log message to let users know that nspawn needs an empty /dev directory...
Djalal Harouni [Wed, 5 Oct 2016 04:57:02 +0000 (06:57 +0200)]
nspawn: add log message to let users know that nspawn needs an empty /dev directory (#4226)

Fixes https://github.com/systemd/systemd/issues/3695

At the same time it adds a protection against userns chown of inodes of
a shared mount point.

7 years agoNEWS: typo fixes (#4285)
Thomas H. P. Andersen [Tue, 4 Oct 2016 18:41:46 +0000 (20:41 +0200)]
NEWS: typo fixes (#4285)

7 years agotree-wide: remove consecutive duplicate words in comments
Stefan Schweter [Sun, 2 Oct 2016 17:37:21 +0000 (19:37 +0200)]
tree-wide: remove consecutive duplicate words in comments

7 years agolist: LIST_INSERT_BEFORE: update head if necessary (#4261)
Michael Olbrich [Tue, 4 Oct 2016 14:15:37 +0000 (16:15 +0200)]
list: LIST_INSERT_BEFORE: update head if necessary (#4261)

If the new item is inserted before the first item in the list, then the
head must be updated as well.
Add a test to the list unit test to check for this.

7 years agoautomount: make sure the expire event is restarted after a daemon-reload (#4265)
Michael Olbrich [Tue, 4 Oct 2016 14:13:27 +0000 (16:13 +0200)]
automount: make sure the expire event is restarted after a daemon-reload (#4265)

If the corresponding mount unit is deserialized after the automount unit
then the expire event is set up in automount_trigger_notify(). However, if
the mount unit is deserialized first then the automount unit is still in
state AUTOMOUNT_DEAD and automount_trigger_notify() aborts without setting
up the expire event.
Explicitly call automount_start_expire() during coldplug to make sure that
the expire event is set up as necessary.

Fixes #4249.

7 years agoTypo (`mathes` → `matches`) (#4283)
Lucas Werkmeister [Tue, 4 Oct 2016 13:53:16 +0000 (15:53 +0200)]
Typo (`mathes` → `matches`) (#4283)

7 years agopo: updated Swedish translation (#4241)
andhe [Tue, 4 Oct 2016 13:36:03 +0000 (15:36 +0200)]
po: updated Swedish translation (#4241)

* po: updated Swedish translation

* po: swedish: fix login vs write logs to confusion

Since previous commit (updated messages) there's now a mix of
different translation meanings for the same thing.
While both translations are technically correct I think the
meaning of the original messages are probably "to login" rather
than "to write log messages to". This commit switches all
translations to the "login" meaning.

7 years agoMerge pull request #4273 from keszybz/docs
Martin Pitt [Tue, 4 Oct 2016 13:34:08 +0000 (15:34 +0200)]
Merge pull request #4273 from keszybz/docs

Routing-domains-manpage tweak and NEWS update

7 years agoTypo (`virtiualization` → `virtualization`) (#4281)
Elias Probst [Tue, 4 Oct 2016 12:37:28 +0000 (14:37 +0200)]
Typo (`virtiualization` → `virtualization`) (#4281)

7 years agoman: remove consecutive duplicate words (#4268)
Stefan Schweter [Mon, 3 Oct 2016 15:09:54 +0000 (17:09 +0200)]
man: remove consecutive duplicate words (#4268)

This PR removes consecutive duplicate words from the man pages of:

* `resolved.conf.xml`
* `systemd.exec.xml`
* `systemd.socket.xml`

7 years agonspawn: set shared propagation mode for the container
Alban Crequy [Sat, 1 Oct 2016 08:58:56 +0000 (10:58 +0200)]
nspawn: set shared propagation mode for the container

7 years agobuild-sys: use non-breaking spaces in contributor list
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 12:52:52 +0000 (14:52 +0200)]
build-sys: use non-breaking spaces in contributor list

I think it's easier to read peoples' names with this change.

7 years agoNEWS: add another batch of entries
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 12:51:49 +0000 (14:51 +0200)]
NEWS: add another batch of entries

7 years agoman: rework the explanation of Domains=
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 12:32:44 +0000 (14:32 +0200)]
man: rework the explanation of Domains=

Put more emphasis on the routing part. This is the more interesting
thing, and also more complicated and novel.

Explain "search domains" as the special case. Also explain the effect of
~. in more detail.

7 years agoman: fix indentation in table
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 11:24:54 +0000 (13:24 +0200)]
man: fix indentation in table

<entry>-ies must be a single line of text. Otherwise docbook does strange
things to the indentation.

7 years agocore: do not try to create /run/systemd/transient in test mode
Zbigniew Jędrzejewski-Szmek [Sun, 25 Sep 2016 13:58:29 +0000 (09:58 -0400)]
core: do not try to create /run/systemd/transient in test mode

This prevented systemd-analyze from unprivileged operation on older systemd
installations, which should be possible.
Also, we shouldn't touch the file system in test mode even if we can.

7 years agoanalyze-verify: honour $SYSTEMD_UNIT_PATH, allow system paths to be ignored
Zbigniew Jędrzejewski-Szmek [Sun, 25 Sep 2016 13:55:26 +0000 (09:55 -0400)]
analyze-verify: honour $SYSTEMD_UNIT_PATH, allow system paths to be ignored

SYSTEMD_UNIT_PATH=foobar: systemd-analyze verify barbar/unit.service
will load units from barbar/, foobar/, /etc/systemd/system/, etc.

SYSTEMD_UNIT_PATH= systemd-analyze verify barbar/unit.service
will load units only from barbar/, which is useful e.g. when testing
systemd's own units on a system with an older version of systemd installed.

7 years agocore: complain if Before= dep on .device is declared
Zbigniew Jędrzejewski-Szmek [Sun, 25 Sep 2016 12:34:30 +0000 (08:34 -0400)]
core: complain if Before= dep on .device is declared

[Unit]
Before=foobar.device

[Service]
ExecStart=/bin/true
Type=oneshot

$ systemd-analyze verify before-device.service
before-device.service: Dependency Before=foobar.device ignored (.device units cannot be delayed)

7 years agosystemctl: Add --wait option to wait until started units terminate again
Martin Pitt [Mon, 5 Sep 2016 11:14:36 +0000 (13:14 +0200)]
systemctl: Add --wait option to wait until started units terminate again

Fixes #3830

7 years agoman: update mx record example (#4257)
Stefan Schweter [Sat, 1 Oct 2016 15:11:38 +0000 (17:11 +0200)]
man: update mx record example (#4257)

7 years agoMerge pull request #4164 from martinpitt/nss-resolve
Zbigniew Jędrzejewski-Szmek [Sat, 1 Oct 2016 15:09:51 +0000 (17:09 +0200)]
Merge pull request #4164 from martinpitt/nss-resolve

nss-resolve: return NOTFOUND instead of UNAVAIL for DNSSEC validation failures

7 years agonss-resolve: return NOTFOUND instead of UNAVAIL on resolution errors
Martin Pitt [Fri, 16 Sep 2016 06:27:39 +0000 (08:27 +0200)]
nss-resolve: return NOTFOUND instead of UNAVAIL on resolution errors

It needs to be possible to tell apart "the nss-resolve module does not exist"
(which can happen when running foreign-architecture programs) from "the queried
DNS name failed DNSSEC validation" or other errors. So return NOTFOUND for these
cases too, and only keep UNAVAIL for the cases where we cannot handle the given
address family.

This makes it possible to configure a fallback to "dns" without breaking
DNSSEC, with "resolve [!UNAVAIL=return] dns". Add this to the manpage.

This does not change behaviour if resolved is not running, as that already
falls back to the "dns" glibc module.

Fixes #4157

7 years agoman: drop myhostname from recommended nsswitch host configuration
Martin Pitt [Sat, 1 Oct 2016 14:54:45 +0000 (16:54 +0200)]
man: drop myhostname from recommended nsswitch host configuration

resolve includes myhostname functionality, so there is no need to add it again.

7 years agonss-resolve: simplify error handling
Martin Pitt [Fri, 16 Sep 2016 08:57:06 +0000 (10:57 +0200)]
nss-resolve: simplify error handling

Handle general errors from the resolved call in _nss_resolve_gethostbyaddr2_r()
the same say as in the other variants: Just "goto fail" as that does exactly
the same.

7 years agocore: update warning message
Zbigniew Jędrzejewski-Szmek [Fri, 30 Sep 2016 11:35:07 +0000 (13:35 +0200)]
core: update warning message

"closing all" might suggest that _all_ fds received with the notification message
will be closed. Reword the message to clarify that only the "unused" ones will be
closed.

7 years agocore: get rid of unneeded state variable
Zbigniew Jędrzejewski-Szmek [Fri, 30 Sep 2016 11:34:10 +0000 (13:34 +0200)]
core: get rid of unneeded state variable

No functional change.

7 years agonetworkd: fix "parametres" typo (#4244)
Elias Probst [Fri, 30 Sep 2016 11:25:25 +0000 (13:25 +0200)]
networkd: fix "parametres" typo (#4244)

7 years agoMerge pull request #4225 from keszybz/coredump
Martin Pitt [Fri, 30 Sep 2016 09:16:51 +0000 (11:16 +0200)]
Merge pull request #4225 from keszybz/coredump

coredump: remove Storage=both support, various fixes for sd-coredump and coredumpctl

7 years agoresolved: don't query domain-limited DNS servers for other domains (#3621)
Martin Pitt [Fri, 30 Sep 2016 07:30:08 +0000 (09:30 +0200)]
resolved: don't query domain-limited DNS servers for other domains (#3621)

DNS servers which have route-only domains should only be used for
the specified domains. Routing queries about other domains there is a privacy
violation, prone to fail (as that DNS server was not meant to be used for other
domains), and puts unnecessary load onto that server.

Introduce a new helper function dns_server_limited_domains() that checks if the
DNS server should only be used for some selected domains, i. e. has some
route-only domains without "~.". Use that when determining whether to query it
in the scope, and when writing resolv.conf.

Extend the test_route_only_dns() case to ensure that the DNS server limited to
~company does not appear in resolv.conf. Add test_route_only_dns_all_domains()
to ensure that a server that also has ~. does appear in resolv.conf as global
name server. These reproduce #3420.

Add a new test_resolved_domain_restricted_dns() test case that verifies that
domain-limited DNS servers are only being used for those domains. This
reproduces #3421.

Clarify what a "routing domain" is in the manpage.

Fixes #3420
Fixes #3421

7 years agopid1: more informative error message for ignored notifications
Zbigniew Jędrzejewski-Szmek [Thu, 29 Sep 2016 14:07:41 +0000 (16:07 +0200)]
pid1: more informative error message for ignored notifications

It's probably easier to diagnose a bad notification message if the
contents are printed. But still, do anything only if debugging is on.

7 years agopid1: process zero-length notification messages again
Zbigniew Jędrzejewski-Szmek [Thu, 29 Sep 2016 14:06:02 +0000 (16:06 +0200)]
pid1: process zero-length notification messages again

This undoes 531ac2b234. I acked that patch without looking at the code
carefully enough. There are two problems:
- we want to process the fds anyway
- in principle empty notification messages are valid, and we should
  process them as usual, including logging using log_unit_debug().