Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing conf file is silently ignored #188

Open
mnowotnik opened this issue Oct 4, 2022 · 3 comments
Open

Missing conf file is silently ignored #188

mnowotnik opened this issue Oct 4, 2022 · 3 comments

Comments

@mnowotnik
Copy link

What happens?

When the parameter --RS-conf is set to a missing file, it is silently ignored and the default configuration file is used by Rserve.

What should happen?

Rserve should throw error when invalid input parameters are used.

@s-u
Copy link
Owner

s-u commented Oct 4, 2022

Historically, Rserve considered all settings optional. This is in line with the rationale where you are providing service templates, but they may not be always available depending on the capabilities and setting on the server.

However, we have seen that this can lead to issues - the most prominent case was TLS where any issue with the libraries or keys has lead to silently not starting a secure server, but that it typically not desired.

So, yes, the current behavior is intentional where configuration files optional regardless how they were specified, but I can see an argument for an error in the cases where the file has been explicitly specified yet cannot be read.

@gwd-at
Copy link

gwd-at commented Apr 24, 2023

Historically, Rserve considered all settings optional. This is in line with the rationale where you are providing service templates, but they may not be always available depending on the capabilities and setting on the server.

However, we have seen that this can lead to issues - the most prominent case was TLS where any issue with the libraries or keys has lead to silently not starting a secure server, but that it typically not desired.

So, yes, the current behavior is intentional where configuration files optional regardless how they were specified, but I can see an argument for an error in the cases where the file has been explicitly specified yet cannot be read.

Hello @s-u [Simon]

since It is not really a bug I am inquiring about but connected or related to how CONFIG files are handled I am adding a follow up question on that topic here in this ticket.

I have the feeling that I was not able to work out correctly how to use the -DCONFIG_FILE=... "at compile time" to adjust that /etc/Rserv.conf default - which btw got me a bit confused also since Rserve::run.Rserve shows config.file=Rserve.conf (an additional 'e' in there), but my guess is that the file name should still be Rserv.conf and do I guess correctly that after that change a valid check could be that DCONFIG_FILE then shows up in there as the new function default, or is there another sound method to check that?
Maybe an additional hint in the documentation would be helpful? Reason for me being interested in that is not having write permissions to /etc/ and therefore investigating the use of that parameter?
Thanks for any supportive hints here.

PS: otherwise (when providing a file via --RS-conf at startup) all works like a charm

@s-u
Copy link
Owner

s-u commented Jun 8, 2023

@gwd-at Rserve::run.Rserve and -DCONFIG_FILE have absolutely nothing to do with each other. The latter defines the default in the stand-alone server (/etc/Rserv.conf on unix and Rserv.cfg on Windows) while the former is an R function that starts a server in the current R process so regular R function argument rules apply (since you will be calling it as a function in R).

So if you want to change the default at compile time you'd use something like

PKG_CPPFLAGS='-DCONFIG_FILE="/opt/etc/Rserve.conf"'

but it only applies to the stand-alone server (R CMD Rserve).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants