Commit Graph

5737 Commits

Author SHA1 Message Date
Yu Watanabe 84a1ff9457 tree-wide: fix typo 2020-12-16 18:30:15 +01:00
Yu Watanabe 24ee0f9d16 tree-wide: fix typo 2020-12-16 17:21:48 +01:00
Zbigniew Jędrzejewski-Szmek 60e4fb4240 hostnamed,shared/hostname-setup: expose the origin of the current hostname
In hostnamed this is exposed as a dbus property, and in the logs in both
places.

This is of interest to network management software and such: if the fallback
hostname is used, it's not as useful as the real configured thing. Right now
various programs try to guess the source of hostname by looking at the string.
E.g. "localhost" is assumed to be not the real hostname, but "fedora" is. Any
such attempts are bound to fail, because we cannot distinguish "fedora" (a
fallback value set by a distro), from "fedora" (received from reverse dns),
from "fedora" read from /etc/hostname.

/run/systemd/fallback-hostname is written with the fallback hostname when
either pid1 or hostnamed sets the kernel hostname to the fallback value. Why
remember the fallback value and not the transient hostname in /run/hostname
instead?
We have three hostname types: "static", "transient", fallback".
– Distinguishing "static" is easy: the hostname that is set matches what
  is in /etc/hostname.
– Distingiushing "transient" and "fallback" is not easy. And the
  "transient" hostname may be set outside of pid1+hostnamed. In particular,
  it may be set by container manager, some non-systemd tool in the initramfs,
  or even by a direct call. All those mechanisms count as "transient". Trying
  to get those cases to write /run/hostname is futile. It is much easier to
  isolate the "fallback" case which is mostly under our control.
And since the file is only used as a flag to mark the hostname as fallback,
it can be hidden inside of our /run/systemd directory.

For https://bugzilla.redhat.com/show_bug.cgi?id=1892235.
2020-12-16 11:03:36 +01:00
Zbigniew Jędrzejewski-Szmek d39079fcaa hostnamed: stop discriminating against "localhost" in /etc/hostname
We would sometimes ignore localhost-style names in /etc/hostname. That is
brittle. If the user configured some hostname, it's most likely because they
want to use that as the hostname. If they don't want to use such a hostname,
they should just not create the config. Everything becomes simples if we just
use the configured hostname as-is.

This behaviour seems to have been a workaround for Anaconda installer and other
tools writing out /etc/hostname with the default of "localhost.localdomain".
Anaconda PR to stop doing that: https://github.com/rhinstaller/anaconda/pull/3040.
That might have been useful as a work-around for other programs misbehaving if
/etc/hostname was not present, but nowadays it's not useful because systemd
mostly controls the hostname and it is perfectly happy without that file.

Apart from making things simpler, this allows users to set a hostname like
"localhost" and have it honoured, if such a whim strikes them.
2020-12-16 11:02:18 +01:00
Zbigniew Jędrzejewski-Szmek ce6b138c75 hostnamed: expose the fallback-hostname setting as a const dbus property
Various users want to know what the fallback hostname is. Since it was made
configurable in 8146c32b92, we didn't expose this
nicely.
2020-12-16 10:54:57 +01:00
Zbigniew Jędrzejewski-Szmek de31bbc6b1 man/hostnamectl,hostaned,hostname1: adjust the docs to match reality
The semantics were significantly changed in c779a44222
("hostnamed: Fix the way that static and transient host names interact", Feb. 2014),
but when the dbus api documentation was imported much later, it wasn't properly
adjusted to describe those new semantics.

34293dfafd which added systemd.hostname= also
added new behaviour.

Let's ove various bits and pieces around so that they are in more appropriate
places. Drop recommendations to set the hostname for DHCP or mDNS purposes.
Nowadays we expect tools that want to expose some different hostname to the
outside to manage that internally without affecting visible state. Also drop
mentions of DHCP or mDNS directly setting the hostname, since nowadays network
management software is expected to (and does) go through hostnamed.

Also, add a high-level description of semantics. It glosses over the details of
handling of localhost-style names. Later commits will remove this special handling
anyway.
2020-12-16 10:54:57 +01:00
Michal Fabik a2be8be2cf coredumpctl: Add --debugger-args= option
This commit adds the possibility to pass command line options to the
debugger invoked with coredumpctl debug.

Resolves: #9905
2020-12-16 12:42:53 +09:00
Susant Sahani 937e305e93 network: Allow to configure interface promiscuous mode 2020-12-15 20:25:08 +00:00
Lennart Poettering ba4a31b7a6 man: document new ability to connect to user of container 2020-12-15 18:01:01 +01:00
Susant Sahani e81a44bf5f timesync: Make delaying attempts to contact servers configurable
```
❯ ssh sus@xx.xx.xx.xx
Last login: Sat Nov 14 17:32:08 2020 from 10.104.45.138
 17:36:19 up 0 min,  0 users,  load average: 0.00, 0.00, 0.00
> systemd-analyze blame
Bootup is not yet finished (org.freedesktop.systemd1.Manager.FinishTimestampMonotonic=0).
Please try again later.
Hint: Use 'systemctl list-jobs' to see active jobs
> systemd-analyze blame
43.954s systemd-time-wait-sync.service
 1.969s systemd-networkd-wait-online.service
 1.559s cloud-init-local.service
 1.039s cloud-init.service
  414ms cloud-final.service
  387ms dracut-initqueue.service
  382ms initrd-switch-root.service
  380ms cloud-config.service
  198ms systemd-journal-flush.service
  136ms systemd-udev-trigger.service
  115ms initrd-parse-etc.service
   97ms systemd-timesyncd.service
   84ms systemd-journald.service

```

