summaryrefslogtreecommitdiff
path: root/src/machine/machined.c
Commit message (Collapse)AuthorAgeFilesLines
* machined: add support for memory pressure + SIGRTMIN+18Lennart Poettering2023-03-011-1/+11
|
* machine: propagate error from machine_newDavid Tardon2022-12-141-3/+3
|
* time-util: assume CLOCK_BOOTTIME always existsLennart Poettering2022-03-281-1/+1
| | | | | | | | Let's raise our supported baseline a bit: CLOCK_BOOTTIME started to work with timerfd in kernel 3.15 (i.e. back in 2014), let's require support for it now. This will raise our baseline only modestly from 3.13 → 3.15.
* Define FOREACH_DIRENT through FOREACH_DIRENT_ALLZbigniew Jędrzejewski-Szmek2021-12-151-1/+0
| | | | As in the previous commit, 'de' is used as the iterator variable name.
* shared: clean up mkdir.h/label.h situationLennart Poettering2021-11-161-1/+1
| | | | | | | | | | Previously the mkdir_label() family of calls was implemented in src/shared/mkdir-label.c but its functions partly declared ins src/shared/label.h and partly in src/basic/mkdir.h (!!). That's weird (and wrong). Let's clean this up, and add a proper mkdir-label.h matching the .c file.
* tree-wide: warn when sd_notify fails with READY=1 or FDSTOREREMOVE=1Zbigniew Jędrzejewski-Szmek2021-11-031-9/+5
| | | | | | | | Most sd_notify() calls are like log_info() — the result is only informative and if they fail, it's best ignore this. But if a call with READY=1 fails, the unit may enter a failed state, so we should warn about this. Similarly for FSTOREREMOVE=1: the manager may be left with a stale fd, at least wasting resources.
* Merge pull request #18375 from yuwata/cli-tools-also-read-kernel-command-lineZbigniew Jędrzejewski-Szmek2021-02-081-1/+1
|\ | | | | 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-02-011-1/+1
| | | | | | | | It may be useful when debugging daemons.
* | shared: rename machine-image.[ch] → discover-image.[ch]Lennart Poettering2021-02-031-1/+1
|/ | | | | | | | | | 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.
* hostname-util: flagsify hostname_is_valid(), drop machine_name_is_valid()Lennart Poettering2020-12-151-1/+1
| | | | | | | | | | | | 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.
* Make support for nscd flushing optionalZbigniew Jędrzejewski-Szmek2020-12-071-0/+2
| | | | | | | | | 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-091-1/+1
|
* tree-wide: define iterator inside of the macroZbigniew Jędrzejewski-Szmek2020-09-081-2/+1
|
* tree-wide: drop pointless zero initialization (#16900)fangxiuning2020-08-301-1/+1
|
* machined: implement user/group lookup varlink API in machined tooLennart Poettering2020-07-141-0/+11
| | | | | | Let's natively support our own API in machined too. This allows us to remove half of nss-mymachines in a later commit.
* shared: actually move all BusLocator related calls to bus-locator.cLennart Poettering2020-06-301-1/+1
|
* machine: switch to BusLocator-oriented helpersVito Caputo2020-05-071-33/+5
| | | | Mechanical substitution reducing some verbosity
* machined: convert to the new scheme and add --bus-introspectZbigniew Jędrzejewski-Szmek2020-05-051-19/+4
|
* importd,logind: add --bus-introspect= optionZbigniew Jędrzejewski-Szmek2020-05-051-0/+1
|
* logind,importd,hostnamed,localed,timedated,machined,resolved: add option ↵Zbigniew Jędrzejewski-Szmek2020-05-031-5/+7
| | | | | | | | parsing stubs --help and --version are implemented in the usual style. help() prints full path, since the program is not expected to be in $PATH.
* tree-wide: implement new log control API dbus interface in all our daemonsLennart Poettering2020-04-211-0/+5
|
* shared: split out polkit stuff from bus-util.c → bus-polkit.cLennart Poettering2020-01-221-1/+1
| | | | | | It's enough, complex stuff to warrant its own source file. No other changes, just splitting out.
* headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2019-03-271-0/+2
| | | | | This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
* tree-wide: make sure to flush/close all bus connections when our daemons exitLennart Poettering2019-01-171-1/+1
| | | | | | | Let's make sure everything is written out ebfore we exit, so that no messages keep our bus connections referenced. Fixes: #11462
* machined: flush nscd caches whenever a machine comes/goesLennart Poettering2018-12-151-0/+1
| | | | This way, nss-mymachines should always serve authoritative data.
* machined: fix memory corruptionLennart Poettering2018-12-151-5/+4
| | | | | | Let's make sure the first hashmap we destroy also frees all machines, because otherwise when freeing the other hashmaps we'll try to deregister the contained machines from the hashmaps already destroyed.
* machine: introduce machine_hash_ops and use itYu Watanabe2018-12-021-6/+4
|
* machine-image: introduce image_hash_ops and use itYu Watanabe2018-12-021-2/+1
|
* log: introduce new helper call log_setup_service()Lennart Poettering2018-11-201-3/+1
| | | | | Let's reduce the common boilerplate and have a single setup function used by all service code to setup logging.
* util-lib: move main() definition macros to its own header fileLennart Poettering2018-11-191-0/+1
| | | | | | | | | This way, we can extend the macro a bit with stuff pulled in from other headers without this affecting everything which pulls in macro.h, which is one of our most basic headers. This is just refactoring, no change in behaviour, in prepartion for later changes.
* machined: define main through macroZbigniew Jędrzejewski-Szmek2018-11-171-15/+9
|
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-3/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* machined: minor code cleanups, such as voidifying callsLennart Poettering2018-04-271-4/+9
|
* machined: some modernizationsLennart Poettering2018-04-171-32/+38
| | | | | | | | | | | | | | | | | A couple of minor modernizations: 1. Don't unnecessarily export functions we don't call outside of machined.c 2. Use cleanup logic for the manager object. 3. Propagate errors properly from manager_new(). So far if sd_event_new() returns EMFILE/ENFILE for some reason we would have logged that as log_oom(), which isn#t right, really. 4. Handle SIGTERM/SIGINT cleanly. It's easy, and prettier then letting the kernel just abort us. It also makes it possible to valgrind machined properly.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* tree-wide: use TAKE_PTR() and TAKE_FD() macrosYu Watanabe2018-04-051-3/+2
|
* machined: change check_gc to may_gc everywheregc-cleanupZbigniew Jędrzejewski-Szmek2018-02-151-2/+2
|
* tree-wide: make the Subscribe() method calls asynchronous tooLennart Poettering2018-01-051-8/+6
|
* tree-wide: install matches asynchronouslyLennart Poettering2018-01-051-41/+37
| | | | | | | | | Let's remove a number of synchronization points from our service startups: let's drop synchronous match installation, and let's opt for asynchronous instead. Also, let's use sd_bus_match_signal() instead of sd_bus_add_match() where we can.
* tree-wide: make name requesting asynchronous in all our servicesLennart Poettering2018-01-051-2/+2
| | | | | This optimizes service startup a bit, and makes it less prone to deadlocks.
* tree-wide: use SPECIAL_ROOT_SLICEZbigniew Jędrzejewski-Szmek2017-12-151-1/+2
|
* Add set/hashmap helpers for non-trivial freeing and use where straighforwardZbigniew Jędrzejewski-Szmek2017-11-281-5/+1
| | | | | | A macro is needed because otherwise we couldn't ensure type safety. Some simple tests are included. No functional change intended.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* tree-wide: make use of getpid_cached() wherever we canLennart Poettering2017-07-201-2/+3
| | | | | | | This moves pretty much all uses of getpid() over to getpid_raw(). I didn't specifically check whether the optimization is worth it for each replacement, but in order to keep things simple and systematic I switched over everything at once.
* Rename formats-util.h to format-util.hZbigniew Jędrzejewski-Szmek2016-11-071-1/+1
| | | | | | We don't have plural in the name of any other -util files and this inconsistency trips me up every time I try to type this file name from memory. "formats-util" is even hard to pronounce.
* treewide: fix typos and remove accidental repetition of wordsTorstein Husebø2016-07-111-1/+1
|
* machined: run clone operation asynchronously in the backgroundLennart Poettering2016-05-021-0/+8
| | | | | | | | | | | | | Cloning an image can be slow, if the image is not on a btrfs subvolume, hence let's make sure we do this asynchronously in a child process, so that machined isn't blocked as long as we process the client request. This adds a new, generic "Operation" object to machined, that is used to track these kind of background processes. This is inspired by the MachineOperation object that already exists to make copy operations asynchronous. A later patch will rework the MachineOperation logic to use the generic Operation instead.
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering2015-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLIB has recently started to officially support the gcc cleanup attribute in its public API, hence let's do the same for our APIs. With this patch we'll define an xyz_unrefp() call for each public xyz_unref() call, to make it easy to use inside a __attribute__((cleanup())) expression. Then, all code is ported over to make use of this. The new calls are also documented in the man pages, with examples how to use them (well, I only added docs where the _unref() call itself already had docs, and the examples, only cover sd_bus_unrefp() and sd_event_unrefp()). This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we tend to call our destructors these days. Note that this defines no public macro that wraps gcc's attribute and makes it easier to use. While I think it's our duty in the library to make our stuff easy to use, I figure it's not our duty to make gcc's own features easy to use on its own. Most likely, client code which wants to make use of this should define its own: #define _cleanup_(function) __attribute__((cleanup(function))) Or similar, to make the gcc feature easier to use. Making this logic public has the benefit that we can remove three header files whose only purpose was to define these functions internally. See #2008.