Commit Graph

49626 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
addddf565b os-release: add the DEFAULT_HOSTNAME= setting
The motivation is that variants of the same distro that share the same compiled
rpm want to customize various aspects of the system, in particular the
hostname. In some sense the default hostname is part of the identity of the
system, so setting it through os-release makes sense. In particular, instead of
setting a default value in /etc/hostname, the appropriate default can be baked
into the image, leaving /etc/hostname for local overrides only.

Why make this a separate field instead of e.g. using NAME from os-release?
NAME is already used for other purposes, and it seems likely that people want
to set those independently.
2021-02-22 20:10:55 +01:00
Zbigniew Jędrzejewski-Szmek
aa96ef86a7 man: use ~/.config instead of XDG_CONFIG_HOME
e3820eeaf1 did that replacement XDG_CONFIG_HOME, in one
of two places. Let's use ~/.config everywhere.

Quoting https://github.com/systemd/systemd/pull/18704#discussion_r579465254:
> I'd really drop XDG_CONFIG_HOME from the docs. It's confusing enough as it
> is. Where we don't need the indirections we should not confuse people with
> it, in particular as people might then think it's actually a good idea to use
> that env var and redirect things. I'd just show the literal path everywhere,
> even if we internally use the env var.
2021-02-22 20:10:55 +01:00
Zbigniew Jędrzejewski-Szmek
d55ed7de34 manager: add ManagerEnvironment configuration setting
This is useful for various variables that modify process behaviour. This makes
it easy to set it for pid1 without touching the kernel command line. Even for
the *user manager* this also can be convenient for the unprivileged user, who
cannot modify user@.service definition.

Variables that could be set like this include $SD_EVENT_PROFILE_DELAYS,
$SYSTEMD_FALLBACK_HOSTNAME, $SYSTEMD_MEMPOOL, $SYSTMED_RDRAND, etc.
2021-02-22 20:10:55 +01:00
Zbigniew Jędrzejewski-Szmek
fa256f43e7 basic/env-util: add putenv_dup() 2021-02-22 20:10:55 +01:00
Zbigniew Jędrzejewski-Szmek
f70e6fb471 manager: read ~/.config/systemd/user.conf in user mode
This changes the paths we read user manager config from in two ways:

- split-usr-root paths are dropped. The user manager is a poster boy for
  non-early-boot, so reading dropins only from /usr is appropriate.

- we look at ~/.config/systemd/user.conf. Users should be allowed to override
  their own config.

As user managers become more and more used, it becomes more important for users
to customize their own daemon. By reading from ~/.config, this is possible
without privileges.
2021-02-22 10:03:07 +01:00
Zbigniew Jędrzejewski-Szmek
8b8024f1c2 shared/conf-parser: allow more than one location of the main config file
No functional change as long as only one path is passed.
2021-02-21 12:22:13 +01:00
Yu Watanabe
38ba3da0a1 network: rename UseFQDN= -> UseHostname=
Prompted by
https://github.com/systemd/systemd/pull/18543#issuecomment-780798451.
2021-02-18 21:47:37 +01:00
Lennart Poettering
988338eb19 Merge pull request #18685 from poettering/network-type-tweaks
sd-network.h type tweaks
2021-02-18 21:19:51 +01:00
Lennart Poettering
1a8900e7ed random-util: fix type of random_u64_range()
As the name of the function suggests this is supposed to return
uint64_t, of course. Fix it. Not sure how this mistake happened in the
first place...
2021-02-18 21:19:23 +01:00
Lennart Poettering
e55daa2599 Merge pull request #18546 from poettering/sd-device-action
export sd_device_get_action() API + more
2021-02-18 20:54:25 +01:00
chri2
ba2b8f9239 https://github.com/systemd/systemd/issues/15360
The additional rules fix a firmware bug in the en keyboard of Librem notebooks by Purism.

By doing so the break the keyboard with other layouts which do not have the same bug in their firmware.
2021-02-18 20:49:12 +01:00
Lennart Poettering
f715584018 resolved: improve debug logging on incoming messages a bit 2021-02-18 20:34:18 +01:00
Zbigniew Jędrzejewski-Szmek
e133c454b1 Merge pull request #18679 from keszybz/rfkill-size-leniency
struct rfkill_event read/write size leniency
2021-02-18 19:53:25 +01:00
Lennart Poettering
0eaee8281d journald: when we fail to add a new entry to a journal, return the seqno
Fixes: #18005
2021-02-18 18:30:52 +01:00
Lennart Poettering
ff03bfa508 udevadm: after validating action, use our internal string instead of optarg
This doesn't really change anything, but feels nicer, since it abstracts
away what device_action_from_string()/device_action_to_string() do
internally, and always uses a normalized action string (yes, there's no
ambiguity, but it's nice to stay abstract, maybe one day there is
ambiguity around this)
2021-02-18 18:21:25 +01:00
Lennart Poettering
a113002214 sd-device: add sd_device_get_action() + sd_device_get_seqnum() + sd_device_new_from_stat_rdev()
To make sd-device properly usable for all programs we need to provide an
API for the "action" field of an event, it's one of the most relevant
ones, and it was so far missing.

This also adds sd_device_get_seqnum(), which isn't that interesting,
except for generating pretty debug output, which we use it ourselves
for.

This also makes device_new_from_stat_rdev() public, as it is truly
useful, as we can see in our own uses of it, and I think is fairly
generic to show up in the public APIs.
2021-02-18 18:20:56 +01:00
Lennart Poettering
669963968c Merge pull request #18664 from poettering/resolved-defrag
resolved: many UDP fragmentation tweaks
2021-02-18 18:20:36 +01:00
Lennart Poettering
96fb82aa06 sd-device: don't compare pointers with numeric zero
Our coding style says no to this.
2021-02-18 18:20:09 +01:00
Lennart Poettering
5f94d96c47 Merge pull request #18667 from poettering/resolved-change-notification
resolved: optimize dbus change notification signals a bit
2021-02-18 18:19:09 +01:00
Lennart Poettering
135c4aad4c network: tighten table alignment a bit 2021-02-18 18:17:16 +01:00
Lennart Poettering
2324fd3a39 network: suffix types with _t in public headers
Apparently, in our current public headers (i.e. those called sd-*.h) we
suffixed typedefs that we use as values with _t, but we didn't do this
for enum typedefs. Fix that while this stuff is not actually public yet.

With this scheme "value typedefs" now end systematically in _t, and
"object typedefs" (i.e. structures that are typically passed around via
pointers and not values) do not.

No code changes, just some renaming.
2021-02-18 18:17:16 +01:00
Lennart Poettering
cbf23f3853 resolved: optimize change notification handling away if bus calls set the same values as were already set
Prompted-by: #17577 (but doesn't fix this, since this commit only
handles D-Bus-induced changes, not the ones made via networkd)
2021-02-18 16:38:27 +01:00
Lennart Poettering
e4304fb8d4 basic: add set_equal() helper 2021-02-18 16:38:27 +01:00
Lennart Poettering
980821f3f0 resolved: take fragment size into consideration when determining EDNS0 udp packet size 2021-02-18 15:55:58 +01:00
Lennart Poettering
acbf761b5d resolved: let's track fragment sizes of servers/retry on fragmenting
Fragmenting sucks, let's avoid it. Thus let's start tracking the maximum
fragment size we receive.

Also, let's redo a transaction via TCP if we see fragmenting on UDP, as
effective mitigation against DNS fragment attacks.
2021-02-18 15:55:58 +01:00