After made it configurable and set to 5s

```
❯ ssh sus@xx.xx.xx.xx
Last login: Sat Nov 14 18:41:42 2020 from 10.104.45.138
 18:42:36 up 0 min,  0 users,  load average: 0.16, 0.03, 0.01
> systemd-analyze blame
10.450s systemd-time-wait-sync.service
 8.303s systemd-networkd-wait-online.service
 1.621s cloud-init-local.service
 1.068s cloud-init.service
```
2020-12-15 08:52:51 +09:00
Yu Watanabe 28423d9a75 tree-wide: fix typo 2020-12-14 12:05:55 +00:00
Yu Watanabe 563a94d080 man: mention new OPTIONS=log_level= udev rule 2020-12-10 12:33:34 +09:00
Lennart Poettering eef34a1d8f man: document that automount units are privileged
Fixes: #17886
2020-12-09 18:25:32 +01:00
Yu Watanabe 78bc702503 man: synthetize(d) -> synthesize(d) 2020-12-08 09:24:11 +01:00
Torsten Hilbrich 88fc9c9bad systemd-nspawn: Allow setting ambient capability set
The old code was only able to pass the value 0 for the inheritable
and ambient capability set when a non-root user was specified.

However, sometimes it is useful to run a program in its own container
with a user specification and some capabilities set. This is needed
when the capabilities cannot be provided by file capabilities (because
the file system is mounted with MS_NOSUID for additional security).

This commit introduces the option --ambient-capability and the config
file option AmbientCapability=. Both are used in a similar way to the
existing Capability= setting. It changes the inheritable and ambient
set (which is 0 by default). The code also checks that the settings
for the bounding set (as defined by Capability= and DropCapability=)
and the setting for the ambient set (as defined by AmbientCapability=)
are compatible. Otherwise, the operation would fail in any way.

Due to the current use of -1 to indicate no support for ambient
capability set the special value "all" cannot be supported.

