summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Create src/shared/unit-file.[ch] for unit-file related opsZbigniew Jędrzejewski-Szmek2019-07-1917-54/+76
| | | | | So far we put such functinos in install.[ch], but that is tied too closely to enable/disable. Let's start moving things to a place with a better name.
* shared/dropin: rename function for clarityZbigniew Jędrzejewski-Szmek2019-07-191-2/+4
| | | | | The caller looks for directories and is called "..._find_dirs()". Here, there is no "finding" going on, so I found the old name confusing.
* shared/dropin: use TAKE_PTR in one more placeZbigniew Jędrzejewski-Szmek2019-07-191-19/+11
|
* basic/path-util: move two path_simplify* functions to be adjacentZbigniew Jędrzejewski-Szmek2019-07-192-54/+54
| | | | No functional change.
* pid1: get rid of unit_supported() helperZbigniew Jędrzejewski-Szmek2019-07-192-7/+3
| | | | Another case where "open code" is easier to read than the helper.
* basic/set: constify operations which don't modify SetZbigniew Jędrzejewski-Szmek2019-07-194-14/+14
| | | | No functional change, but it's nicer to the reader.
* pid1: do not say "(null)" if no disabled controllersZbigniew Jędrzejewski-Szmek2019-07-191-1/+1
| | | | It looks like we made a mistake. The list is just empty, that's all.
* pid1: simplify timestamp buffer declarationZbigniew Jędrzejewski-Szmek2019-07-191-14/+8
|
* Rename test-unit-file to test-load-fragmentZbigniew Jędrzejewski-Szmek2019-07-192-1/+1
| | | | | | This file was testing a mix of functions from src/core/load-fragment.c and some from src/shared/install.c. Let's name it more appropriately. I want to add tests for the new unit-file.c too.
* test-unit-file: move some tests to new test-env-file.cZbigniew Jędrzejewski-Szmek2019-07-193-130/+147
|
* test-hashmap: move tests which should also apply to ordered hashmaps and add ↵Zbigniew Jędrzejewski-Szmek2019-07-192-58/+66
| | | | | | | comment Effectively this does two more tests also for ordered hashmaps. This setup is a bit confusing, let's add a comment.
* basic/hashmap: add hashops variant that does strdup/freeing on its ownZbigniew Jędrzejewski-Szmek2019-07-195-0/+60
| | | | | | | So far, we'd use hashmap_free_free to free both keys and values along with the hashmap. I think it's better to make this more encapsulated: in this variant the way contents are freed can be decided when the hashmap is created, and users of the hashmap can always use hashmap_free.
* test-strv: add function headersZbigniew Jędrzejewski-Szmek2019-07-191-7/+86
|
* sysusers,strv: export the hash ops to map char* → strvZbigniew Jędrzejewski-Szmek2019-07-193-35/+67
| | | | Also make string_strv_hashmap_put return 0 only if the entry already existed.
* basic/unit-name: allow unit_name_to_instance() to be used to classify unitsZbigniew Jędrzejewski-Szmek2019-07-193-19/+25
| | | | | | | | | | This could already be done by calling unit_name_is_*(), but if we don't know if the argument is a valid unit name, it is more convenient to have a single function which returns the type or possibly an error if the unit name is not valid. The values in the enum are sorted "by length". Not really important, but it seems more natural to me.
* basic/unit-name: drop unused functionZbigniew Jędrzejewski-Szmek2019-07-191-5/+0
|
* path-util: add path_startswith_strv()Zbigniew Jędrzejewski-Szmek2019-07-193-11/+37
|
* test-path-util: add function headersZbigniew Jędrzejewski-Szmek2019-07-191-0/+33
|
* systemctl: call the unit dbus path dbus_path everywhereZbigniew Jędrzejewski-Szmek2019-07-171-22/+22
| | | | | | Similar variables had differing names: unit, path, unit_path. We also have file system paths in surrounding code. Let's make this easier for the reader and use "dbus_path" consistently.
* pid1: kill unit_file_find_dropin_paths() helperZbigniew Jędrzejewski-Szmek2019-07-173-20/+9
| | | | | | It had two users, but it is just a very thin wrapper around unit_file_find_dropin_paths(), so using it seems more complicated than directly invoking unit_file_find_dropin_paths() twice.
* Merge pull request #12675 from yuwata/network-set-dnsLennart Poettering2019-07-1719-210/+1367
|\ | | | | resolvectl: support to modify interfaces managed by networkd
| * resolve: fix memleakYu Watanabe2019-07-171-0/+3
| |
| * timedatectl: add 'ntp-servers' and 'revert' commands to modify link NTP serversYu Watanabe2019-07-171-0/+103
| |
| * resolvectl: support networkd managed interfacesYu Watanabe2019-07-171-145/+251
| | | | | | | | Closes #9808.
| * network: implement DBus methods to set DNS related propertiesYu Watanabe2019-07-1710-56/+865
| |
| * resolve: expose dns_server_address_valid()Yu Watanabe2019-07-175-18/+19
| |
| * network: introduce GetLinkByName and GetLinkByIndex bus methodsYu Watanabe2019-07-172-0/+79
| |
| * network: implement ListLinks DBus methodYu Watanabe2019-07-172-0/+46
| |
| * network: move manager dbus prototypes to networkd-manager-bus.hYu Watanabe2019-07-175-3/+13
| |
* | mount-util: bind_remount: avoid calling statvfsJakob Unterwurzacher2019-07-171-4/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit "util: Do not clear parent mount flags when setting up namespaces" introduced a statvfs call read the flags of the original mount and have them applied to the bind mount. This has two problems: (1) The mount flags returned by statvfs(2) do not match the flags accepted by mount(2). For example, the value 4096 means ST_RELATIME when returned by statvfs(2), but means MS_BIND when passed to mount(2). (2) A call to statvfs blocks indefinitely when ran against a disconnected network drive ( https://github.com/systemd/systemd/issues/12667 ). We already use libmount to parse `/proc/self/mountinfo` but did not use the mount flag information from there. This patch changes that to use the mount flags parsed by libmount instead of calling statvfs. Only if getting the flags through libmount fails we call statvfs. Fixes https://github.com/systemd/systemd/issues/12667
* | core: ExecCondition= for servicesAnita Zhang2019-07-1713-21/+168
| | | | | | | | Closes #10596
* | Merge pull request #12927 from fbuihuu/coredump-cleanup-part-2Zbigniew Jędrzejewski-Szmek2019-07-171-268/+282
|\ \ | |/ |/| Coredump cleanup part 2
| * coredump: (void)ify all calls of iovw_put_string_field() where we ignore ↵Franck Bui2019-07-161-27/+28
| | | | | | | | | | | | failure on purpose All those calls are dealing with optional metadata.
| * coredump: gather all process metadata in iovecs first and then cache themFranck Bui2019-07-161-247/+260
| | | | | | | | | | | | | | | | | | | | | | | | Now we first gather all process metadata and populate the process info cache with them. In this way, the cache only references metadata recorded in iovecs[] so there's no need to bother freeing (part of) cached metadata later. The other advantage is that the coredump handler mode and the service mode are more similar as the cache is populated in the same way for both cases. It also renames the array indexes so it becomes clear which metadata are passed by the kernel and which ones are retrieved from the runtime environment.
| * coredump: use 'input_fd' name for the pipe fd passed by the kernel everywhereFranck Bui2019-07-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | 'input_fd' variable name is used mostly everywhere except in process_socket() where it's named 'coredump_fd', which is pretty confusing since 'coredump_fd' is used for the coredump filename in submit_coredump(). So let's use 'input_fd' consistently as name for the pipe fd passed by the kernel. No functional changes.
* | Merge pull request #13069 from ↵Yu Watanabe2019-07-172-0/+10
|\ \ | | | | | | | | | | | | yuwata/network-do-not-set-routes-when-carrier-lost network: do not configure routes when dropping addresses
| * | network: do not configure routes when dropping addressesYu Watanabe2019-07-172-0/+10
| | | | | | | | | | | | Follow-up for 4ff296b02411bb4f0dc38f48cbab06f8645d2a08.
* | | pid1: make sure to restore correct default values for some rlimitsFranck Bui2019-07-171-60/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit fb39af4ce42d7ef9af63009f271f404038703704 forgot to restore the default rlimit values (RLIMIT_NOFILE and RLIMIT_MEMLOCK) while PID1 is reloading. This patch extracts the code in charge of initializing the default values for those rlimits in order to create dedicated functions, which take care of their initialization. These functions are then called in parse_configuration() so we make sure that the default values for these rlimits get restored every time PID1 is reloading its configuration.
* | | Merge pull request #13077 from poettering/activate-n-fdsFrantisek Sumsal2019-07-162-9/+14
|\ \ \ | | | | | | | | activate: move array allocation to heap
| * | | journal: properly read unaligned le64 integersLennart Poettering2019-07-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Fixes: #13051 Replaces: #13064
| * | | activate: move array allocation to heapLennart Poettering2019-07-161-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In theory 'n' could get quite large, and some sanitizers notice that, let's hence avoid the stack, and use the heap instead. Moreover, there's no need to include the first 3 fds in the array, close_all() excludes those anyway. See: #13064
* | | | Merge pull request #13076 from keszybz/pr/13062Zbigniew Jędrzejewski-Szmek2019-07-165-115/+113
|\ \ \ \ | |_|/ / |/| | | Timer formatting fixes
| * | | tree-wide: use lowercase table headersZbigniew Jędrzejewski-Szmek2019-07-162-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/systemd/systemd/pull/13062#discussion_r303847484 > the formatter uppercases them anyway, and this way the JSON output of the > formatter is nicer as it uses the table header fields 1:1 for the json > output.
| * | | pid1: split out another helper func for two similar code pathsZbigniew Jędrzejewski-Szmek2019-07-161-42/+41
| | | |
| * | | pid1: split out helper func for two similar code pathsZbigniew Jędrzejewski-Szmek2019-07-161-46/+40
| | | |
| * | | run: move comment to appropriate placeZbigniew Jędrzejewski-Szmek2019-07-161-1/+1
| | | |
| * | | systemctl: print non-elapsing timers as "n/a" not "(null)"Zbigniew Jędrzejewski-Szmek2019-07-161-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | TimersCalendar={ OnCalendar=1970-01-01 00:00:00 UTC ; next_elapse=(null) } ↓ TimersCalendar={ OnCalendar=1970-01-01 00:00:00 UTC ; next_elapse=n/a }
| * | | analyze: fix formatting of timestamps with 0 µsZbigniew Jędrzejewski-Szmek2019-07-151-5/+7
| | | | | | | | | | | | | | | | | | | | There is a rule that "%.0d" formats 0 as "". There is no such rule for "%0d" and 0 :(. The output had an extra 0 if usec was 0.
* | | | Merge pull request #12925 from yuwata/network-generatorLennart Poettering2019-07-165-0/+1998
|\ \ \ \ | | | | | | | | | | network-generator: introduce new tool systemd-network-generator
| * | | | test: add simple tests for network-generatorYu Watanabe2019-07-142-0/+444
| | | | |