summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * sd-boot: Detect windows boot loader title from BCDJan Janssen2021-08-161-3/+51
| |
| * sd-boot: Add memmem_safe and memory_startswithJan Janssen2021-08-164-16/+38
| |
| * sd-boot: Try harder to detect ourselvesJan Janssen2021-08-162-15/+37
| | | | | | | | | | By moving our magic string into its own PE section, we can forego grepping for it.
| * sd-boot: Fix PE section parsingJan Janssen2021-08-1610-102/+150
| | | | | | | | | | | | | | We only need the PE header offset from the DOS header, not its size. Previously, the section table could be cut off in the middle. While we are at it, also modernize the remaining code.
* | Don't open /var journals in volatile mode when runtime_journal==NULLMilo Turner2021-08-131-0/+7
|/
* Merge pull request #20432 from yuwata/network-recreate-stacked-netdevsYu Watanabe2021-08-1310-80/+92
|\ | | | | network: recreate stacked netdevs when underlying device is re-added
| * network: recreate stacked netdevs when underlying device is re-addedYu Watanabe2021-08-121-8/+27
| | | | | | | | Closes #20430.
| * network: adjust log messages, function names, etc.Yu Watanabe2021-08-125-18/+17
| |
| * network: use netdev_enter_failed() instead of netdev_drop() on errorYu Watanabe2021-08-127-11/+11
| | | | | | | | Preparation for later commits to support reconfiguring netdevs.
| * network: introduce a helper function netdev_is_stacked_and_independent()Yu Watanabe2021-08-121-43/+37
| |
* | resolved: retry on SERVFAIL before downgrading feature levelSteven Siloti2021-08-132-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | The SERVFAIL RCODE can be generated for many reasons which may not be related to lack of feature support. For example, the Stubby resolver generates SERVFAIL when a request times out. Such transient failures can cause unnecessary downgrades to both the transaction and the server's feature level. The consequences of this are especially severe if the server is in DNSSEC strict mode. In this case repeated downgrades eventually cause the server to stop resolving entirely with the error "incompatible-server". To avoid unnecessary downgrades the request should be retried once with the current level before the transaction's feature level is downgraded.
* | Merge pull request #20233 from maanyagoenka/log-errorLennart Poettering2021-08-139-66/+205
|\ \ | | | | | | systemd-analyze: add option to return an error value when unit verification fails
| * | systemd-analyze: option to exit with an error when 'verify' failsMaanya Goenka2021-08-126-59/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit introduces a callback invoked from log_syntax_internal. Use it from systemd-analyze to gather a list of units that contain syntax warnings. A new command line option is added to make use of this. The new option --recursive-errors takes in three possible modes: 1. yes - which is the default. systemd-analyze exits with an error when syntax warnings arise during verification of the specified units or any of their dependencies. 3. no - systemd-analyze exits with an error when syntax warnings arise during verification of only the selected unit. Analyzing and loading any dependencies will be skipped. 4. one - systemd-analyze exits with an error when syntax warnings arise during verification of only the selected units and their direct dependencies. Below are two service unit files that I created for the purposes of testing: 1. First, we run the commands on a unit that does not have dependencies but has a non-existing key-value setting (i.e. foo = bar). > cat <<EOF>testcase.service [Unit] foo = bar [Service] ExecStart = echo hello EOF OUTPUT: maanya-goenka@debian:~/systemd (log-error)$ sudo build/systemd-analyze verify testcase.service /home/maanya-goenka/systemd/testcase.service:2: Unknown key name 'foo' in section 'Unit', ignoring. /usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed. /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly. /usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. maanya-goenka@debian:~/systemd (log-error)$ echo $? 1 maanya-goenka@debian:~/systemd (log-error)$ sudo build/systemd-analyze verify --recursive-errors=yes testcase.service /home/maanya-goenka/systemd/testcase.service:2: Unknown key name 'foo' in section 'Unit', ignoring. /usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed. /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly. /usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. maanya-goenka@debian:~/systemd (log-error)$ echo $? 1 maanya-goenka@debian:~/systemd (log-error)$ sudo build/systemd-analyze verify --recursive-errors=no testcase.service /home/maanya-goenka/systemd/testcase.service:2: Unknown key name 'foo' in section 'Unit', ignoring. maanya-goenka@debian:~/systemd (log-error)$ echo $? 1 maanya-goenka@debian:~/systemd (log-error)$ sudo build/systemd-analyze verify --recursive-errors=one testcase.service /home/maanya-goenka/systemd/testcase.service:2: Unknown key name 'foo' in section 'Unit', ignoring. /usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed. /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly. /usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. maanya-goenka@debian:~/systemd (log-error)$ echo $? 1 2. Next, we run the commands on a unit that is syntactically valid but has a non-existing dependency (i.e. foo2.service) > cat <<EOF>foobar.service [Unit] Requires = foo2.service [Service] ExecStart = echo hello EOF OUTPUT: maanya-goenka@debian:~/systemd (log-error)$ sudo build/systemd-analyze verify foobar.service /usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed. /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly. /usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. foobar.service: Failed to create foobar.service/start: Unit foo2.service not found. maanya-goenka@debian:~/systemd (log-error)$ echo $? 1 maanya-goenka@debian:~/systemd (log-error)$ sudo build/systemd-analyze verify --recursive-errors=yes foobar.service /usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed. /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly. /usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. foobar.service: Failed to create foobar.service/start: Unit foo2.service not found. maanya-goenka@debian:~/systemd (log-error)$ echo $? 1 maanya-goenka@debian:~/systemd (log-error)$ sudo build/systemd-analyze verify --recursive-errors=no foobar.service maanya-goenka@debian:~/systemd (log-error)$ echo $? 0 maanya-goenka@debian:~/systemd (log-error)$ sudo build/systemd-analyze verify --recursive-errors=one foobar.service /usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed. /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly. /usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. foobar.service: Failed to create foobar.service/start: Unit foo2.service not found. maanya-goenka@debian:~/systemd (log-error)$ echo $? 1
| * | manager: add a test flag to ignore dependenciesMaanya Goenka2021-08-122-5/+18
| | | | | | | | | | | | | | | | | | | | | The MANAGER_TEST_RUN_IGNORE_DEPENDENCIES flag was added in order to allow the caller to skip the recursive loading of dependency units when loading specific unit files. This includes the default dependencies, the specified dependencies, the slice. This will be used by systemd-analyze to allow checking individual unit files in isolation.
| * | manager: use FLAGS_SET when checking for MANAGER_TEST_RUN_MINIMALMaanya Goenka2021-08-121-2/+2
| | | | | | | | | | | | Allows multiple flags to be set, for example, in systemd-analyze.
* | | Merge pull request #20350 from medhefgo/bootLennart Poettering2021-08-1320-254/+510
|\ \ \ | |/ / |/| | Grab bag of sd-boot improvements
| * | sd-boot: Allow on/off and t/f for booleans tooJan Janssen2021-08-121-2/+6
| | |
| * | sd-boot: Provide error messages when parsing a config option failsJan Janssen2021-08-121-19/+14
| | |
| * | sd-boot: Rework console input handlingJan Janssen2021-08-123-68/+91
| | | | | | | | | | | | | | | Fixes: #15847 Probably fixes: #19191
| * | sd-boot: Use StrSize where it makes senseJan Janssen2021-08-123-15/+15
| | |
| * | sd-boot: Assert all the things!Jan Janssen2021-08-1212-7/+247
| | |
| * | sd-boot: Add assert implementationJan Janssen2021-08-123-3/+30
| | | | | | | | | | | | | | | | | | There is a ASSERT() macro from gnu-efi, but that does not show any output to ConOut. Having to do some additional setup just to get some debug output is tedious and outright difficult on real hardware.
| * | sd-boot: Fix possible null pointer dereferenceJan Janssen2021-08-121-1/+1
| | | | | | | | | | | | | | | Auto entries are showing garbage for the version in print_status() because StrDuplicate does not expect null pointers.
| * | sd-boot: Don't use magic integer constantsJan Janssen2021-08-121-9/+9
| | |
| * | sd-boot: Unify error handlingJan Janssen2021-08-125-110/+75
| | | | | | | | | | | | | | | | | | | | | log_error_stall() and log_error_status_stall() will ensure the user has a chance to catch an error message by stalling and also forcing a lightred/black color on it. Also, convert several Print() calls to it since they are actually error messages.
| * | macro: Move some macros to macro-fundamental.hJan Janssen2021-08-113-23/+25
| | | | | | | | | | | | Also, make sure STRLEN works with wide strings too.
* | | Merge pull request #20199 from ddstreet/unit_cgroup_catchupLennart Poettering2021-08-124-2/+31
|\ \ \ | | | | | | | | cgroup: do 'catchup' for unit cgroup inotify watch files
| * | | core: Make sure cgroup_oom_queue is flushed on manager exitMichal Koutný2021-08-052-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unit queues are not serialized/deserialized (they are recreated after reexec/reload instead). The destroyed units are not removed from the cgroup_oom_queue. That means the queue may contain possibly invalid pointers to released units. Fix this by removing the units from cgroup_oom_queue as we do for others. When at it, sync assert checks with currently existing queues and put them in order in the manager cleanup code.
| * | | cgroup: do 'catchup' for unit cgroup inotify watch filesDan Streetman2021-08-053-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While reexec/reload, we drop the inotify watch on cgroup file(s), so we need to re-check them in case they changed and we missed the event. Fixes: #20198
* | | | systemd-analyze: parse ip_filters_custom_egress correctlyMaanya Goenka2021-08-121-1/+1
| | | | | | | | | | | | | | | | Fixed bug in original assignment of security_info variable: ip_filters_custom_egress.
* | | | network: fix configuring of CAN devicesYu Watanabe2021-08-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fix a bug introduced by 7558f9e717381eef0ddc8ddfb5a754ea4b0f3e6c. Fixes #20428.
* | | | hostname: introduce gethostname_full() and use it in various gethostname() ↵Yu Watanabe2021-08-125-79/+65
| | | | | | | | | | | | | | | | variants
* | | | hostname: fix off-by-one issue in gethostname()Yu Watanabe2021-08-121-4/+4
| |_|/ |/| | | | | | | | | | | | | | gethostname() returns null-terminated hostname. Fixes #20309 and #20417.
* | | Merge pull request #20423 from yuwata/dhcp-server-static-lease-outside-poolLuca Boccassi2021-08-114-95/+88
|\ \ \ | | | | | | | | sd-dhcp-server: support static lease outside of pool
| * | | sd-dhcp-server: support static lease outside of address poolYu Watanabe2021-08-114-86/+79
| | | | | | | | | | | | | | | | Closes #20341.
| * | | sd-dhcp-server: fix possible double-free or use-after-freeYu Watanabe2021-08-111-1/+1
| | | |
| * | | sd-dhcp-server: use hashmap_ensure_put()Yu Watanabe2021-08-113-12/+12
| | | |
* | | | shared/copy: add a new flag COPY_ALL_XATTRSAndrej Lajovic2021-08-119-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the flag COPY_ALL_XATTRS is set, it causes the complete set of xattrs to be copied. If the flag is unset, only xattrs from the "user" namespace are copied. Fixes #17178.
* | | | Merge pull request #20419 from keszybz/setenv-no-valueLennart Poettering2021-08-1114-251/+267
|\ \ \ \ | |_|_|/ |/| | | Allow --setenv=FOO in various programs
| * | | activate: simplify/rework implementation of --setenvZbigniew Jędrzejewski-Szmek2021-08-111-59/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous implementation is simplified by using the new helper. The new code does more looping, but considering that it's unlikely that people set more than a handful of variables through commandline options, this should be OK. If a variable is specified on the command line, it overrides any automatically set variable. Effective behaviour was already were like this, because we would specify two variables, both would be set, and since glibc will return the first matching entry. ('systemd-socket-activate -E TERM=FOO -l 2000 --inetd -a env' would give 'TERM=FOO TERM=xterm-256color PATH=...', and getenv("TERM") returns "FOO".) But it's nicer to filter out any duplicate entries and only pass the intended variable to the child process.
| * | | activate: use global variable instead of passing char **envp aroundZbigniew Jędrzejewski-Szmek2021-08-111-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The effect should be the same, but the code is less verbose. In particular, the variable was called envp in parts of the code, but in other parts, we had a local envp variable, and envp was called env.
| * | | machinectl: allow --setenv=FOOZbigniew Jędrzejewski-Szmek2021-08-111-7/+3
| | | |
| * | | run: allow --setenv=FOOZbigniew Jędrzejewski-Szmek2021-08-111-3/+4
| | | |
| * | | homectl: allow --setenv=FOOZbigniew Jędrzejewski-Szmek2021-08-111-115/+111
| | | |
| * | | nspawn: allow --setenv=FOO as equivalent to --setenv=FOO=$FOOZbigniew Jędrzejewski-Szmek2021-08-111-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | systemd-socket-activate has supported such a mode since 5e65c93a433447b15180249166f7b3944c3e6156. '--setenv=FOO=$FOO' is a fairly common use in scripts, and it's nicer to do this automatically without worrying about quoting and whatnot. https://github.com/systemd/mkosi/pull/765 added the same to 'mkosi --environment='.
| * | | basic/env-util: add a mode where we pull in the variable value from environmentZbigniew Jędrzejewski-Szmek2021-08-113-0/+50
| | | |
| * | | test-env-util: extend the test for strv_env_merge() a bitZbigniew Jędrzejewski-Szmek2021-08-111-14/+11
| | | |
| * | | Add implicit sentinel to strv_env_merge()Zbigniew Jędrzejewski-Szmek2021-08-1111-38/+50
| | | | | | | | | | | | | | | | Just to make it a tiny bit nicer to use.
* | | | Merge pull request #20079 from maanyagoenka/img-supportLennart Poettering2021-08-1123-48/+125
|\ \ \ \ | |_|/ / |/| | | systemd-analyze: root validation and verify support for root arg and discrete images
| * | | systemd-analyze: add root to find and verify executableMaanya Goenka2021-08-103-14/+14
| | | |