manager: rework generator logic

Previously generated units were always placed at the end of the search
path. With this change there will be three unit dirs instead of one, to
place generated entries at the beginning, in the middle and at the end
of the search path:

beginning: for units that need to override all configuration, regardless
of user or vendor. Example use: system-update-generator uses this to
temporarily redirect default.target.

middle: for units that need to override vendor configuration, but not
vendor configuration. Example use: /etc/fstab should override vendor
supplied configuration (think /tmp), but should not override native user
configuration.

end: does not override anything but is available as well. Possible usage
might be to convert D-Bus bus service files to native units but allowing
vendor supplied native units to win.
This commit is contained in:
Lennart Poettering
2012-05-23 03:43:29 +02:00
parent 7c4c5f68a5
commit 07719a21b6
13 changed files with 332 additions and 185 deletions
+2 -2
View File
@@ -240,8 +240,8 @@ int main(int argc, char *argv[]) {
int r = EXIT_SUCCESS;
unsigned n = 0;
if (argc > 2) {
log_error("This program takes one or no arguments.");
if (argc > 1 && argc != 4) {
log_error("This program takes three or no arguments.");
return EXIT_FAILURE;
}