Skip to content

Topic/runsvdir improvements#40

Draft
g-pape wants to merge 5 commits into
nextfrom
topic/runsvdir-improvements
Draft

Topic/runsvdir improvements#40
g-pape wants to merge 5 commits into
nextfrom
topic/runsvdir-improvements

Conversation

@g-pape
Copy link
Copy Markdown
Owner

@g-pape g-pape commented May 3, 2026

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.

@andy-bower
Copy link
Copy Markdown
Contributor

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.

Did you consider the possibility of using signalfds?

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.

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.

@g-pape
Copy link
Copy Markdown
Owner Author

g-pape commented May 3, 2026

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.

Did you consider the possibility of using signalfds?

No, for me the selfpipe trick works just fine and is well tested.

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.

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.

Review, testing, bug fixing welcome!

@g-pape
Copy link
Copy Markdown
Owner Author

g-pape commented May 10, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants