summaryrefslogtreecommitdiffstats
path: root/src/systemctl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #14749 from msekletar/cpu-aff-numa-v3Zbigniew Jędrzejewski-Szmek2020-03-181-0/+1
|\ | | | | core: add support for setting CPUAffinity= to special "numa" value
| * shared: split out NUMA code from cpu-set-util.c to numa-util.cMichal Sekletár2020-03-161-0/+1
| |
* | systemctl: print a notice when set-default is not effectiveZbigniew Jędrzejewski-Szmek2020-03-171-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | $ sudo ln -svf multi-user.target /run/systemd/generator.early/default.target '/run/systemd/generator.early/default.target' -> 'multi-user.target' $ sudo build/systemctl set-default --root=/ sysinit.target Removed /etc/systemd/system/default.target. Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/sysinit.target. Note: "multi-user.target" is the default unit (possibly a runtime override). The output is not super informative, but it should be enough to point the user in the right direction. Fixes #3645.
* | systemctl: emit notice about some kernel commandline optionsZbigniew Jędrzejewski-Szmek2020-03-131-1/+39
|/ | | | | Things can be pretty confusing when there's a commandline option overrding the configured default... Let's be nice to the user and emit a warning.
* systemctl: hide the 'glyph' column when --no-legend is requestedFrantisek Sumsal2020-03-111-5/+14
| | | | Fixes: #15077
* systemctl: make list-dependencies take multiple argumentsZbigniew Jędrzejewski-Szmek2020-03-051-18/+27
| | | | Other similar commands do, no reason not to do this here too.
* systemctl: do not print items twice in list-dependenciesZbigniew Jędrzejewski-Szmek2020-03-041-0/+2
| | | | Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1807485.
* tree-wide: fix spelling of lookup and setup verbsZbigniew Jędrzejewski-Szmek2020-03-031-1/+1
| | | | "set up" and "look up" are the verbs, "setup" and "lookup" are the nouns.
* systemd: Fix busctl crash on aarch64 when setting output table formatAlin Popa2020-02-151-1/+1
| | | | | | | | The enum used for column names is integer type while table_set_display() is parsing arguments on size_t alignment which may result in assert in table_set_display() if the size between types missmatch. This patch cast the enums to size_t. It also fixes all other occurences for table_set_display() and table_set_sort().
* cgroup: systemctl: Don't display NULL if protection was set to maxChris Down2020-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Inside format_bytes, we return NULL if the value is UINT64_MAX. This makes some kind of sense where this has some other semantic meaning than being a value, but in this case the value is both a.) not the default (so we definitely want to display it), and b.) means "infinity" (or "max" in cgroup terminology). This patch adds a small wrapper around format_bytes that can be used for these cases, to avoid the following situation: [root@tangsanjiao ~]# cat /sys/fs/cgroup/workload.slice/memory.low max [root@tangsanjiao ~]# systemctl show workload.slice -p MemoryLow MemoryLow=infinity [root@tangsanjiao ~]# systemctl status workload.slice | grep low: Memory: 14.9G (low: (null)) After the patch: [root@tangsanjiao ~]# systemctl status workload.slice | grep low: Memory: 15.1G (low: infinity)
* systemctl: show logs for correct namespace of serviceLennart Poettering2020-01-311-0/+4
|
* systemctl: use format-table.[ch] for tablesFrantisek Sumsal2020-01-141-367/+226
|
* Merge pull request #14293 from keur/systemctl_with_dependenciesLennart Poettering2020-01-131-79/+148
|\ | | | | systemctl: Add --with-dependencies switch
| * systemctl: Add --with-dependencies flagKevin Kuehler2020-01-101-79/+148
| | | | | | | | | | | | | | | | | | | | | | | | Will print a unit and all of its dependencies. Works with cat, status, list-units, and list-unit-files. This flag can also be used in conjunction with --reverse, --before, and --after. We also vastly simplify the list_dependencies_get_dependencies logic. Instead of using 5 strvs and merging them into one, use one strv and have the bus append all the map values to it. Fixes #9273
* | systemctl: show 'VENDOR PRESET' column in 'list-unit-files'Frantisek Sumsal2020-01-021-10/+27
| | | | | | | | | | Show the install value presets would suggest for each service in a separate column.
* | systemctl: skip non-existent units in the 'cat' verbFrantisek Sumsal2020-01-021-4/+8
| | | | | | | | | | | | | | | | | | When processing list of units (either provided manually or as a wildcard), let's skip units for which we don't have an on-disk counterpart, but note the -ENOENT error code and propagate it back to the user. Fixes: #14082
* | systemctl: show what verbs support --dry-run in the help pageBart Willems2019-12-171-0/+3
|/ | | | Signed-off-by: Bart Willems <bwillems@protonmail.com>
* Fix typo (duplicate "or")Timo Wilken2019-12-051-1/+1
| | | This fixes a double "or" in the text of `systemctl --help`.
* systemctl: enhance message about kexec missing kernelZbigniew Jędrzejewski-Szmek2019-12-031-2/+8
| | | | Fixes #7730.
* systemctl: fix indentation of cgroup treeLennart Poettering2019-11-271-1/+1
| | | | | | | | Follow-up for 0d588deae21234c9a9d64d9eddbcbe7da5c9a39d. In that commit the output got moved a 2 chars to the right, hence make sure to also shift the cgroup tree to the right, so that it gets properly aligned under the cgroup path again.
* systemctl: whitespace optimization of --helpZbigniew Jędrzejewski-Szmek2019-11-181-59/+54
| | | | | | | | | | Move the explanation of options three columns to the right: then almost all options fit and we do not need to break lines so often. When a multi-line explanation precedes a section break, i.e. there is a half-line on the right side, do not use an empty space. This saves a line, and actually looks visually better because the text is still clearly separated, but we don't get the big vertical white space.
* systemctl: add service-watchdogs commandZbigniew Jędrzejewski-Szmek2019-11-181-0/+53
| | | | | The rationale is the same as for log-level/log-target: this controls the behaviour of the manager, and belongs in systemctl.
* systemctl: add log-level and log-target commandsZbigniew Jędrzejewski-Szmek2019-11-181-68/+160
| | | | | | | | | | | | | | | | This copies the commands log-level and log-target (to query and set the current settings) from systemd-analyze to systemctl, essentially reverting a65615ca5d78be0dcd7d9c9b4a663fa75f758606. Controllling the log level settings of the manager is basic functionality, that should be available even if systemd-analyze (which is more of an analysis tool) is not installed. This is like dmesg and journalctl, which should be available even if a debugger and more advanced tools to analyze the kernel are not available. (Note that dmesg is used to control the log level too, not just to browse the kernel logs.) I chose to copy&paste the methods from analyze.c to the new location. There isn't enough code to share, because acquire_bus() in both places has a different signature despite the same name, so the only part that is common is the invocation of sd_bus_set_property().
* tree-wide: clean up --help texts a bitLennart Poettering2019-11-181-28/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up and unifies the outut of --help texts a bit: 1. Highlight the human friendly description string, not the command line via ANSI sequences. Previously both this description string and the brief command line summary was marked with the same ANSI highlight sequence, but given we auto-page to less and less does not honour multi-line highlights only the command line summary was affectively highlighted. Rationale: for highlighting the description instead of the command line: the command line summary is relatively boring, and mostly the same for out tools, the description on the other hand is pregnant, important and captions the whole thing and hence deserves highlighting. 2. Always suffix "Options" with ":" in the help text 3. Rename "Flags" → "Options" in one case 4. Move commands to the top in a few cases 5. add coloring to many more help pages 6. Unify on COMMAND instead of {COMMAND} in the command line summary. Some tools did it one way, others the other way. I am not sure what precisely {} is supposed to mean, that uppercasing doesn't, hence let's simplify and stick to the {}-less syntax And minor other tweaks.
* ask-password-agent: introduce ask_password_agent_open_if_enabled()Lennart Poettering2019-11-151-9/+3
| | | | | | This makes the ask-password agent handling more alike the polkit agent handling again, and introduces ask_password_agent_open_if_enabled() that works just like the already existing polkit_agent_open_if_enabled().
* Merge pull request #13554 from keur/systemctl_status_timerZbigniew Jędrzejewski-Szmek2019-11-081-42/+77
|\ | | | | systemctl: Add timer activation to status
| * systemctl: simplify printing of Triggers/TriggeredByZbigniew Jędrzejewski-Szmek2019-11-051-34/+17
| |
| * systemctl: Align all status outputs to TriggeredByKevin Kuehler2019-11-051-38/+38
| |
| * systemctl: Add TriggeredBy and Triggers to statusKevin Kuehler2019-11-051-9/+61
| | | | | | | | | | | | | | For all units that aren't timers, if it is activated by another unit, add the triggering unit under the "TriggeredBy:" header. If a unit can trigger other units, print the units it triggers other the "Triggers:" header.
* | tree-wide: drop double newlineYu Watanabe2019-11-031-1/+0
| |
* | tree-wide: drop socket.h when socket-util.h is includedYu Watanabe2019-11-031-1/+0
| |
* | tree-wide: drop locale.h when locale-util.h is includedYu Watanabe2019-11-031-1/+0
| |
* | tree-wide: drop string.h when string-util.h or friends are includedYu Watanabe2019-11-031-1/+0
|/
* various tools: be more explicit when a glob is passed when not supportedZbigniew Jędrzejewski-Szmek2019-10-251-11/+14
| | | | | | | | | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=1763488: when we say that 'foo@*.service' is not a valid unit name, this is not clear enough. Let's include the name of the operation that does not support globbing in the error message: $ build/systemctl enable 'foo@*.service' Glob pattern passed to enable, but globs are not supported for this. Invalid unit name "foo@*.service" escaped as "foo@\x2a.service". ...
* basic/fs-util: change CHASE_OPEN flag into a separate output parameterZbigniew Jędrzejewski-Szmek2019-10-241-1/+1
| | | | | | | | | | | | | chase_symlinks() would return negative on error, and either a non-negative status or a non-negative fd when CHASE_OPEN was given. This made the interface quite complicated, because dependning on the flags used, we would get two different "types" of return object. Coverity was always confused by this, and flagged every use of chase_symlinks() without CHASE_OPEN as a resource leak (because it would this that an fd is returned). This patch uses a saparate output parameter, so there is no confusion. (I think it is OK to have functions which return either an error or an fd. It's only returning *either* an fd or a non-fd that is confusing.)
* systemctl: emit warning if start is used with globsZbigniew Jędrzejewski-Szmek2019-10-161-12/+27
| | | | Fixes #6379.
* systemctl: fix memleak caused by wrong cleanup funcYu Watanabe2019-10-131-1/+1
|
* Highlight the synopsis and summary in --helpZbigniew Jędrzejewski-Szmek2019-10-081-2/+3
| | | | | This doesn't cover all the binaries, but I don't know how to script this, and I run out of steam ;)
* Move the Commands section above Options sectionZbigniew Jędrzejewski-Szmek2019-10-081-60/+61
| | | | | | | For executables which take a verb, we should list the verbs first, and then options which modify those verbs second. The general layout of the man page is from general description to specific details, usually Overview, Commands, Options, Return Value, Examples, References.
* systemctl: Default suffixes for timer and socketKevin Kuehler2019-10-041-123/+138
| | | | | * use .timer suffix by default for systemctl list-timers * use .socket suffix by default for systemctl list-sockets
* cgroup: introduce support for cgroup v2 CPUSET controllerPavel Hrdina2019-09-241-1/+1
| | | | | | | | | | | | | | Introduce support for configuring cpus and mems for processes using cgroup v2 CPUSET controller. This allows users to limit which cpus and memory NUMA nodes can be used by processes to better utilize system resources. The cgroup v2 interfaces to control it are cpuset.cpus and cpuset.mems where the requested configuration is written. However, it doesn't mean that the requested configuration will be actually used as parent cgroup may limit the cpus or mems as well. In order to reflect the real configuration cgroup v2 provides read-only files cpuset.cpus.effective and cpuset.mems.effective which are exported to users as well.
* core: add ExecXYZEx= bus hook ups to all exec command propertiesAnita Zhang2019-09-171-0/+5
| | | | | | The "Ex" variant was originally only added for ExecStartXYZ= but it makes sense to have feature parity for the rest of the exec command properties as well (e.g. ExecReload=, ExecStop=, etc).
* systemctl: use unicode in one more placeZbigniew Jędrzejewski-Szmek2019-08-191-1/+1
|
* systemctl: Add unit file states to state help messageRonan Pigott2019-08-061-0/+5
|
* Merge pull request #13119 from keszybz/unit-loading-2Lennart Poettering2019-07-301-27/+20
|\ | | | | Rework unit loading to take into account all aliases
| * pid1: drop unit caches only based on mtimeZbigniew Jędrzejewski-Szmek2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | v2: - do not watch mtime of transient and generated dirs We'd reload the map after every transient unit we created, which we don't need to do, since we create those units ourselves and know their fragment path.
| * pid1: use a cache for all unit aliasesZbigniew Jędrzejewski-Szmek2019-07-301-27/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reworks how we load units from disk. Instead of chasing symlinks every time we are asked to load a unit by name, we slurp all symlinks from disk and build two hashmaps: 1. from unit name to either alias target, or fragment on disk (if an alias, we put just the target name in the hashmap, if a fragment we put an absolute path, so we can distinguish both). 2. from a unit name to all aliases Reading all this data can be pretty costly (40 ms) on my machine, so we keep it around for reuse. The advantage is that we can reliably know what all the aliases of a given unit are. This means we can reliably load dropins under all names. This fixes #11972.
* | exit-status: rename EXIT_STATUS_GLIBC → EXIT_STATUS_LIBCLennart Poettering2019-07-291-2/+2
| | | | | | | | | | After all these two exit codes are defined by ISO C as part of the C library, and it's not the GNU implementation defines them.
* | systemctl: do print all statuses/signals received from pid1Zbigniew Jędrzejewski-Szmek2019-07-291-6/+4
| | | | | | | | | | | | | | If for some reason we do not know some signal, instead of silently skipping it, let's print it numerically. Likewise, 'show' is not the right place to do value filtering for exit codes. If pid1 accepted it, let's just print it with no fuss.
* | shared/bus-util: fix dbus serialization of ↵Zbigniew Jędrzejewski-Szmek2019-07-291-8/+8
| | | | | | | | | | | | | | | | {RestartPrevent,RestartForce,Success}ExitStatus We were passing 1/4th of the size in bytes as argument. So depending on the size of the array, either we'd only transfer a subset of values, or we'd get an alignment error.