openrc-run: Support standard input redirection too#806
Merged
navi-desu merged 1 commit intoOpenRC:masterfrom Mar 24, 2025
Merged
openrc-run: Support standard input redirection too#806navi-desu merged 1 commit intoOpenRC:masterfrom
navi-desu merged 1 commit intoOpenRC:masterfrom
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=
navi-desu
reviewed
Mar 18, 2025
Member
the same could be argued for {output,error}_logger tbh, which fwiw i want to default to posix |
N-R-K
suggested changes
Mar 18, 2025
8547aea to
654a5f4
Compare
N-R-K
reviewed
Mar 18, 2025
Contributor
N-R-K
left a comment
There was a problem hiding this comment.
Code wise looks okay. Some small documentation rewording suggestions:
Contributor
Author
|
Revised the documentation a bit to make it more concise. Anything else? :) |
N-R-K
approved these changes
Mar 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.