summaryrefslogtreecommitdiff
path: root/src/test/test-install-root.c
AgeCommit message (Collapse)Author
2016-10-24install: introduce UnitFileFlagsJan Synacek
Introduce a new enum to get rid of some boolean arguments of unit_file_* functions. It unifies the code, makes it a bit cleaner and extensible.
2016-10-18shared/install: report invalid unit files slightly betterZbigniew Jędrzejewski-Szmek
When a unit file is invalid, we'd return an error without any details: $ systemctl --root=/ enable testing@instance.service Failed to enable: Invalid argument. Fix things to at least print the offending file name: $ systemctl enable testing@instance.service Failed to enable unit: File testing@instance.service: Invalid argument $ systemctl --root=/ enable testing@instance.service Failed to enable unit, file testing@instance.service: Invalid argument. A real fix would be to pass back a proper error message from conf-parser. But this would require major surgery, since conf-parser functions now simply print log errors, but we would need to return them over the bus. So let's just print the file name, to indicate where the error is. (Incomplete) fix for #4210.
2016-07-25shared/install: allow "enable" on linked unit files (#3790)Zbigniew Jędrzejewski-Szmek
User expectations are broken when "systemctl enable /some/path/service.service" behaves differently to "systemctl link ..." followed by "systemctl enable". From user's POV, "enable" with the full path just combines the two steps into one. Fixes #3010.
2016-05-03Merge pull request #3183 from crawford/preset-arrayZbigniew Jędrzejewski-Szmek
install: cache the presets before evaluating
2016-05-01test: ensure presets are evaluated in orderAlex Crawford
This tests to make sure that preset patterns are checked in the order they were declared. Both "prefix-1.service" and "prefix-2.service" match against two rules: their exact name (which enables the service) and "prefix-*.service" (which disables the service). Because of the ordering, only "prefix-1.service" should be enabled.
2016-04-29core: Filter by unit name behind the D-Bus, instead on the client side (#3142)kayrus
This commit improves systemd performance on the systems which have thousands of units.
2016-04-19systemctl: warning about missing install info for template unitsZbigniew Jędrzejewski-Szmek
The advice string didn't talk about template units at all. Extend it and print when trying to enable a template unit without install info. Fixes #2345.
2016-04-16tree-wide: use ERFKILL instead of ESHUTDOWN for "unit masked"Zbigniew Jędrzejewski-Szmek
If the error code ever leaks (we print the strerror error instead of providing our own), the message for ESHUTDOWN is "Cannot send after transport endpoint shutdown", which can be misleading. In particular it suggest that some mishandling of the dbus connection occured. Let's change that to ERFKILL which has the advantage that a) it sounds implausible as actual error, b) has the connotation of disabling something manually.
2016-04-12core,systemctl: add new "systemctl revert" commandLennart Poettering
This allows dropping all user configuration and reverting back to the vendor default of a unit file. It basically undoes what "systemctl edit", "systemctl set-property" and "systemctl mask" do.
2016-04-12test: bump up log level for install root testLennart Poettering
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2015-11-12install: follow unit file symlinks in /usr, but not /etc when looking for ↵Lennart Poettering
[Install] data Some distributions use alias unit files via symlinks in /usr to cover for legacy service names. With this change we'll allow "systemctl enable" on such aliases. Previously, our rule was that symlinks are user configuration that "systemctl enable" + "systemctl disable" creates and removes, while unit files is where the instructions to do so are store. As a result of the rule we'd never read install information through symlinks, since that would mix enablement state with installation instructions. Now, the new rule is that only symlinks inside of /etc are configuration. Unit files, and symlinks in /usr are now valid for installation instructions. This patch is quite a rework of the whole install logic, and makes the following addional changes: - Adds a complete test "test-instal-root" that tests the install logic pretty comprehensively. - Never uses canonicalize_file_name(), because that's incompatible with operation relative to a specific root directory. - unit_file_get_state() is reworked to return a proper error, and returns the state in a call-by-ref parameter. This cleans up confusion between the enum type and errno-like errors. - The new logic puts a limit on how long to follow unit file symlinks: it will do so only for 64 steps at max. - The InstallContext object's fields are renamed to will_process and has_processed (will_install and has_installed) since they are also used for deinstallation and all kinds of other operations. - The root directory is always verified before use. - install.c is reordered to place the exported functions together. - Stricter rules are followed when traversing symlinks: the unit suffix must say identical, and it's not allowed to link between regular units and templated units. - Various modernizations - The "invalid" unit file state has been renamed to "bad", in order to avoid confusion between UNIT_FILE_INVALID and _UNIT_FILE_STATE_INVALID. Given that the state should normally not be seen and is not documented this should not be a problematic change. The new name is now documented however. Fixes #1375, #1718, #1706