summaryrefslogtreecommitdiffstats
path: root/src/machine (follow)
Commit message (Collapse)AuthorAgeFilesLines
* systemctl,loginctl,machinectl: use a shared helper for arg_signalZbigniew Jędrzejewski-Szmek2021-02-141-9/+4
| | | | | I seems frivolous to yet another two -util.[ch] files, but the helper should be in shared/ and it doesn't seem to fit anywhere else.
* machinectl: write arg_* only after verifying the valueZbigniew Jędrzejewski-Szmek2021-02-101-12/+12
|
* tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-101-3/+3
| | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
* Merge pull request #18375 from yuwata/cli-tools-also-read-kernel-command-lineZbigniew Jędrzejewski-Szmek2021-02-082-2/+2
|\ | | | | tree-wide: make CLI tools also read kernel command line when run as service
| * tree-wide: enable colorized logging for daemons when run in consoleYu Watanabe2021-01-312-2/+2
| | | | | | | | It may be useful when debugging daemons.
* | shared: rename machine-image.[ch] → discover-image.[ch]Lennart Poettering2021-02-033-3/+3
|/ | | | | | | | | | The old name originates when this was used to discover "machine" images, as managed by machined/machinectl. But nowadays this is also used by portable services and system extensions, hence let's use a more generic name for this API. Taking inspiration from "dissect-image.[ch]", let's call this "discover-image.[ch]". This is pure renaming, no other changes.
* tree-wide: Drop custom formatting for print() help messagesDaan De Meyer2021-01-311-8/+7
| | | | | | | | | | | | I think this formatting was originally used because it simplified adding new options to the help messages. However, these days, most tools their help message end with "\nSee the %s for details.\n" so the final line almost never has to be edited which eliminates the benefit of the custom formatting used for printf() help messages. Let's make things more consistent and use the same formatting for printf() help messages that we use everywhere else. Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
* varlink: make 'userdata' pointer inheritance from varlink server to ↵Lennart Poettering2021-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | connection optional @keszybz's right on https://github.com/systemd/systemd/pull/18248#issuecomment-760798473: swapping out the userdata pointer of a live varlink connection is iffy. Let's fix this by making the userdata inheritance from VarlinkServer object to the Varlink connection object optional: we want it for most cases, but not all, i.e. all those cases where the calls implemented as varlink methods are stateless and can be answered synchronously. For the other cases (i.e. where we want per-connection objects that wrap the asynchronous operation as it goes on) let's not do such inheritance but initialize the userdata pointer only once we have it. THis means the original manager object must be manually retrieved from the VarlinkServer object, which in turn needs to be requested from the Varlink connection object. The userdata inheritance is now controlled by the VARLINK_INHERIT_USERDATA flag passed at VarlinkServer construction. Alternative-to: #18248
* machine: Use hashmap_ensure_putSusant Sahani2021-01-201-5/+1
|
* machine-image: properly support searching for images below some --root= pathLennart Poettering2021-01-192-6/+6
| | | | | systemd-sysext supports --root= for everything but the image discovery. Fix that.
* meson: enable several tests even if the relevant features are disabledYu Watanabe2021-01-181-2/+1
|
* meson: make the second and third elements of tests or fuzzers optionalYu Watanabe2021-01-181-1/+1
| | | | Then, we can shorten many test definitions.
* machine: adjust error message to use 'normalized' instead of ../Luca Boccassi2021-01-181-2/+2
|
* machine/basic: factor out helper function to add airlocked mount to namespaceLuca Boccassi2021-01-181-206/+8
|
* machine: machined-dbus - tighten variable scope used in loopSusant Sahani2021-01-171-3/+1
|
* string-util: imply NULL termination of strextend() argument listLennart Poettering2021-01-061-1/+4
| | | | | The trailing NULL in the argument list is now implied (similar to what we already have in place in strjoin()).
* basic: add make_mount_point_inode helperLuca Boccassi2020-12-211-10/+4
| | | | | Creates a file or a directory depending on the source path, useful for creating mount points.
* hostname-util: flagsify hostname_is_valid(), drop machine_name_is_valid()Lennart Poettering2020-12-153-10/+10
| | | | | | | | | | | | Let's clean up hostname_is_valid() a bit: let's turn the second boolean argument into a more explanatory flags field, and add a flag that accepts the special name ".host" as valid. This is useful for the container logic, where the special hostname ".host" refers to the "root container", i.e. the host system itself, and can be specified at various places. let's also get rid of machine_name_is_valid(). It was just an alias, which is confusing and even more so now that we have the flags param.
* machine: drop really old kdbus left-overLennart Poettering2020-12-151-1/+1
| | | | | The "x-machine-kernel" dbus address has been removed a long time ago, hence don't generate it either.
* Make support for nscd flushing optionalZbigniew Jędrzejewski-Szmek2020-12-073-0/+10
| | | | | | | | | Fedora will deprecate support for nscd in the upcoming release [1] and plans to drop it in the next one [2]. At that point we might as well build systemd without that support too, since there'll be nothing to talk too. [1] https://fedoraproject.org/wiki/Changes/DeprecateNSCD [2] https://fedoraproject.org/wiki/Changes/RemoveNSCD
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-0919-19/+19
|
* tree-wide: assorted coccinelle fixesFrantisek Sumsal2020-10-091-72/+62
|
* tree-wide: port remaining umount() calls to umount_verbose()Lennart Poettering2020-09-231-4/+4
|
* tree-wide: switch remaining mount() invocations over to mount_nofollow_verbose()Lennart Poettering2020-09-231-14/+20
| | | | | | (Well, at least the ones where that makes sense. Where it does't make sense are the ones that re invoked on the root path, which cannot possibly be a symlink.)
* machine: fix error code propagation in two casesLennart Poettering2020-09-231-2/+2
|
* tree-wide: don't needlessly negate error number passed to bus_error_message()Lennart Poettering2020-09-141-16/+16
| | | | | | Like it's customary in our codebase bus_error_message() internally takes abs() of the passed error anyway, hence no need to explicitly negate it. We mostly got this right, but in too many cases we didn't. Fix that.
* tree-wide: copy hardlinks wherever we deal with possibly large OS-style treesLennart Poettering2020-09-091-1/+1
| | | | Fixes: #7382
* tree-wide: define iterator inside of the macroZbigniew Jędrzejewski-Szmek2020-09-085-18/+9
|
* tree-wide: drop pointless zero initialization (#16900)fangxiuning2020-08-291-1/+1
|
* Replace gendered pronouns with gender neutral ones. (#16844)PhoenixDiscord2020-08-271-1/+1
|
* tree-wide: use sd_bus_error_has_names() in more placesZbigniew Jędrzejewski-Szmek2020-08-241-8/+8
|
* nspawn/machine: move mount propagation dir to /run/host/incomingLennart Poettering2020-08-201-5/+3
| | | | | | | | | | | | | | | Previously we'd use a directory /run/systemd/nspawn/incoming for accepting mounts to propagate from the host. This is a bit weird, since we have a shared namespace: /run/systemd/ contains both stuff managed by the surround nspawn as well as from the systemd inside. We now have the /run/host/ hierarchy that has special stuff we want to pass from host to container. Let's make use of that here, and move this directory here too. This is not a compat breakage, since the payload never interfaces with that directory natively: it's only nspawn and machined that need to agree on it.
* core,home,machined: generate description fields for all groups we synthesizeLennart Poettering2020-08-071-9/+28
|
* machine: Pass machine, user, program values to polkit on OpenMachineShellMarti Raudsepp2020-08-031-5/+12
| | | | | | | | | | | | | | | | | This allows more granular access control in PolicyKit rules, similar to /etc/sudoers, for polkit actions: * org.freedesktop.machine1.host-shell * org.freedesktop.machine1.shell Example configuration, place in /etc/polkit-1/rules.d/ polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.machine1.host-shell" && subject.user == "my-user" && action.lookup("user") == "target-user") { return polkit.Result.YES; } });
* bus: use bus_log_connect_error to print error messagefangxiuning2020-07-211-1/+1
|
* machine: fix if checkLennart Poettering2020-07-161-1/+1
| | | | Fixes: coverity 1430462
* machined: implement user/group lookup varlink API in machined tooLennart Poettering2020-07-145-5/+432
| | | | | | Let's natively support our own API in machined too. This allows us to remove half of nss-mymachines in a later commit.
* machined: refactor UID/GID machine translationLennart Poettering2020-07-145-171/+260
| | | | | | | Let's move the heavy lifting out of the bus call implemntations, and into generic code. This allows us to expose them easily via Varlink too in a later commit.
* table use table_log_print_error() instead of table_log_show_errorfangxiuning2020-07-081-1/+1
|
* table add table_log_sort_error()fangxiuning2020-07-081-1/+1
|
* table add table_log_show_error()fangxiuning2020-07-081-1/+1
|
* shared: split out property get helpersLennart Poettering2020-06-303-1/+3
| | | | No code changes, just some refactoring.
* shared: split out code for printing propertiesLennart Poettering2020-06-301-0/+1
| | | | No code changes, just some refactoring.
* shared: split out code that maps properties to local structsLennart Poettering2020-06-301-0/+1
| | | | Just some refactoring, no code changes.
* shared: actually move all BusLocator related calls to bus-locator.cLennart Poettering2020-06-304-4/+4
|
* shared: split out BusObjectImplementor APIsLennart Poettering2020-06-301-1/+1
| | | | Just some refactoring, no code changes
* log: introduce log_parse_environment_cli() and log_setup_cli()Filipe Brandenburger2020-06-241-3/+1
| | | | | | | | | | | | | | | | Presently, CLI utilities such as systemctl will check whether they have a tty attached or not to decide whether to parse /proc/cmdline or EFI variable SystemdOptions looking for systemd.log_* entries. But this check will be misleading if these tools are being launched by a daemon, such as a monitoring daemon or automation service that runs in background. Make log handling of CLI tools uniform by never checking /proc/cmdline or EFI variables to determine the logging level. Furthermore, introduce a new log_setup_cli() shortcut to set up common options used by most command-line utilities.
* machine: switch to BusLocator-oriented helpersVito Caputo2020-05-074-322/+49
| | | | Mechanical substitution reducing some verbosity
* tree-wide: Mark as _unused_ variables that are only used in assert()Benjamin Robin2020-05-061-2/+2
| | | | Allow to build without any warning with NDEBUG defined
* machined: convert to the new scheme and add --bus-introspectZbigniew Jędrzejewski-Szmek2020-05-057-145/+149
|