mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
pidfile: monitor renamed files, e.g. rsyslogd.pid.tmp
Signed-off-by: Robert Andersson <robert.m.andersson@se.atlascopco.com>
This commit is contained in:
+3
-2
@@ -64,7 +64,7 @@ static void pidfile_callback(void *arg, int fd, int events)
|
||||
continue;
|
||||
|
||||
mkcond(cond, sizeof(cond), svc->cmd);
|
||||
if (ev->mask & (IN_CREATE | IN_ATTRIB | IN_MODIFY)) {
|
||||
if (ev->mask & (IN_CREATE | IN_ATTRIB | IN_MODIFY | IN_MOVED_TO)) {
|
||||
svc_started(svc);
|
||||
cond_set(cond);
|
||||
} else if (ev->mask & IN_DELETE)
|
||||
@@ -111,6 +111,7 @@ static void pidfile_init(void *arg)
|
||||
{
|
||||
char *path;
|
||||
struct context *ctx = arg;
|
||||
uint32_t mask = IN_CREATE | IN_ATTRIB | IN_DELETE | IN_MODIFY | IN_MOVED_TO;
|
||||
|
||||
/*
|
||||
* The bootmisc plugin is responsible for setting up /var/run.
|
||||
@@ -123,7 +124,7 @@ static void pidfile_init(void *arg)
|
||||
return;
|
||||
}
|
||||
|
||||
ctx->wd = inotify_add_watch(ctx->fd, path, IN_CREATE | IN_ATTRIB | IN_DELETE | IN_MODIFY);
|
||||
ctx->wd = inotify_add_watch(ctx->fd, path, mask);
|
||||
free(path);
|
||||
|
||||
if (ctx->wd < 0) {
|
||||
|
||||
Reference in New Issue
Block a user