summaryrefslogtreecommitdiffstats
path: root/src/systemctl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-131-3/+1
|
* tree-wide: change --kill-who to --kill-whomZbigniew Jędrzejewski-Szmek2022-08-263-13/+13
| | | | | | | | | | | getopt allows non-ambiguous abbreviations, so backwards-compat is maintained, and people can use --kill-who (or even shorter abbreviations). English is flexible, so in common speach people would use both forms, even if "whom" is technically more correct. The advantage of using the longer form in the code is that we effectively allow both forms, so we stop punishing people who DTGCT¹, but still allow people to use the spoken form if they prefer. 1. Do the gramatically correct thing
* tree-wide: port things dirname_malloc() → path_extract_directory()Lennart Poettering2022-08-232-7/+7
|
* Merge pull request #24054 from keszybz/initrd-no-reloadFrantisek Sumsal2022-08-181-6/+2
|\ | | | | Don't do daemon-reload in the initrd
| * Use a common define for the reload timeoutZbigniew Jędrzejewski-Szmek2022-07-221-6/+2
| |
* | systemctl: add list-automounts verbDavid Tardon2022-07-253-0/+188
| | | | | | | | Fixes: #6056
* | systemctl: simplify var. definition a bitDavid Tardon2022-07-251-5/+3
| |
* | systemctl: extract output of legend to a functionDavid Tardon2022-07-251-20/+17
| |
* | systemctl: drop unneeded conditionDavid Tardon2022-07-251-32/+32
| |
* | systemctl: reduce var. scope and shorten the code a bitDavid Tardon2022-07-251-17/+10
| |
* | systemctl: fix type used for array sizes to size_tLennart Poettering2022-07-251-10/+10
| | | | | | | | | | | | | | | | | | | | We always should use size_t for sizes of arrays (and any size of memory, in fact), unless there's a strong reason to use something else. Hence, let's fix these cases where we sloppily used "unsigned" or "int" instead. No change in behaviour, this is just to make things less surprising for the random reader.
* | systemctl: include upheld units in dependenciesDavid Tardon2022-07-171-1/+3
|/ | | | Fixes: #22706
* Merge pull request #23731 from bluca/bootctl_imageLuca Boccassi2022-07-081-1/+1
|\ | | | | bootctl: add --root and --image
| * bootctl: add --root and --imageLuca Boccassi2022-07-081-1/+1
| | | | | | | | Operate on image/directory, and also take files to install from it
* | systemctl: drop color settings in log messageYu Watanabe2022-07-071-3/+1
| | | | | | | | `log_warning()` colorize the message gracefully.
* | systemctl: enable colorized logging by defaultYu Watanabe2022-07-071-2/+1
|/
* Merge pull request #15205 from jlebon/pr/preset-all-firstbootZbigniew Jędrzejewski-Szmek2022-07-062-5/+5
|\ | | | | manager: optionally, do a full preset on first boot
| * systemctl: stop saying "vendor preset"Zbigniew Jędrzejewski-Szmek2022-05-042-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have vendor presets, and local admin presets, and runtime presets (under /usr/lib, /usr/local/lib and /etc, /run, respectively). When we display preset state, it can be configured in any of those places, so we shouldn't say anything about the origin. (Another nice advantage is that it improves alignment: [root@f36 ~]# systemctl list-unit-files multipathd.service UNIT FILE STATE VENDOR PRESET multipathd.service enabled enabled ^ this looks we have a "PRESET" column that is empty.)
* | systemctl: rename field for clarityZbigniew Jędrzejewski-Szmek2022-07-021-7/+7
| |
* | systemctl: add `edit` verb to arguments' help textElias Probst2022-06-101-5/+6
| | | | | | | | | | The arguments `--global`, `--runtime` and `--root` also affect the `edit` verb.
* | systemctl: simplify code a bitZbigniew Jędrzejewski-Szmek2022-06-091-4/+5
| | | | | | | | | | gcc insists that bus may be used unitialized here, but I don't see any possibility of that.
* | basic/in-addr-util: add IN_ADDR_PREFIX_TO_STRINGZbigniew Jędrzejewski-Szmek2022-06-061-5/+2
| |
* | man/systemctl: improve grammar in description of --check-inhibitorsZbigniew Jędrzejewski-Szmek2022-06-011-2/+2
| |
* | systemctl: drop translation of method names to descriptions in error messageZbigniew Jędrzejewski-Szmek2022-06-011-22/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had yet-another table of descriptive strings to use in error messages. I started thinking how to synchronize them with the strings in logind, but ultimately I think it's better to remove those altogether. Those strings should almost never be used: normally if the call fails, logind will provide an error message itself, which is probably more detailed than what we can figure out on the client side. And the most important part that we want to show here is what exactly we called, in particular RebootWithFlags vs. Reboot, etc. By using the "descriptive strings" we were obfuscating this. So let's just simplify our code and print the actual method name, since this is more useful as an error statement that is googlable and unique. While at it, let's print the correct method name ;)
* | systemctl: make function staticZbigniew Jędrzejewski-Szmek2022-06-012-11/+4
| |
* | systemctl: make show/status honour --state and --typeZbigniew Jędrzejewski-Szmek2022-05-261-10/+22
| | | | | | | | | | | | | | This makes the interface more flexible, by allowing the same filtering for show and status as is done for list-units. Fixes #23207.
* | fuzz-systemctl-parse-argv: refuse commandlines above 1k entriesZbigniew Jędrzejewski-Szmek2022-05-081-0/+6
|/ | | | | | | | | | | | | | | oss-fuzz reports timeouts which are created by appending to a very long strv. The code is indeed not very efficient, but it's designed for normal command-line use, where we don't expect more than a dozen of entries. The fact that it is slow with ~100k entries is not particularly interesting. In the future we could rework the code to have better algorithmic complexity. But let's at least stop oss-fuzz from wasting more time on such examples. (My first approach was to set max_len in .options, but apparently this doesn't work for hongfuzz and and AFL.) oss-fuzz-34527: https://oss-fuzz.com/issue/5722283944574976
* systemctl: colorize "enabled" in 'systemctl status ...'amarjargal2022-04-171-3/+20
| | | | | | | | | "enabled" state is highlighted in green and "disabled" state is highlighted in yellow because I felt that white and grey colors were not so distinguishable. Other states are not highlighted. Any other coloring suggestions are welcome! Closes #16932.
* systemctl: show tainted stateLennart Poettering2022-03-313-7/+22
|
* Merge pull request #22649 from ↵Zbigniew Jędrzejewski-Szmek2022-03-2910-29/+29
|\ | | | | | | | | keszybz/symlink-enablement-yet-again-punish-me-harder Fixups to the unit enablement logic
| * Rename UnitFileScope to LookupScopeZbigniew Jędrzejewski-Szmek2022-03-299-23/+23
| | | | | | | | | | | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/22649/commits/8b3ad3983f5440eef812b34e5ed862ca59fdf7f7#r837345892 The define is generalized and moved to path-lookup.h, where it seems to fit better. This allows a recursive include to be removed and in general makes things simpler.
| * systemctl: fix silent failure when --root is not foundZbigniew Jędrzejewski-Szmek2022-03-293-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some calls to lookup_path_init() were not followed by any log emission. E.g.: $ SYSTEMD_LOG_LEVEL=debug systemctl --root=/missing enable unit; echo $? 1 Let's add a helper function and use it in various places. $ SYSTEMD_LOG_LEVEL=debug build/systemctl --root=/missing enable unit; echo $? Failed to initialize unit search paths for root directory /missing: No such file or directory 1 $ SYSTEMCTL_SKIP_SYSV=1 build/systemctl --root=/missing enable unit; echo $? Failed to initialize unit search paths for root directory /missing: No such file or directory Failed to enable: No such file or directory. 1 The repeated error in the second case is not very nice, but this is a niche case and I don't think it's worth the trouble to trying to avoid it.
* | bootspec: normalize function names/parameter listsLennart Poettering2022-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This normalizes naming of functions operating on BootConfig objects. Let's always call them boot_config_xyz(), like our usual way to name stuff. moreover, move the BootConfig parameter to the beginning, as it's not a return value (which we typically move to the end of the parameter list), but simply an object, that even happens to be initialized already. With these changes the functions are more like our usual way to call things, and less surprises are good.
* | bootspec: assess default/selected entries *after* we augmented entry list ↵Lennart Poettering2022-03-281-1/+5
|/ | | | | | with entries from loader Fixes: #22580
* systemctl: use the right name in error messageZbigniew Jędrzejewski-Szmek2022-03-231-1/+1
|
* strv: declare iterator of FOREACH_STRING() in the loopZbigniew Jędrzejewski-Szmek2022-03-232-17/+16
| | | | | | | | | | | Same idea as 03677889f0ef42cdc534bf3b31265a054b20a354. No functional change intended. The type of the iterator is generally changed to be 'const char*' instead of 'char*'. Despite the type commonly used, modifying the string was not allowed. I adjusted the naming of some short variables for clarity and reduced the scope of some variable declarations in code that was being touched anyway.
* strv: make iterator in STRV_FOREACH() declaread in the loopYu Watanabe2022-03-1917-42/+5
| | | | This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
* list: declare iterator of LIST_FOREACH() in the loopYu Watanabe2022-03-191-2/+0
|
* systemctl: fix operations on relative pathsZbigniew Jędrzejewski-Szmek2022-03-181-9/+6
| | | | | | | | | | | | | We should treat ./some.service and $PWD/some.service as equivalent. But we'd try to send the relative paths over dbus, which can't work well: $ sudo systemctl enable ./test2.service Failed to look up unit file state: Invalid argument $ sudo systemctl enable $PWD/test2.service Created symlink /etc/systemd/system/multi-user.target.wants/test2.service → /home/zbyszek/src/systemd/test2.service. Created symlink /etc/systemd/system/test2.service → /home/zbyszek/src/systemd/test2.service. Now both are equivalent.
* systemctl: remove unused parameterZbigniew Jędrzejewski-Szmek2022-03-181-3/+3
|
* systemctl: drop left-over parensZbigniew Jędrzejewski-Szmek2022-03-181-2/+2
|
* tree-wide: use strv_contains() in more placesZbigniew Jędrzejewski-Szmek2022-03-182-3/+3
|
* systemctl: use action_table for scheduling shutdownLudwig Nussel2022-02-281-18/+3
| | | | | | The fall-through to reboot doesn't seem to make sense. It won't happen in the current code. Filtering the actions on client side is not needed either as the server will refuse unsupported operations anyway.
* systemctl: Show how long a service ran for after it exited in status outputDaan De Meyer2022-02-231-0/+12
|
* tree-wide: use timestamp_is_set() moreLennart Poettering2022-02-221-2/+2
|
* 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.
* systemctl: improve error messages related to halt failuresLudwig Nussel2022-02-222-4/+7
|
* systemctl,man: update docs for `--timestamp=`Frantisek Sumsal2022-02-211-5/+2
|
* 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 ```