From 77969722aaef10d9dd8fc13569f9a6d45c1a577e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 1 Mar 2017 16:25:08 +0100 Subject: [PATCH] core: when a unit's SourcePath points to API VFS pretend we are never out-of-date (#5487) If the unit's SourcePath is below /proc then it's a unit genreated from a kernel resource (such as a .mount or .swap unit). And those we watch anyway, and hence should never be out-of-date. Fixes: #5461 --- src/core/unit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/unit.c b/src/core/unit.c index b091a0999b8..f76b6c30a83 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -3154,6 +3154,11 @@ static bool fragment_mtime_newer(const char *path, usec_t mtime, bool path_maske if (!path) return false; + /* If the source is some virtual kernel file system, then we assume we watch it anyway, and hence pretend we + * are never out-of-date. */ + if (PATH_STARTSWITH_SET(path, "/proc", "/sys")) + return false; + if (stat(path, &st) < 0) /* What, cannot access this anymore? */ return true;