Results 1 to 2 of 2
Basically, add them to ~/.bashrc, and they take effect whenever you login as that user. To make systemwide changes, do the same thing, but to the /etc/profile file. So does ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-07-2009 #1
- Join Date
- Aug 2009
- Midwestern US
does /etc/bashrc get executedBasically, add them to ~/.bashrc, and they take effect whenever you login as that user.
To make systemwide changes, do the same thing, but to the /etc/profile file.
So does /etc/bashrc get executed if a system reboots and no one has logged in yet? i.e. if one has a web server on a VPS that may get rebooted from time to time, is it then the /etc/profile that one set required environment variables from?
- 08-08-2009 #2
/etc/bashrc and ~/.bashrc are configuration files for Bash. They will be sourced by a particular user whenever that user creates a new bash session.
In your example of a webserver, assuming the server is run automatically, or by a user who has no shell, the bashrc is the wrong place to set such variables. To set environment variables for the webserver, you would either need to go through the web server's configuration files, or write a shell script that sets up the environment and then executes the web server.