I want to set the some variable in nova-api.
Which is the best way to set that? (in nova.conf or in other file?)
I can set in /etc/nova/nova.conf and get the value of that variable in the api. But is there any other way to set environment variable for the API? I want to access by os.environ in the script. (Is this the right way to access or not?)
As per my knowledge, for the wsgi we have to set in the apache's config file. But for nova I cant find the file :(.
Thanks in advance for the help.
Set the env variable from the init.d script. In the scrip /etc/init.d/openstack-nova-api one file is used /etc/sysconfig/$prog so we set the export variable in this file and got the reference later.
Related
I'm trying to create files and directories and executing a script with a specific user instead of root user. How can I do that? I don't want to switch users from root user to another user; instead, I always want it to use a specific user, for example, wasadmin user.
Whenever I'm creating a new file or executing a script, this should be run as wasadmin user. Can you please help me with this?
It depends on how you create the file. As far as I know, it's not possible to do this when you use touch or echo, but depending on the way you create the file, there might be a possibility to add a user parameter.
In case this is not possible, you might use the chown command (change ownership), this command gives the possibility to modify the owner/group of an already created file (which obviously means that you can only do this after the file has already been created). I've been looking for an official chown reference, but I think that launching the command man chown can answer all questions you might have on this command.
Good afternoon!
I'm a system administrator at a university, and I am responsible for setting up the images for a computer lab. R is part of the default image, and for the longest time we only had a single log-in for all lab users, allowing us to set the default directory once and then image it across multiple systems. This has changed, and we're now having all users log on with a personalized log-in. That brings me to a problem I'm having with R, and why I'm turning to you.
You see, as most of you may be aware, when R is run for the first time, a dialog box opens up that prompts for a location to save packages and the like. Hit 'OK' and it's the user file, but hit anything else and it's wherever you put it. The problem is, we've locked down the systems rather tightly, and access to anything more than the user's individual directory is not something we like to do.
The question I have is this - is there a way to force R, on first run, via hands-free script or just a setting somewhere, to default to the user's directory on the system for package storage? This would prevent me from having to give All Users access to read and write to the R directory, and would have fewer possibilities of screwing up since they wouldn't actually have a choice to change it. If I have to continue giving permissions in that folder, I can, but I'd rather not.
Thanks!
Edit your .Renviron file to set the default path:
# .Renviron file
R_LIBS = '~/.R/library'
I can't test this right now, but I believe you could add something like Sys.setenv(R_LIBS_USER=path.expand('~\R\library')) to the Rprofile.site file found in the R etc directory.
'...to default to the user's directory on the system for package storage...'
another way, especially if you wanted different setting for staff/students would be to to use group policy to set an environment variable for selected machines/users at login.
e.g. the equivalent of...
SETX "R_LIBS" "\\fileserver2/department_shared/public/r/packages"
you can easily check if this has worked by starting R and trying
Sys.getenv("R_LIBS")
also, this command can then show you what packages are installed:
rownames(installed.packages())
When using exist-db, a GET message will obtain an entire file from a collection (by providing the URI). In the case of a .xq file, however, the same GET message will instead execute the file.
I am wondering if there is anything I can attach to a GET message to cause exist-db to return the file rather than execute it. I should have all the necessary permissions, or I should be able to set them.
Thank you.
Assuming you are running eXist as a stand-alone server:
"GET accepts the following request parameters, which must be URL-encoded" _source=yes | no - which "Specifies whether the query should display its source code instead of being executed" - see the developers guide online for full details & example usage.
eXist sets this capability to 'no' as default in it's config - however you can override this permanently by adding specific files to the <allow-source></allow-source> section in the Web-application Descriptor file (descriptor.xml) read from WEB-INF directory of the web application or from the directory specified by the exist.home system property.
Hope that helps.
I am using log4c library with xml configuration log4crc and I need to figure out how to turn off/on logging.
I could not find any document explaining the parameters in log4crc configuration file,
try seeting the log priority to "notset"
If that doesn't work then make sure the system can't find your log configuration file and unset the environment variables LOG4C_APPENDER and LOG4C_PRIORITY
You could not turn off through set_priority() as log4c enum does not have support for OFF, where as avail in logj
i, by mistake, nuked my centos path settings by adding a wrong path. i added the following :
PATH=/usr/local/jdk1.6.0/bin
export PATH
to /etc/profile/bashrc and now all the commands are gone.
could someone please help me restore my system.
thanks in advance.
One way of setting your path without breaking it is:
export PATH=/usr/local/jdk1.6.0/bin:$PATH
A short explanation. When you want to add something new to your path, you should keep the old path settings. What you did was to set the path to point only to /usr/local/jdk1.6.0/bin. That's why all the other commands except from the ones found in /usr/local/jdk1.6.0/bin are "gone". Nothing is really "gone". You just need to reset your path. Just open a new shell/terminal instance or simply logout/login and set your path using a more proper way.
export PATH=$PATH:$HOME/bin:/sbin:/usr/bin:/usr/sbin