radvd-project / radvd

radvd | Official repository: https://github.com/radvd-project/radvd
https://radvd.litech.org/
Other
203 stars 107 forks source link

change handling of default log level #72

Closed nachtgeist closed 7 years ago

nachtgeist commented 7 years ago

The default behavior is to daemonize, however the default log level is L_STDERR_SYSLOG which leaves STDERR bleeding into the console. Thus, change the default log method to L_SYSLOG (which fits daemonizing) and automatically change it to L_STDERR_SYSLOG if --nodaemon was specified on the command-line. However, the latter only takes effect, if the log method wasn't specified explicitly.

Fixes #71.

robbat2 commented 7 years ago

@reubenhwk thinking about it more, yes, if we are daemonizing, I can't think of any useful reason to keep stdin/stdout/stderr open.

reubenhwk commented 7 years ago

I changed the code to close stderr and stdout regardless when daemonizing. Please checkout the code on master and let me know if that's working for you. If so, I'll cut a 2.17.

nachtgeist commented 7 years ago

Yup, that's a cleaner way to go. Tested via ssh, which now exits as expected, after radvd has daemonized.

Thanks!