summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | path-util: add path_startswith_strv()Zbigniew Jędrzejewski-Szmek2019-07-193-11/+37
| | |
| * | test-path-util: add function headersZbigniew Jędrzejewski-Szmek2019-07-191-0/+33
| | |
| * | systemctl: call the unit dbus path dbus_path everywhereZbigniew Jędrzejewski-Szmek2019-07-171-22/+22
| | | | | | | | | | | | | | | | | | Similar variables had differing names: unit, path, unit_path. We also have file system paths in surrounding code. Let's make this easier for the reader and use "dbus_path" consistently.
| * | pid1: kill unit_file_find_dropin_paths() helperZbigniew Jędrzejewski-Szmek2019-07-173-20/+9
| | | | | | | | | | | | | | | | | | It had two users, but it is just a very thin wrapper around unit_file_find_dropin_paths(), so using it seems more complicated than directly invoking unit_file_find_dropin_paths() twice.
| * | man: rework the description of Aliases and .wants/.requires directoriesZbigniew Jędrzejewski-Szmek2019-07-171-26/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The description of Alias= wasn't incorrect, but it sounded like Alias= creates a different type of dependency, while it's just a glorified way to create symlinks. Also recommend 'preset' in addition to 'enable'. Describe .wants/.requires dirs as equals, without implying that the [Install] section can only be used for .wants. The text was partially out of date (systemd-networkd.service now creates as alias in /etc, not /usr/lib, let's just not say anything about the full path).
* | | pstore: Tool to archive contents of pstoreEric DeVolder2019-07-1910-0/+656
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the systemd pstore service which will archive the contents of the Linux persistent storage filesystem, pstore, to other storage, thus preserving the existing information contained in the pstore, and clearing pstore storage for future error events. Linux provides a persistent storage file system, pstore[1], that can store error records when the kernel dies (or reboots or powers-off). These records in turn can be referenced to debug kernel problems (currently the kernel stuffs the tail of the dmesg, which also contains a stack backtrace, into pstore). The pstore file system supports a variety of backends that map onto persistent storage, such as the ACPI ERST[2, Section 18.5 Error Serialization] and UEFI variables[3 Appendix N Common Platform Error Record]. The pstore backends typically offer a relatively small amount of persistent storage, e.g. 64KiB, which can quickly fill up and thus prevent subsequent kernel crashes from recording errors. Thus there is a need to monitor and extract the pstore contents so that future kernel problems can also record information in the pstore. The pstore service is independent of the kdump service. In cloud environments specifically, host and guest filesystems are on remote filesystems (eg. iSCSI or NFS), thus kdump relies [implicitly and/or explicitly] upon proper operation of networking software *and* hardware *and* infrastructure. Thus it may not be possible to capture a kernel coredump to a file since writes over the network may not be possible. The pstore backend, on the other hand, is completely local and provides a path to store error records which will survive a reboot and aid in post-mortem debugging. Usage Notes: This tool moves files from /sys/fs/pstore into /var/lib/systemd/pstore. To enable kernel recording of error records into pstore, one must either pass crash_kexec_post_notifiers[4] to the kernel command line or enable via 'echo Y > /sys/module/kernel/parameters/crash_kexec_post_notifiers'. This option invokes the recording of errors into pstore *before* an attempt to kexec/kdump on a kernel crash. Optionally, to record reboots and shutdowns in the pstore, one can either pass the printk.always_kmsg_dump[4] to the kernel command line or enable via 'echo Y > /sys/module/printk/parameters/always_kmsg_dump'. This option enables code on the shutdown path to record information via pstore. This pstore service is a oneshot service. When run, the service invokes systemd-pstore which is a tool that performs the following: - reads the pstore.conf configuration file - collects the lists of files in the pstore (eg. /sys/fs/pstore) - for certain file types (eg. dmesg) a handler is invoked - for all other files, the file is moved from pstore - In the case of dmesg handler, final processing occurs as such: - files processed in reverse lexigraphical order to faciliate reconstruction of original dmesg - the filename is examined to determine which dmesg it is a part - the file is appended to the reconstructed dmesg For example, the following pstore contents: root@vm356:~# ls -al /sys/fs/pstore total 0 drwxr-x--- 2 root root 0 May 9 09:50 . drwxr-xr-x 7 root root 0 May 9 09:50 .. -r--r--r-- 1 root root 1610 May 9 09:49 dmesg-efi-155741337601001 -r--r--r-- 1 root root 1778 May 9 09:49 dmesg-efi-155741337602001 -r--r--r-- 1 root root 1726 May 9 09:49 dmesg-efi-155741337603001 -r--r--r-- 1 root root 1746 May 9 09:49 dmesg-efi-155741337604001 -r--r--r-- 1 root root 1686 May 9 09:49 dmesg-efi-155741337605001 -r--r--r-- 1 root root 1690 May 9 09:49 dmesg-efi-155741337606001 -r--r--r-- 1 root root 1775 May 9 09:49 dmesg-efi-155741337607001 -r--r--r-- 1 root root 1811 May 9 09:49 dmesg-efi-155741337608001 -r--r--r-- 1 root root 1817 May 9 09:49 dmesg-efi-155741337609001 -r--r--r-- 1 root root 1795 May 9 09:49 dmesg-efi-155741337710001 -r--r--r-- 1 root root 1770 May 9 09:49 dmesg-efi-155741337711001 -r--r--r-- 1 root root 1796 May 9 09:49 dmesg-efi-155741337712001 -r--r--r-- 1 root root 1787 May 9 09:49 dmesg-efi-155741337713001 -r--r--r-- 1 root root 1808 May 9 09:49 dmesg-efi-155741337714001 -r--r--r-- 1 root root 1754 May 9 09:49 dmesg-efi-155741337715001 results in the following: root@vm356:~# ls -al /var/lib/systemd/pstore/155741337/ total 92 drwxr-xr-x 2 root root 4096 May 9 09:50 . drwxr-xr-x 4 root root 40 May 9 09:50 .. -rw-r--r-- 1 root root 1610 May 9 09:50 dmesg-efi-155741337601001 -rw-r--r-- 1 root root 1778 May 9 09:50 dmesg-efi-155741337602001 -rw-r--r-- 1 root root 1726 May 9 09:50 dmesg-efi-155741337603001 -rw-r--r-- 1 root root 1746 May 9 09:50 dmesg-efi-155741337604001 -rw-r--r-- 1 root root 1686 May 9 09:50 dmesg-efi-155741337605001 -rw-r--r-- 1 root root 1690 May 9 09:50 dmesg-efi-155741337606001 -rw-r--r-- 1 root root 1775 May 9 09:50 dmesg-efi-155741337607001 -rw-r--r-- 1 root root 1811 May 9 09:50 dmesg-efi-155741337608001 -rw-r--r-- 1 root root 1817 May 9 09:50 dmesg-efi-155741337609001 -rw-r--r-- 1 root root 1795 May 9 09:50 dmesg-efi-155741337710001 -rw-r--r-- 1 root root 1770 May 9 09:50 dmesg-efi-155741337711001 -rw-r--r-- 1 root root 1796 May 9 09:50 dmesg-efi-155741337712001 -rw-r--r-- 1 root root 1787 May 9 09:50 dmesg-efi-155741337713001 -rw-r--r-- 1 root root 1808 May 9 09:50 dmesg-efi-155741337714001 -rw-r--r-- 1 root root 1754 May 9 09:50 dmesg-efi-155741337715001 -rw-r--r-- 1 root root 26754 May 9 09:50 dmesg.txt where dmesg.txt is reconstructed from the group of related dmesg-efi-155741337* files. Configuration file: The pstore.conf configuration file has four settings, described below. - Storage : one of "none", "external", or "journal". With "none", this tool leaves the contents of pstore untouched. With "external", the contents of the pstore are moved into the /var/lib/systemd/pstore, as well as logged into the journal. With "journal", the contents of the pstore are recorded only in the systemd journal. The default is "external". - Unlink : is a boolean. When "true", the default, then files in the pstore are removed once processed. When "false", processing of the pstore occurs normally, but the pstore files remain. References: [1] "Persistent storage for a kernel's dying breath", March 23, 2011. https://lwn.net/Articles/434821/ [2] "Advanced Configuration and Power Interface Specification", version 6.2, May 2017. https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf [3] "Unified Extensible Firmware Interface Specification", version 2.8, March 2019. https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf [4] "The kernel’s command-line parameters", https://static.lwn.net/kerneldoc/admin-guide/kernel-parameters.html
* | | Merge pull request #13070 from yuwata/network-set-route-to-dhcp-dnsZbigniew Jędrzejewski-Szmek2019-07-1911-64/+308
|\ \ \
| * | | test-network: add tests for routes to DNS servers provided by DHCPv4Yu Watanabe2019-07-192-1/+38
| | | |
| * | | network: add DHCPv4.RoutesToDNS= settingYu Watanabe2019-07-195-2/+15
| | | |
| * | | network: set routes to dns servers provided by DHCPv4Yu Watanabe2019-07-191-1/+95
| | | |
| * | | network: store routes provided by DHCPv4 in SetYu Watanabe2019-07-193-62/+63
| | | | | | | | | | | | | | | | This re-writes d03073ddcde6dd2d5604b70ff4184acbe0a7961a.
| * | | network: introduce route_full_hash_opsYu Watanabe2019-07-192-0/+99
| | | | | | | | | | | | | | | | Will be used later.
* | | | pid1: order jobs that execute processes with lower priorityZbigniew Jędrzejewski-Szmek2019-07-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can meaningfully compare jobs for units which have cpu weight or nice set. But non-exec units those have those set. Starting non-exec jobs first allows us to get them out of the queue quickly, and consider more jobs for starting. If we have service A, and socket B, and service C which is after socket B, and we want to start both A and C, and C has higher cpu weight, if we get B out of the way first, we'll know that we can start both A and C, and we'll start C first. Also invert the comparisons using CMP() so they are always done left vs. right, and negate when returning instead. Follow-up for da8e178296.
* | | | test: convert all uses of '|| true' into '|| :'Dan Streetman2019-07-192-9/+9
| | | | | | | | | | | | | | | | No change in functionality; just use the shorter || :
* | | | Merge pull request #13100 from 1848/neigh_ipv6Yu Watanabe2019-07-196-25/+36
|\ \ \ \ | | | | | | | | | | networkd: Neighbor IPv6 support for LinkLayerAddress
| * | | | test-network: add test for neighbor with ipv6 lladdrYu Watanabe2019-07-193-3/+22
| | | | |
| * | | | sd-netlink: update commentYu Watanabe2019-07-191-1/+1
| | | | |
| * | | | network: Added neighbor lladdr support for IPv618482019-07-192-21/+13
| | | | |
* | | | | docs: typo in arg name replace-irreversible -> replace-irreversiblyAnita Zhang2019-07-191-6/+6
|/ / / /
* | | | meson: update hint in man/rules/Zbigniew Jędrzejewski-Szmek2019-07-192-0/+4
| | | |
* | | | core: set shutdown watchdog on kexec tooLuca Boccassi2019-07-181-1/+1
|/ / / | | | | | | | | | | | | | | | | | | At the moment the shutdown watchdog is set only when rebooting. The set of "things that can go wrong" is not too far off when kexec'ing and in fact we have a use case where it would be useful - moving to a new kernel image.
* | | Merge pull request #13097 from poettering/mount-state-fixZbigniew Jędrzejewski-Szmek2019-07-182-32/+72
|\ \ \ | | | | | | | | Scan /proc/self/mountinfo before waitid() handling
| * | | mount: rename update_parameters_proc_self_mount_info() → ↵Lennart Poettering2019-07-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | update_parameters_proc_self_mountinfo() let's name the call like the file in /proc is actually called.
| * | | swap: scan /proc/swaps before processing waitid() resultsLennart Poettering2019-07-181-3/+15
| | | | | | | | | | | | | | | | | | | | Similar to the previous commit, but for /proc/swaps, where the same logic and rationale applies.
| * | | mount: rescan /proc/self/mountinfo before processing waitid() resultsLennart Poettering2019-07-181-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (The interesting bits about the what and why are in a comment in the patch, please have a look there instead of looking here in the commit msg). Fixes: #10872
| * | | mount: simplify /proc/self/mountinfo handlerLennart Poettering2019-07-181-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Our IO handler is only installed for one fd, hence there's no reason to conditionalize on it again. Also, split out the draining into a helper function of its own.
* | | | Merge pull request #13102 from mbiebl/nologin-pathZbigniew Jędrzejewski-Szmek2019-07-1823-61/+62
|\ \ \ \ | |/ / / |/| | | meson: make nologin path build time configurable
| * | | test: replace Makefile copy with a symlink for TEST-28-PERCENTJ-WANTEDBYMichael Biebl2019-07-181-9/+1
| | | | | | | | | | | | | | | | | | | | TEST-28-PERCENTJ-WANTEDBY/Makefile is identical to TEST-01-BASIC/Makefile so avoid duplication and use a symlink instead.
| * | | meson: make nologin path build time configurableMichael Biebl2019-07-1822-52/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some distros install nologin as /usr/sbin/nologin, others as /sbin/nologin. Since we can't really on merged-usr everywhere (where the path wouldn't matter), make the path build time configurable via -Dnologin-path=. Closes #13028
* | | | Merge pull request #12639 from michaelolbrich/job-orderLennart Poettering2019-07-187-10/+63
|\ \ \ \ | |_|_|/ |/| | | make the run queue order deterministic
| * | | job: make the run queue order deterministicMichael Olbrich2019-07-186-8/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jobs are added to the run queue in random order. This happens because most jobs are added by iterating over the transaction or dependency hash maps. As a result, jobs that can be executed at the same time are started in a different order each time. On small embedded devices this can cause a measurable jitter for the point in time when a job starts (~100ms jitter for 10 units that are started in random order). This results is a similar jitter for the boot time. This is undesirable in general and make optimizing the boot time a lot harder. Also, jobs that should have a higher priority because the unit has a higher CPU weight might get executed later than others. Fix this by turning the job run_queue into a Prioq and sort by the following criteria (use the next if the values are equal): - CPU weight - nice level - unit type - unit name The last one is just there for deterministic sorting to avoid any jitter.
| * | | basic: reorder UnitType enumMichael Olbrich2019-07-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | The enum order will be used to order jobs in the job queue. Make sure that unit types that fork aditional processes come first to maximize parallelism.
* | | | man: add note about systemctl stop return valueZbigniew Jędrzejewski-Szmek2019-07-181-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #13104. (I know a lot more could be added to that man page. This patch only addresses that once specific complaint.)
* | | | Merge pull request #13107 from keszybz/lvalue-rvalueLennart Poettering2019-07-181-6/+8
|\ \ \ \ | |/ / / |/| | | Better error messages for syntax errors
| * | | shared/conf-parser: say "key name" not "lvalue", add dotZbigniew Jędrzejewski-Szmek2019-07-181-1/+2
| | | | | | | | | | | | | | | | "lvalue" is our internal jargon. Let's try not to confuse non-programmers.
| * | | shared/conf-parser: emit a nicer warning for something like "======"Zbigniew Jędrzejewski-Szmek2019-07-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Urlich Windl wrote on the mailing list: > I noticed that a line of "=======" in "[Service]" cases the message " Unknown lvalue '' in section 'Service'". This now becomes: /etc/systemd/system/eqeqeqeq.service:3: Missing key name before '=', ignoring line.
| * | | shared/conf-parser: be nice and ignore lines without "="Zbigniew Jędrzejewski-Szmek2019-07-181-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | We generally don't treat syntax error as fatal, but in this case we would completely refuse to load the file. I think we should treat the the same as assignment outside of a section, or an unknown key name.
* | | | Merge pull request #13103 from anitazha/conditiondocsZbigniew Jędrzejewski-Szmek2019-07-182-1/+8
|\ \ \ \ | |/ / / |/| | | NEWS and catalog update for ExecCondition=
| * | | catalog: reference ExecCondition= in unit skipped strAnita Zhang2019-07-171-1/+2
| | | |
| * | | NEWS: bullet point for ExecCondition=Anita Zhang2019-07-171-0/+6
|/ / /
* | | core: never propagate reload failure to service resultLennart Poettering2019-07-181-1/+1
|/ / | | | | | | Fixes: #11238
* | Merge pull request #13047 from niedbalski/fix-5552-prLennart Poettering2019-07-1711-8/+49
|\ \ | | | | | | resolved: add new option to only cache positive answers
| * | resolved: switch cache option to a tri-state option (systemd#5552).Jorge Niedbalski2019-07-1711-8/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the resolved.conf Cache option to a tri-state "no, no-negative, yes" values. If a lookup returns SERVFAIL systemd-resolved will cache the result for 30s (See 201d995), however, there are several use cases on which this condition is not acceptable (See systemd#5552 comments) and the only workaround would be to disable cache entirely or flush it , which isn't optimal. This change adds the 'no-negative' option when set it avoids putting in cache negative answers but still works the same heuristics for positive answers. Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
* | | Merge pull request #13086 from yuwata/network-dhcp6-cleanupsLennart Poettering2019-07-176-22/+9
|\ \ \ | | | | | | | | network: dhcp6 cleanups
| * | | network: update state file after dhcp6 eventsYu Watanabe2019-07-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | E.g. DNS servers may be received from DHCPv6 server. If the link is already in configured state, the DNS servers are not written in the state file.
| * | | Revert "test-network: extend sleep time"Yu Watanabe2019-07-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7d7bb5c8613b774bf77c531f46d31ee20d7a1b1e. Still the CIs are flaky and the commit just slow down them.
| * | | man: fix wrong section nameYu Watanabe2019-07-171-1/+1
| | | |
| * | | network: fix use after free()Yu Watanabe2019-07-171-1/+1
| | | | | | | | | | | | | | | | The hashmap will be accessed by client_stop().
| * | | network: drop unnecessary line breaksYu Watanabe2019-07-171-2/+0
| | | |
| * | | network: drop fallback mechanism to assign DHCPv6 addresses with ↵Yu Watanabe2019-07-173-14/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | IFA_F_NOPREFIXROUTE The flag IFA_F_NOPREFIXROUTE was introduced in kernel-3.14. But even if the kernel does not support the flag, it should be just ignored. So, it is not necessary to do the fallback logic. Moreover, the current logic is not a fallback mechanism but just retrying. So, it should not work. Let's drop that.