rest-server/changelog/unreleased/pull-217
Heiko Schlittermann (HS12-RIPE) 9f074d8b3a
feat: allow logging to stdout
The --log option accepts "-" as filename. This prevents rest-server from
opening the log file, it simply writes to the STDOUT stream provided by
the caller.

**BREAKING** in case use really used "-" to specify a file named "-"
you'll need to update your rest-server invocation to use "./-".
2023-04-24 11:15:38 +02:00

13 lines
527 B
Text

Feature: Allows "-" as filename 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