Closed djanderson closed 9 years ago
I did not realize /var/tmp is root only access (on our linux installs it is not). I wonder why it is owned by root in your system.
From: Douglas Anderson notifications@github.com Sent: Monday, May 18, 2015 10:44 AM To: usnistgov/SpectrumBrowser Cc: Ranganathan, Mudumbai Subject: [SpectrumBrowser] Having ant install MSODConfig.json creates difficulties (#175)
@ranganathanmhttps://github.com/ranganathanm,
I know you asked me for input on this, so I apologize for getting back to you about it after you implemented it.
Using ant to dynamically create/install the the MSODConfig is causing a few problems. Now you have to run the build with root privs (to write to /var/tmp), and that in turn nukes the environment, unless run with "sudo -E", so the build fails on finding GWT_HOME.
As part of my Makefile branch, I've implemented an "install" target that does exactly what we need for the MSOD config: it takes a existing conf file saved somewhere in the SpectrumBrowser dir structure, modifies it if necessary (like hard-coding the location of the repository) and then installs them into the /etc directory, which is the preferred location for system-wide config files.
I propose to revert the changes to ant build, create a "msod.conf" file with some default parameters, then use Makefile to install that into /etc/msod.conf. It can still be json.
Again, I know you asked me for comments on this before. I just picked this back up after about 2 weeks "off".
What do you think?
Reply to this email directly or view it on GitHubhttps://github.com/usnistgov/SpectrumBrowser/issues/175.
Oops, it's not root access only. It is/should be owned by root on all systems, though. Not sure why the build failed previously... I think it may have failed because the file already existed?
Anyway, I still think that a "build" process is not the right place to install a file outside of the build tree... especially hijacking the ant build to install a file for flask. /var/tmp is also a directory for (obviously) temporary files, and it often gets wiped between reboots. I still think the best location for a system-wide config file is the /etc directory, and the proper way to install it is within the "install" target and not a "build" target. Is there a specific reason you chose /var/tmp?
/var/tmp does not get wiped between reboots as a rule. Indeed thats why it exists. Whereas /tmp can be wiped between reboots (nobody should put anything there that is expected to survive reboots) /var/tmp can't be (at least it should not be).
Yes we can put things in /etc (and that would be the right thing to do for deployment) but you'd need root access to do so and it would therefore be inconvenient for testing and development. Perhaps flaskr.py should look in /etc first and if it does not find the MSODconfig file there, it should look in /var/tmp
How does that sound?
From: Douglas Anderson notifications@github.com Sent: Monday, May 18, 2015 11:05 AM To: usnistgov/SpectrumBrowser Cc: Ranganathan, Mudumbai Subject: Re: [SpectrumBrowser] Having ant install MSODConfig.json creates difficulties (#175)
Oops, it's not root access only. It is/should be owned by root on all systems, though. Not sure why the build failed previously... I think it may have failed because the file already existed?
Anyway, I still think that a "build" process is not the right place to install a file outside of the build tree... especially hijacking the ant build to install a file for flask. /var/tmp is also a directory for (obviously) temporary files, and it often gets wiped between reboots. I still think the best location for a system-wide config file is the /etc directory, and the proper way to install it is within the "install" target and not a "build" target. Is there a specific reason you chose /var/tmp?
Reply to this email directly or view it on GitHubhttps://github.com/usnistgov/SpectrumBrowser/issues/175#issuecomment-103088855.
Sorry for the delay, meeting.
Either /etc/msod/msod.conf -> /var/tmp/msod.conf
or maybe a bit more canonical for allowing user to override system-wide settings: $HOME/.msod/msod.conf -> /etc/msod/msod.conf
Up to you!
Thanks for working with me on this, and again, I know you asked for feedback before you implemented so I apologize for bringing up the issue this late.
I like using $HOME/.msod/MSODConf.json as an override. So flaskr.py will look for $HOME/.msod/MSODConf.json
If it does not find anything there, it will use
/etc/msod/MSODConf.json
Have we converged?
Thanks.
From: Douglas Anderson notifications@github.com Sent: Monday, May 18, 2015 1:02 PM To: usnistgov/SpectrumBrowser Cc: Ranganathan, Mudumbai Subject: Re: [SpectrumBrowser] Having ant install MSODConfig.json creates difficulties (#175)
Sorry for the delay, meeting.
Either /etc/msod/msod.conf -> /var/tmp/msod.conf
or maybe a bit more canonical for allowing user to override system-wide settings: $HOME/.msod/msod.conf -> /etc/msod/msod.conf
Up to you!
Reply to this email directly or view it on GitHubhttps://github.com/usnistgov/SpectrumBrowser/issues/175#issuecomment-103130958.
Looks good to me. When I see this issue close I'll re-merge master and get back at it. Thanks!
OK just pushed to master. Please check it out.
Note: to test things out you will need to clean the database, reconfigure sensors and repopulate it.
@ranganathanm,
I know you asked me for input on this, so I apologize for getting back to you about it after you implemented it.
Using ant to dynamically create/install the the MSODConfig is causing a few problems. Now you have to run the build with root privs (to write to /var/tmp), and that in turn nukes the environment, unless run with "sudo -E", so the build fails on finding GWT_HOME.
As part of my Makefile branch, I've implemented an "install" target that does exactly what we need for the MSOD config: it takes a existing conf file saved somewhere in the SpectrumBrowser dir structure, modifies it if necessary (like hard-coding the location of the repository) and then installs them into the /etc directory, which is the preferred location for system-wide config files.
I propose to revert the changes to ant build, create a "msod.conf" file with some default parameters, then use Makefile to install that into /etc/msod.conf. It can still be json.
Again, I know you asked me for comments on this before. I just picked this back up after about 2 weeks "off".
What do you think?