-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Otherwise fall back to open(/dev/foo)
- Loading branch information
Showing
1 changed file
with
14 additions
and
1 deletion.
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
08dbb54
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.
@alandekok Hi, this patch will work for me and all I need is to redirect the logs to stdout. So it solves my issue.
But I've noticed that in some cases it still might not work.
I have a shell file that I am using as Docker container entrypoint that starts radiusd with next options.
radiusd -fl stdout; linenlog option filename = /dev/stderr: - no logs from linelog
radiusd -fl stderr; linenlog option filename = /dev/stderr: - no logs at all
radiusd -fxxl stderr; linenlog option filename = /dev/stderr: - no logs at all
radiusd -fxxl stdout; linenlog option filename = /dev/stderr: - error: rlm_linelog: Failed to open /dev/stderr: Permission denied
I guess only the last case is an issue and using -fl stderr is not expected.
I am not sure how properly to fix this in exfile.c. and I've planned to submit PR for rlm_linelog that will just use fprintf(). But now after seeing this commit, I am not sure if my plan is the best option.
08dbb54
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.
we can't use
fprintf()
in rlm_linelog. It will still use stdout / stderr, and that has all of the same problems as just usingwrite()
.'I don't know why it doesn't write to stderr. I'd have to look into it, and I don't have time right now. The simplest solution is just to use stdout.