-
Notifications
You must be signed in to change notification settings - Fork 271
openrc-run: Support standard input redirection too #806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
OpenRC already supports redirecting standard output/error of services. This patch adds support for redirecting standard input as well. I encountered the lack of this feature while working on a user service for a Wayland compositor status bar which reads status text to be displayed from stdin. Input redirection allows me to connect this user services to another user service providing the status text via a named pipe. Note that input redirection is also supported by SystemD (and potentially other service supervisors) through the `StandardInput=` directive [1]. [1]: https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#StandardInput=
the same could be argued for {output,error}_logger tbh, which fwiw i want to default to posix |
8547aea to
654a5f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise looks okay. Some small documentation rewording suggestions:
|
Revised the documentation a bit to make it more concise. Anything else? :) |
OpenRC already supports redirecting standard output/error of services. This patch adds support for redirecting standard input as well. I encountered the lack of this feature while working on a user service for a Wayland compositor status bar which reads status text to be displayed from stdin. Input redirection allows me to connect this user services with another user service providing the status text via a named pipe.
Note that input redirection is also supported by systemd (and potentially other service supervisors) through the
StandardInput=directive [1]. I intentionally did not implement redirection from a program as an input as I believe that in such a case the input program (assuming it is long-running) should be supervised by OpenRC as well and the two should be connected through a named pipe.