-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow logging to stdout, stderr
The --log option accepts "stdout", "stderr" as filenames. This prevents rest-server from opending these files, it simply writs the the STDOUT or STDERR stream provided by the caller. **BREAKING** in case use really used "stdout", "stderr" to specify file names, you'll need to update your rest-server invocation to use "./stdout", "./stderr".
- Loading branch information
1 parent
ea461a2
commit 9345bc1
Showing
3 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Feature: Allos "stdout", "stderr" as filenames for the `--log` option. | ||
|
||
When (e.g. for debugging purpose) the rest server is invoked like | ||
|
||
sudo -u restic rest-server … --log /dev/stdout | ||
|
||
it tries to open `/dev/stdout` (O_CREATE, O_WRITE, O_APPEND). This | ||
operation fails, as in the above invocation, `/dev/stdout` is owned by | ||
the caller (here: root) and only writable for the caller. Subprocesses | ||
get just the filedescriptor. Using `/proc/self/fd/1` didn't work either, | ||
for the same reasons. | ||
|
||
https://github.com/restic/rest-server/pull/217 |
This file contains 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
This file contains 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