Topic/runsvdir improvements#40
Conversation
And close an unused filedescriptor.
Additionally remove overcautious 1s delay and cleanup removed services more quickly.
Did you consider the possibility of using signalfds?
This is great to see, thank you! I did actually do some work on a similar patch myself, but I couldn't get everything right. Perhaps I will take a look at the two versions when I get time in case there's anything I spotted. |
No, for me the selfpipe trick works just fine and is well tested.
Review, testing, bug fixing welcome! |
And adjust declaration in ifdef.
|
With inotify(7), the current implementation doesn't work correctly if dir is the first of a chain of symlinks to the services directory. In this case runsvdir only gets events on changes in the first and last element of the chain, not the intermediates. |
Add a selfpipe to runsvdir to synchronize signal handling with i/o, just as the runit and runsv programs do. This makes SIGCHLD handling faster. Improve the readproctitle log and standard error processing with a buffer.
If the runsvdir program is built on a system that supports inotify(7), it now uses the inotify API to watch the services directory dir.