mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
generators: make automatic discovery generators work correctly when reloading
In addition to checking whether the diestination mount point is populated, check whether it is already a mount point. If it is already a mount point, or if it is unpopulated, let's create the unit.
This commit is contained in:
parent
c3834f9b88
commit
6d26dfe11c
Notes:
Zbigniew Jędrzejewski-Szmek
2014-03-10 20:29:09 -04:00
Backport: bugfix
@ -58,6 +58,7 @@ int main(int argc, char *argv[]) {
|
||||
log_debug("In initrd, exiting.");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (detect_container(NULL) > 0) {
|
||||
log_debug("In a container, exiting.");
|
||||
return EXIT_SUCCESS;
|
||||
@ -68,7 +69,8 @@ int main(int argc, char *argv[]) {
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (dir_is_empty("/boot") <= 0) {
|
||||
if (path_is_mount_point("/boot", true) <= 0 &&
|
||||
dir_is_empty("/boot") <= 0) {
|
||||
log_debug("/boot already populated, exiting.");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -298,7 +298,8 @@ static int add_mount(const char *id, const char *what, const char *where, const
|
||||
assert(fstype);
|
||||
assert(description);
|
||||
|
||||
if (dir_is_empty(where) <= 0) {
|
||||
if (path_is_mount_point(where, true) <= 0 &&
|
||||
dir_is_empty(where) <= 0) {
|
||||
log_debug("%s already populated, ignoring.", where);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user