summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use timestamp_is_set() moreLennart Poettering2022-02-2211-21/+21
|
* Merge pull request #22592 from yuwata/test-oomd-util-fixletsZbigniew Jędrzejewski-Szmek2022-02-221-5/+4
|\ | | | | test: test-oomd-util fixlets
| * test-oomd-util: fix conditional jump on uninitialised valueYu Watanabe2022-02-221-1/+1
| | | | | | | | Fixes #22577.
| * test-oomd-util: style fixletsYu Watanabe2022-02-221-4/+3
| |
* | Merge pull request #22574 from yuwata/network-dhcp-pd-fixesZbigniew Jędrzejewski-Szmek2022-02-223-88/+43
|\ \ | | | | | | network: dhcp-pd: fix two issues
| * | network: dhcp-pd: allow to assign the same subnet prefix to multiple interfacesYu Watanabe2022-02-221-23/+15
| | | | | | | | | | | | | | | | | | | | | | | | There is no reason networkd refuses that. Especially, when multiple downstream interfaces are connected to the same network, it is natural to assign the same subnet prefix to them. Prompted by #22571.
| * | network: dhcp-pd: fix prefix length of address assigned to upstream interfaceYu Watanabe2022-02-223-65/+28
| |/ | | | | | | | | | | | | | | This effectively revert ab0c82d9f749cc397a6b7e0327ddb2c08cd7d7e0. I have no idea why I did that... Fixes #22559.
* | Merge pull request #22584 from poettering/systemctl-verb-renamedLennart Poettering2022-02-2258-189/+224
|\ \ | | | | | | systemctl: rename "verb" entrypoint functions systematically to verb_xyz()
| * | systemctl: rework daemon_reload() functionsLennart Poettering2022-02-229-32/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's split out the inner parts of verb_daemon_reload() as a function daemon_reload() and then stop using the former outside of the verbs logic, and instead call the latter whenever we need to reload the daemon as auxiliary opeation. This should make our logic more systematic as we don't have to provide fake or misleading argc/argv to verb_daemon_reload() anymore.
| * | systemctl: systematically rename verb entrypoints verb_xyz()Lennart Poettering2022-02-2258-167/+167
| |/ | | | | | | | | | | | | | | | | Let's clean up our function naming a bit, and always name the verb_xyz(), where the xyz maps to the command line verb as closely as possible. No actual code changes, just an attempt to make the systemctl sources a bit more systematic, and less surprising.
* | analyze: fix build on non-seccomp buildsLennart Poettering2022-02-221-1/+1
|/ | | | | | Follow-up for #22585 See: https://github.com/systemd/systemd/pull/22585#issuecomment-1047658990
* core: really skip automatic restart when a JOB_STOP job is pendingFranck Bui2022-02-221-6/+1
| | | | | | | | | | | | | | | | | | | | | It's not clear why we rescheduled a service auto restart while a stop job for the unit was pending. The comment claims that the unit shouldn't be restarted but the code did reschedule an auto restart meanwhile. In practice that was rarely an issue because the service waited for the next auto restart to be rescheduled, letting the queued stop job to be proceed and service_stop() to be called preventing the next restart to complete. However when RestartSec=0, the timer expired right away making PID1 to reschedule the unit again, making the timer expired right away... and so on. This busy loop prevented PID1 to handle any queued jobs (and hence giving no chance to the start rate limiting to trigger), which made the busy loop last forever. This patch breaks this loop by skipping the reschedule of the unit auto restart and hence not depending on the value of u->restart_usec anymore. Fixes: #13667
* systemctl: improve error messages related to halt failuresLudwig Nussel2022-02-222-4/+7
|
* Merge pull request #22585 from poettering/analyze-split-upZbigniew Jędrzejewski-Szmek2022-02-2253-2723/+3053
|\ | | | | analyze: split out each verb into its own .c/.h pair
| * analyze: modernize pretty_boot_time() a bitLennart Poettering2022-02-211-41/+42
| | | | | | | | | | Use simple strextend() backed by dynamic memory instead of format string logic with fixed buffer.
| * analyze: systematically name verb entry point functions verb_xyz()Lennart Poettering2022-02-2143-63/+63
| | | | | | | | | | | | Some of the functions so far were named do_xyz(), others dump_xyz() and even others test_xyz(). let's instead name them exactly like the verb exposed in the command line, just prefixed with verb_
| * analyze: move "condition" verb into analyze-condition.[ch]Lennart Poettering2022-02-214-9/+9
| |
| * analyze: split out "verify" verb into own .c/.h fileLennart Poettering2022-02-219-405/+422
| | | | | | | | | | | | | | This renames the old analyze-verify.[ch] pair → analyze-verify-util.[ch], because it's used by the test logic as well, and by keeping it separate from the verify verb logic we don't have to import the arg_xyz variables.
| * analyze: move inspect-elf verb entrypoint into analyze-elf.[ch], tooLennart Poettering2022-02-215-17/+16
| | | | | | | | | | like for the other verbs, let's move the whole entry point for the verb, too.
| * analyze: fully move "security" verb to analyze-security.[ch]Lennart Poettering2022-02-214-77/+68
| | | | | | | | let's move the verb entropy point too, like for the other verbs now.
| * analyze: split out "time" verbLennart Poettering2022-02-214-17/+29
| |
| * analyze: split out critical chainLennart Poettering2022-02-215-226/+246
| |
| * analyze: split out "unit-files" verbLennart Poettering2022-02-214-46/+59
| |
| * analyze: split out "unit-paths" verbLennart Poettering2022-02-214-15/+28
| |
| * analyze: split out log control verbLennart Poettering2022-02-214-13/+25
| |
| * analyze: split out cat-config verbLennart Poettering2022-02-215-37/+55
| |
| * analyze: split out "plot" verbLennart Poettering2022-02-217-487/+508
| |
| * analyze: split out "blame" verb + time helpersLennart Poettering2022-02-217-287/+324
| |
| * analyze: split out "capability" verbLennart Poettering2022-02-214-45/+59
| |
| * analyze: split out "exit-status" verbLennart Poettering2022-02-214-46/+59
| |
| * analyze: highlight the range of deprecated verbs in comments a bit betterLennart Poettering2022-02-211-1/+2
| |
| * analyze: split out "service-watchdogs" verbLennart Poettering2022-02-214-34/+48
| |
| * analyze: split out "dot" verbLennart Poettering2022-02-215-183/+204
| |
| * analyze: split out "dump" verbLennart Poettering2022-02-215-56/+77
| |
| * analyze: split out "syscall-filter" verbLennart Poettering2022-02-214-181/+198
| |
| * analyze: split out "filesystems" verb into its own .c/.h file pairLennart Poettering2022-02-215-222/+242
| |
| * analyze: split out calendar verb into own .c/.h fileLennart Poettering2022-02-215-140/+159
| |
| * analyze: split out "timestamp" verb into its own .c/.h filesLennart Poettering2022-02-214-89/+102
| |
| * analyze: split out "timespan" verb into its own .c/.h fileLennart Poettering2022-02-215-71/+94
| |
* | env-util: drop unsetenv_erase()Lennart Poettering2022-02-211-2/+0
|/ | | | | | Follow-up for: e99ca1474145f7fad38bb0255d344f4ad7717ef5 Found by @grigorig: https://github.com/systemd/systemd/commit/e99ca1474145f7fad38bb0255d344f4ad7717ef5#r67071855
* Merge pull request #22573 from mrc0mmand/epoch-timestampLennart Poettering2022-02-214-5/+19
|\ | | | | time-util: introduce TIMESTAMP_UNIX
| * systemctl,man: update docs for `--timestamp=`Frantisek Sumsal2022-02-211-5/+2
| |
| * time-util: introduce TIMESTAMP_UNIXFrantisek Sumsal2022-02-213-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow formatting timestamps as number of seconds since the Epoch for easier machine parsing. Fixes: #22567 ``` $ systemctl show systemd-journald | grep Timestamp WatchdogTimestampMonotonic=0 ExecMainStartTimestamp=Sat 2021-12-11 15:25:57 CET ExecMainStartTimestampMonotonic=13030408 ExecMainExitTimestampMonotonic=0 StateChangeTimestamp=Sat 2021-12-11 15:25:57 CET StateChangeTimestampMonotonic=13049273 InactiveExitTimestamp=Sat 2021-12-11 15:25:57 CET InactiveExitTimestampMonotonic=13030430 ActiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET ActiveEnterTimestampMonotonic=13049273 ActiveExitTimestamp=Sat 2021-12-11 15:25:57 CET ActiveExitTimestampMonotonic=12997236 InactiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET InactiveEnterTimestampMonotonic=13028890 ConditionTimestamp=Sat 2021-12-11 15:25:57 CET ConditionTimestampMonotonic=13029539 AssertTimestamp=Sat 2021-12-11 15:25:57 CET AssertTimestampMonotonic=13029540 $ systemctl show --timestamp=unix systemd-journald | grep Timestamp WatchdogTimestampMonotonic=0 ExecMainStartTimestamp=@1639232757 ExecMainStartTimestampMonotonic=13030408 ExecMainExitTimestampMonotonic=0 StateChangeTimestamp=@1639232757 StateChangeTimestampMonotonic=13049273 InactiveExitTimestamp=@1639232757 InactiveExitTimestampMonotonic=13030430 ActiveEnterTimestamp=@1639232757 ActiveEnterTimestampMonotonic=13049273 ActiveExitTimestamp=@1639232757 ActiveExitTimestampMonotonic=12997236 InactiveEnterTimestamp=@1639232757 InactiveEnterTimestampMonotonic=13028890 ConditionTimestamp=@1639232757 ConditionTimestampMonotonic=13029539 AssertTimestamp=@1639232757 AssertTimestampMonotonic=13029540 ```
* | env-util: replace unsetenv_erase() by new getenv_steal_erase() helperLennart Poettering2022-02-209-84/+90
|/ | | | | | | | The new helper combines a bunch of steps every invocation of unsetenv_erase() did so far: getenv() + strdup() + unsetenv_erase(). Let's unify this into one helper that is harder to use incorrectly. It's in inspired by TAKE_PTR() in a way: get the env var out and invalidate where it was before.
* systemctl: make `--timestamp=` affect the `show` verb as wellFrantisek Sumsal2022-02-191-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the `--timestamp=` option has no effect on timestamps shown by `systemctl show`, let's fix that. Spotted in #22567. Before: ``` $ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp= ExecMainStartTimestamp=Sat 2021-12-11 15:25:57 CET StateChangeTimestamp=Sat 2021-12-11 15:25:57 CET InactiveExitTimestamp=Sat 2021-12-11 15:25:57 CET ActiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET ActiveExitTimestamp=Sat 2021-12-11 15:25:57 CET InactiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET ConditionTimestamp=Sat 2021-12-11 15:25:57 CET AssertTimestamp=Sat 2021-12-11 15:25:57 CET ``` After: ``` $ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp= ExecMainStartTimestamp=Sat 2021-12-11 14:25:57.177848 UTC StateChangeTimestamp=Sat 2021-12-11 14:25:57.196714 UTC InactiveExitTimestamp=Sat 2021-12-11 14:25:57.177871 UTC ActiveEnterTimestamp=Sat 2021-12-11 14:25:57.196714 UTC ActiveExitTimestamp=Sat 2021-12-11 14:25:57.144677 UTC InactiveEnterTimestamp=Sat 2021-12-11 14:25:57.176331 UTC ConditionTimestamp=Sat 2021-12-11 14:25:57.176980 UTC AssertTimestamp=Sat 2021-12-11 14:25:57.176980 UTC ```
* generator: Rename password argJan Janssen2022-02-193-18/+18
| | | | | | | | | | This function does not expect a password, but a key file path. The cryptsetup helper binary even calls it that. No Code changes. Follow up on: 6e41f4dd916293f35d7d35cea7eed1807d7ea771 Fixes: https://github.com/systemd/systemd/security/code-scanning/81
* resolved: rework how we reply to D-Bus messages for resolution requestsLennart Poettering2022-02-181-40/+105
| | | | | | | | | | | | | | | | This reworks how we reply to D-Bus messages that come in for resolution requests. Previously, we'd store them in the .bus_request field of the main DnsQuery (but not any auxiliary one), and reply to it whenever we had something to reply. In error paths this could mean we'd accidentally reply twice. This cleans this logic up: whenever we reply to a message we'll now go up the tree of auxiliary queries, to find the primary query, i.e. the one we actually want to reply to. Once we found it, we take out the bus message object, resetting it to NULL. This way we can be sure we'll reply at most once to each message. Fixes: #22477
* resolve: add reference of the original bus message to the aux queriesYu Watanabe2022-02-181-0/+1
| | | | | | Otherwise, the error in aux queries cannot be replied. Fixes #22477.
* machined: use one_zero() on one more occasionLennart Poettering2022-02-181-1/+1
|
* machined: sd-bus expects 'int', not 'bool' when returning unmarshalled booleansLennart Poettering2022-02-181-2/+1
| | | | | Fixes: #22555 Follow-up for: #22160