diff options
author | June McEnroe <june@causal.agency> | 2021-03-01 19:09:40 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-03-01 19:09:40 -0500 |
commit | 0384c2abd7cc7fa768bb2c2260728f041ac71c47 (patch) | |
tree | d140760d79a0152457eeb5e0d1ee21d194fd2ff6 | |
parent | Add -d flag to catsit-watch (diff) | |
download | catsit-0384c2abd7cc7fa768bb2c2260728f041ac71c47.tar.gz catsit-0384c2abd7cc7fa768bb2c2260728f041ac71c47.zip |
Exit with EX_TEMPFAIL when watching files
Reason being that if a file disappears and it takes longer for it to reappear than the default restart interval, the service would just get stopped. Treat an initially missing file the same as a file that gets deleted.
-rw-r--r-- | catsit-watch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/catsit-watch.c b/catsit-watch.c index 78d1cb2..096449b 100644 --- a/catsit-watch.c +++ b/catsit-watch.c @@ -29,7 +29,7 @@ static void watch(int kq, char *path) { int fd = open(path, O_RDONLY | O_CLOEXEC); - if (fd < 0) err(EX_NOINPUT, "%s", path); + if (fd < 0) err(EX_TEMPFAIL, "%s", path); struct kevent event; EV_SET( |