summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-04-12path-lookup: stop exporting two functionsLennart Poettering
user_runtime_dir() and user_config_home() are not used externally anymore, hence let's not export them anymore.
2016-04-12core: modernize manager_build_unit_patch_cache() a bitLennart Poettering
2016-04-12core: don't reorder drop-ins when changing propertiesLennart Poettering
The drop-in order we present should actually show what we is in effect, hence let's not reorder it when writing changes. After all, just sorting alphabetically is going to break things, as it doesn't respect that /etc breaks /run breaks /usr...
2016-04-12core: don't drop transient drop-ins when loading the restLennart Poettering
Previously, when creating a transient unit, we'd first add the transient drop-ins to the unit, and then normally load any other drop-ins later on top of this, replacing the already loaded drop-ins. Let's not do this, after all the transient drop-ins area already in effect, let's just add what we find on disk, but not replace it.
2016-04-12core: rework logic to drop duplicate and non-existing items from search pathLennart Poettering
Move this into a function of its own, so that we can run it after we ran the generators, so that it takes into account removed generator dirs.
2016-04-12path-lookup: split out logic for mkdir/rmdir of generator dirs in their own ↵Lennart Poettering
functions
2016-04-12core: add a separate unit directory for transient unitsLennart Poettering
Previously, transient units were created below the normal runtime directory /run/systemd/system. With this change they are created in a special transient directory /run/systemd/transient, which only contains data for transient units. This clarifies the life-cycle of transient units, and makes clear they are distinct from user-provided runtime units. In particular, users may now extend transient units via /run/systemd/system, without systemd interfering with the life-cycle of these files. This change also adds code so that when a transient unit exits only the drop-ins in this new directory are removed, but nothing else. Fixes: #2139
2016-04-12path-lookup: add configured unit paths back into search pathLennart Poettering
After all, for test builds they might differ from /etc/systemd/{user|system}, hence they should be included.
2016-04-12core: reuse manager_get_runtime_prefix() at more placesLennart Poettering
2016-04-12install: add root directory to LookupPaths structureLennart Poettering
We use the root directory parameter while putting together the LookupPaths structure, hence let's also store it in the structure as-is. That way we can drop a parameter from half of the functions in install.c Also, let's move the validation of the root paths into lookup_paths_init() so that we can drop even more code from install.c
2016-04-12install: change in_search_path() to take a LookupPaths structureLennart Poettering
Similar to the other calls that operate on the collected path data.
2016-04-12install: rename unit_file_is_generated() → path_is_generator()Lennart Poettering
This way the funciton name matches nicely our other calls path_is_config() and path_is_runtime().
2016-04-12install: be more accurate when checking whether something is runtime ↵Lennart Poettering
configuration Let's actually check the runtime config dir, instead of just /run.
2016-04-12network: hashmap_put() can failLennart Poettering
Let's properly handle hashmap_put() failing.
2016-04-12core: introduce MANAGER_IS_RELOADING() macroLennart Poettering
This replaces the old function call manager_is_reloading_or_reexecuting() which was used only at very few places. Use the new macro wherever we check whether we are reloading. This should hopefully make things a bit more readable, given the nature of Manager:n_reloading being a counter.
2016-04-12core: remove ManagerRunningAs enumLennart Poettering
Previously, we had two enums ManagerRunningAs and UnitFileScope, that were mostly identical and converted from one to the other all the time. The latter had one more value UNIT_FILE_GLOBAL however. Let's simplify things, and remove ManagerRunningAs and replace it by UnitFileScope everywhere, thus making the translation unnecessary. Introduce two new macros MANAGER_IS_SYSTEM() and MANAGER_IS_USER() to simplify checking if we are running in one or the user context.
2016-04-12systemctl: port systemctl over to the new LookupPaths configuration ↵Lennart Poettering
directory fields
2016-04-12install: make use of configuration directory paths in LookupPathsLennart Poettering
Now that the LookupPaths structure contains the directory paths, let's make use of that everywhere instead of duplicating the logic.
2016-04-12core: add configuration directories to LookupPathsLennart Poettering
Let's add a seperate fields for the directories where we place runtime and persistent configuration, so that we can use this in install.c (to be added in a later commit), and we store path information in the same place everywhere.
2016-04-12core: when enabling a generated unit file, return a clean errorLennart Poettering
Let's be precise when the user tries to invoke an "enable" operation on a generated unit file.
2016-04-12core: add a new unit file state "generated"Lennart Poettering
Now that we store the generator directories in LookupPaths we can use this to intrdouce a new unit file state called "generated", for units in these directories. Fixes: #2348
2016-04-12core: rework generator dir logic, move the dirs into LookupPaths structureLennart Poettering
A long time ago – when generators where first introduced – the directories for them were randomly created via mkdtemp(). This was changed later so that they use fixed name directories now. Let's make use of this, and add the genrator dirs to the LookupPaths structure and into the unit file search path maintained in it. This has the benefit that the generator dirs are now normal part of the search path for all tools, and thus are shown in "systemctl list-unit-files" too.
2016-04-12man: minor nspawn doc fixesLennart Poettering
2016-04-12core: drop SysV paths from path-lookup logicLennart Poettering
We don't need it anymore, give that sysv-generator can determine the path on its own now.
2016-04-12sysv-generator: don't use LookupPath logic for determining SysV pathsLennart Poettering
The sysv-generator is the only user of the SysV paths these days, let's make it figure out the right paths on its own. (In a subsequent commit we can then drop the same logic from LookupPath).
2016-04-12import: drop unused definitionLennart Poettering
2016-04-12Merge pull request #3016 from martinpitt/systemctl-enableLennart Poettering
Install: correctly report symlink creations
2016-04-12Do not report masked units as changed (#2921)Zbigniew Jędrzejewski-Szmek
* core/unit: extract checking of stat paths into helper function The same code was repeated three times. * core: treat masked files as "unchanged" systemctl prints the "unit file changed on disk" warning for a masked unit. I think it's better to print nothing in that case. When a masked unit is loaded, set mtime as 0. When checking if a unit with mtime of 0 needs reload, check that the mask is still in place. * test-dnssec: fix build without gcrypt Also reorder the test functions to follow the way they are called from main().
2016-04-12rules: set SYSTEMD_READY=0 on DM_UDEV_DISABLE_OTHER_RULES_FLAG=1 only with ↵Lukáš Nykrýn
ADD event (#2747) The "SYSTEMD_READY=0" will cause automatic unmount of mountpoint that is on top of such DM device if this is used with multipath which sets DM_UDEV_DISABLE_OTHER_RULES_FLAG in case we have a CHANGE event thatcomes after DM multipath device reload when one of the paths is down or up. See https://bugzilla.redhat.com/show_bug.cgi?id=1312011
2016-04-11tests: port udev-test to log_*_errno (#3015)Evgeny Vereshchagin
SYSTEMD_LOG_LEVEL=debug test/udev-test.pl is working now Also, fixes CID 1354602
2016-04-11Install: correctly report symlink creationsMartin Pitt
All callers of create_symlink(), such as install_info_symlink_wants(), expect that to return > 0 if it actually did something, and then return that number. unit_file_enable() uses that to determine if any action was done (carries_install_info != 0) and if not, show a "The unit files have no [Install] section" warning. Return 1 instead of 0 in the two code paths of create_symlink() when the link was created or replaced with a new value. This fixes getting a bogus "No [Install] section" warning when enabling a unit with full path, like "systemctl enable /some/path/myunit.service".
2016-04-11Merge pull request #3014 from msekletar/nspawn-empty-machine-id-v3Lennart Poettering
nspawn: always setup machine id (v3)
2016-04-11nspawn: always setup machine idMichal Sekletar
We check /etc/machine-id of the container and if it is already populated we use value from there, possibly ignoring value of --uuid option from the command line. When dealing with R/O image we setup transient machine id. Once we determined machine id of the container, we use this value for registration with systemd-machined and we also export it via container_uuid environment variable. As registration with systemd-machined is done by the main nspawn process we communicate container machine id established by setup_machine_id from outer child to the main process by unix domain socket. Similarly to PID of inner child.
2016-04-11Merge pull request #3012 from martinpitt/hwdbLennart Poettering
hwdb updates
2016-04-11Merge pull request #3011 from evverx/dont-silently-skip-test-namespaceRonny Chevalier
tests: don't silently skip `test-namespace`
2016-04-11Merge pull request #2996 from keszybz/coverity-fixesMartin Pitt
Coverity fixes
2016-04-11keymap: Add HP ProBook 640 G2Martin Pitt
Fixes #2997
2016-04-11hwdb: Add SteelSeries Sensei Raw mouseMartin Pitt
Fixes #3009
2016-04-10tests: don't silently skip `test-namespace`Evgeny Vereshchagin
2016-04-10Merge pull request #3008 from evverx/udev-test-ignore-some-mount-errorsZbigniew Jędrzejewski-Szmek
tests: ignore some mount errors in test-udev
2016-04-10tests: ignore some mount errors in test-udevEvgeny Vereshchagin
Fixes: $ sudo make distcheck ... FAIL: test/udev-test.pl ... $ vi systemd-229/_build/sub/test/udev-test.pl.log ... failed to mount empty /home/ubuntu/systemd/systemd-229/_inst/lib/udev/rules.d No such file or directory ... failed to mount empty /home/ubuntu/systemd/systemd-229/_inst/lib/udev/rules.d No such file or directory ... 414 errors occurred
2016-04-10Merge pull request #3002 from robertwec/masterMartin Pitt
hwdb: Add MODECOM MC-WM4 and Sharkoon Shark Force
2016-04-10Merge pull request #3004 from tsmock/masterMartin Pitt
hwdb/70-mouse.hwdb: Add Dynex Wired Mouse (DX-WMSE2)
2016-04-09hwdb/70-mouse.hwdb: Add Dynex Wired Mouse (DX-WMSE2)Taylor Smock
2016-04-10hwdb: Add MODECOM MC-WM4 and Sharkoon Shark ForceRobert Węcławski
2016-04-08core/service: only search for pid if loading from file failedZbigniew Jędrzejewski-Szmek
CID #1237511.
2016-04-08core/service: drop return value that is always ignored anywayZbigniew Jędrzejewski-Szmek
2016-04-08shutdown: use (void)Zbigniew Jędrzejewski-Szmek
NULL cgroup is handled below.
2016-04-08nspawn: ignore failure to chdirZbigniew Jędrzejewski-Szmek
CID #1322380.
2016-04-08journal: assert gcry_mpi_scan succeededZbigniew Jędrzejewski-Szmek
It might be nicer to propagate the error to the caller, but that'd be a bigger refactoring. This shouldn't really fail, so just add an assert. CID #1349697.