systemd: do not remove empty paths from unit lookup path
The ability to start a new unit with 'systemctl start ...' should not depend on whether there are other units in the directory. Previously, an additional 'systemctl daemon-reload' would be necessary to tell systemd to update the list of unit lookup paths.
This commit is contained in:
@@ -316,7 +316,6 @@ int lookup_paths_init(
|
||||
return -ENOMEM;
|
||||
|
||||
strv_uniq(p->unit_path);
|
||||
path_strv_remove_empty(p->unit_path);
|
||||
|
||||
if (!strv_isempty(p->unit_path)) {
|
||||
|
||||
@@ -379,8 +378,6 @@ int lookup_paths_init(
|
||||
|
||||
strv_uniq(p->sysvinit_path);
|
||||
strv_uniq(p->sysvrcnd_path);
|
||||
path_strv_remove_empty(p->sysvinit_path);
|
||||
path_strv_remove_empty(p->sysvrcnd_path);
|
||||
|
||||
if (!strv_isempty(p->sysvinit_path)) {
|
||||
|
||||
|
||||
@@ -190,13 +190,17 @@ char **path_strv_canonicalize(char **l) {
|
||||
|
||||
errno = 0;
|
||||
u = canonicalize_file_name(t);
|
||||
free(t);
|
||||
|
||||
if (!u) {
|
||||
if (errno == ENOMEM || !errno)
|
||||
enomem = true;
|
||||
if (errno == ENOENT)
|
||||
u = t;
|
||||
else {
|
||||
free(t);
|
||||
if (errno == ENOMEM || !errno)
|
||||
enomem = true;
|
||||
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
l[k++] = u;
|
||||
|
||||
Reference in New Issue
Block a user