Also, the setting of ambient capability is restricted to running a
single program in the container payload.
2020-12-07 19:56:59 +01:00
Lennart Poettering bce334a31c core: add ConditionSecurity=tpm2 support 2020-12-03 12:03:58 +01:00
Steve Ramage 7d27d39aa7
Adds missing documentation for Assertions (#17825) 2020-12-03 08:47:24 +09:00
walbit-de 2d453f3597
network: add Protocol= to vlan netdev (#17794) 2020-12-02 14:58:02 +01:00
Yu Watanabe da115b935a tree-wide: fix typos 2020-12-02 10:53:33 +01:00
Zbigniew Jędrzejewski-Szmek 0a67dd8310
Merge pull request #17692 from yuwata/ipv4ll
network: fold ipv4ll fallback modes into normal ipv4ll addressing
2020-12-01 21:59:30 +01:00
Zbigniew Jędrzejewski-Szmek f319b2b1b0
Merge pull request #17703 from poettering/event-ratelimit
sd-event: add a concept of ratelimiting
2020-12-01 21:47:43 +01:00
Lennart Poettering a303686fc1 man: document new ratelimiting APIs 2020-12-01 15:15:39 +01:00
Lennart Poettering 59d6f7b097 man: drop comment about ECC vs. RSA and Yubikey
The comment is pointless, ECC systematically doesn't allow
encryption/decryption directly, only RSA does that. If you want to use
ECC for asymmetric encryption/decryption you have to combine it with key
exchange scheme and symmetric scheme. This all is not a limitation of
the Yubikey, hence don't claim so. It's just how ECC is.
2020-12-01 14:27:33 +01:00
Lennart Poettering 96e9a9a4e6 man: document how cryptsetup keys may be acquired via AF_UNIX sockets 2020-12-01 14:27:12 +01:00
Lennart Poettering ce82de671f man: mention that --key= is about *secret* keys 2020-12-01 14:17:47 +01:00
igo95862 1edc1f1b62 man: Speicfy exact return values of sd_bus_message_enter_container 2020-11-30 12:21:20 +01:00
Zbigniew Jędrzejewski-Szmek 0107b769b1 networkd: start ipv4ll when dhcp has trouble getting a lease
Fixes #13316.
2020-11-30 12:37:36 +09:00
Zbigniew Jędrzejewski-Szmek 3ca1fab70a networkd: merge ll addressing fallback modes into normal "boolean" values
They are not really boolean, because we have both ipv4 and ipv6, but
for each protocol we have either unset, no, and yes.

From https://github.com/systemd/systemd/issues/13316#issuecomment-582906817:
LinkLocalAddressing must be a boolean option, at least for ipv4:
- LinkLocalAddressing=no => no LL at all.

- LinkLocalAddressing=yes + Static Address => invalid configuration, warn and
  interpret as LinkLocalAddressing=no, no LL at all.

(we check that during parsing and reject)

- LinkLocalAddressing=yes + DHCP => LL process should be subordinated to the
  DHCP one, an LL address must be acquired at start or after a short N
  unsuccessful DHCP attemps, and must not stop DHCP to keeping trying. When a
  DHCP address is acquired, drop the LL address. If the DHCP address is lost,
  re-adquire a new LL address.

(next patch will move in this direction)

- LinkLocalAddressing=fallback has no reason to exist, because LL address must
  always be allocated as a fallback option when using DHCP. Having both DHCP
  and LL address at the same time is an RFC violation, so
  LinkLocalAdressing=yes correctly implemented is already the "fallback"
  behavior. The fallback option must be deprecated and if present in older
  configs must be interpreted as LinkLocalAddressing=yes.

(removed)

- And for IPv6, the LinkLocalAddress option has any sense at all? IPv6-LL
  address aren't required to be always set for every IPv6 enabled interface (in
  this case, coexisting with static or dynamic address if any)? Shouldn't be
  always =yes?

(good question)

This effectively reverts 29e81083bd. There is no
special "fallback" mode now, so the check doesn't make sense anymore.
2020-11-30 12:37:36 +09:00
Zbigniew Jędrzejewski-Szmek 573b02f5c1 man: adjust description of MaxAttempts
The code was changed in 715cedfbf0 to allow more than
six attempts and the old description stopped making sense.
2020-11-30 12:37:36 +09:00
Pavel Sapezhko 6d8325f66a resolved: allow cache responses from local DNS servers 2020-11-27 09:03:42 +09:00
Yu Watanabe 7a1fe27f81 man: slightly update the man page of sd_bus_message_read_basic()
Follow-up for 73a1d7d243.
2020-11-25 14:52:40 +01:00
igo95862 78c4f2f153 man: Fixed an incomplete sentence 2020-11-25 22:27:17 +09:00
igo95862 73a1d7d243 man: Specify that sd_bus_message_read_basic returns 0 if end of array had been reached. 2020-11-25 14:10:26 +01:00
Zbigniew Jędrzejewski-Szmek 9642983a51
Merge pull request #17715 from yuwata/specifier-follow-ups
Sort specifiers
2020-11-25 13:22:56 +01:00
Pavel Sapezhko 77f5277a7a man: clarify DefaultTasksMax doc 2020-11-25 12:28:05 +01:00
Yu Watanabe 48e0abb535 tree-wide: fix typo 2020-11-25 09:48:17 +01:00
Yu Watanabe 55318801ba man: sort specifiers alphabetically 2020-11-25 14:39:10 +09:00
Yu Watanabe 46a3adeef3 man: add missing specifiers supported in [INSTALL] section 2020-11-25 14:38:50 +09:00
Lennart Poettering 567fe1d570
Merge pull request #17680 from yuwata/udev-link-mac-address
udev: to make MACAddress= take effect, MACAddressPolicy= must be "none"
2020-11-24 17:42:45 +01:00
Yu Watanabe ca91ce3a33 man: bootctl set-default/oneshot accept an empty string 2020-11-24 11:17:37 +01:00
Dimitri John Ledkov 499f0f8209 gpt: add RISC-V GPT partition typecode uuid 2020-11-23 22:15:36 +01:00
vanou 207194c67f man: Fix misspelling of directive and typos in systemd-coredump man page
This commit fixes
 * misspelling of LimitCORE directive of systemd.exec
 * typos
in systemd-coredump man page.
2020-11-23 13:49:53 +01:00
Yu Watanabe 6ca4a07077 man: to make MACAddress= take effect, MACAddressPolicy= must be "none" 2020-11-20 23:07:21 +09:00
Lennart Poettering bb4cbb25d4 man: suffix settings name with = and enclose in <varname> 2020-11-19 16:16:17 +01:00
igo95862 0e577869f3 man: Fix sd_bus_message_append_array_space function signature 2020-11-18 18:26:14 +09:00
Yu Watanabe 10f3484950 man,NEWS: fix "the the" 2020-11-18 16:27:14 +09:00
Zbigniew Jędrzejewski-Szmek 485a9202ba
Merge pull request #17643 from keszybz/man-news-independent
NEWS and man page tweaks
2020-11-17 17:14:14 +01:00
Zbigniew Jędrzejewski-Szmek 905a03e71d NEWS,man: improve descriptions of Independent=
In NEWS, the new option was described twice, most likely because the first
description was tucked away in a paragraph about some other subject.

While at it, improve the descriptions in the man page to make it easier to grok
what that option really does.
2020-11-17 12:37:44 +01:00
Zbigniew Jędrzejewski-Szmek de70ff66dc man: drop misplaced phrase
I think it was added in 6c2b9c8da1 as c&p.
2020-11-17 11:46:50 +01:00
igo95862 e6ce785d61 man: Add a paragraph to sd_bus_call explaning callback message lifetime 2020-11-17 11:13:10 +01:00