summaryrefslogtreecommitdiffstats
path: root/src/systemctl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* basic: move version() to build.h+cZbigniew Jędrzejewski-Szmek2022-11-081-0/+1
|
* shutdown: Add Xen kexec supportSamuel Thibault2022-11-022-0/+2
| | | | | | In the Xen case, it's the hypervisor which manages kexec. We thus have to ask it whether a kernel is loaded, instead of relying on /sys/kernel/kexec_loaded.
* systemd-sysv-install: change license to MIT-0Zbigniew Jędrzejewski-Szmek2022-10-261-1/+1
| | | | | | | | | | See parent commit for explanation. git blame shows Martin Pitt is the author of the code. (I was considering whether we should instead drop this file, but it's still useful for *distributions*. Eveen if we discourage people from using sysv scripts, distributions will have to deal with them for a while yet.)
* systemctl: fix potential memleak on failure in determine_default()Yu Watanabe2022-10-241-9/+7
| | | | And make verb_set_default() return zero on success.
* Merge pull request #25036 from keszybz/pluralsLuca Boccassi2022-10-171-1/+1
|\ | | | | Remove usage of "noun(s)" in messages and docs
| * tree-wide: replace "plural(s)" by "plurals"Zbigniew Jędrzejewski-Szmek2022-10-171-1/+1
| | | | | | | | | | | | | | | | (s) is just ugly with a vibe of DOS. In most cases just using the normal plural form is more natural and gramatically correct. There are some log_debug() statements left, and texts in foreign licenses or headers. Those are not touched on purpose.
* | install: include full type name in special UnitFilePresetMode valuesLennart Poettering2022-10-141-1/+1
| | | | | | | | | | | | Typically the _MAX and _INVALID special enum values use the full type as prefix, even if the actual values of the enum might not. Let's follow this rule here too.
* | install: make InstallChange enum type a proper typeLennart Poettering2022-10-141-1/+1
|/ | | | | | | We can just make this an enum, as long as we ensure it has enough range, which we can do by adding -ERRNO_MAX as one possible value (at least on GNU C). We already do that at multiple other places, so let's do this here too.
* shared/install: rename 'unit_file_change_type' to 'install_change' + followupsZbigniew Jędrzejewski-Szmek2022-10-131-1/+1
| | | | | | We had an anonymous enum with values called UNIT_FILE_…, which could easily be confused with UNIT_FILE_… from UnitFileFlags enum. This commit renames the enum values and also the variables which refer to them.
* shared/install: rename UnitFileChange to InstallChangeZbigniew Jędrzejewski-Szmek2022-10-135-13/+13
| | | | | It's shorter and more generic. The struct can contain info about changes to unit files, but also symlinks and errors.
* core,logind,systemctl,journald: replace calls to strerror() with setting ↵Zbigniew Jędrzejewski-Szmek2022-10-111-2/+4
| | | | | | | | | | | | | errno + %m strerror() is not thread safe and calling it just isn't worth the effort required to justify why it would be safe in those cases. It's easier to just use %m which is thread-safe out of the box. I don't think that any of the changes in the patch cause any functional difference. This is just about getting rid of calls to strerror() in general. When we print an error message and fail to format the string, using something like "(null)" is good enough. This is very very unlikely to happen anyway.
* systemctl: color ignored exit status in yellow, not redChristian Hesse2022-09-301-1/+1
| | | | | | | | | | If the executable path is prefixed with "-", an exit code of the command normally considered a failure (i.e. non-zero exit status or abnormal exit due to signal) is recorded, but has no further effect and is considered equivalent to success. Let's honor this with `systemctl status`, and color ignored exit status in yellow, not red.
* systemctl: add support for --image optionRichard Phibel2022-09-271-1/+39
| | | | | All tools that support --root= should also learn --image= so that they can operate on disk images directly.
* Merge pull request #24686 from d4nuu8/delta_outputLennart Poettering2022-09-231-1/+1
|\ | | | | shared/logs-show: add new --output= format "short-delta"
| * shared/logs-show: add new --output= format "short-delta"Daniel Braunwarth2022-09-231-1/+1
| | | | | | | | | | | | | | This new output formatting option is similar to "short-monotonic" but also shows the time delta between two messages. This fixes #24641.
* | Merge pull request #24781 from DaanDeMeyer/link-remove-checkZbigniew Jędrzejewski-Szmek2022-09-221-2/+3
|\ \ | | | | | | systemctl: Remove check that linked unit files must contain a "/"
| * | systemctl: Fix style nitDaan De Meyer2022-09-221-1/+1
| | |
| * | systemctl: Improve link directory separator error messageDaan De Meyer2022-09-221-1/+2
| |/ | | | | | | Let's suggest users try ./<filename> when they encounter this error.
* / shared/format-table: use enum instead of Table.empty_stringZbigniew Jędrzejewski-Szmek2022-09-224-7/+7
|/ | | | | | | | | | | | All users were setting this to some static string (usually "-"), so let's simplify things by not doing strdup, but instead limiting callers to a fixed set of values. In preparation for the next commit, the function is renamed from "empty" to "replacement", because it'll be used for more than empty fields. I didn't do the whole string-table setup, because it's all used internally in one file and this way we can immediately assert if an invalid value is passed in. Some callers were (void)ing the error, others were ignoring it, and others propagating. It's nicer to remove the boilerplate.
* 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.