Friday, March 6, 2015

linux - bash automatically executing a tool-specific configuration file on login


My project uses an internal tool on Linux, that uses a file called .spacerc for configuring some environmental variables.


The strange thing is, whenever I start a (non-login interactive) bash shell - whether via PuTTy, or via executing $SHELL, or via a python script executing pty.spawn($SHELL) - it reads in .spacerc and sets the environmental variables as specified in it. (And yes, $SHELL is /bin/bash.)


It appears that .spacerc is read before .bashrc is executed (at least the one in the local user directory).


I can't find any info on line that indicates why bash would automatically read in an arbitrary file called .spacerc.


Why might this be happening?


Thanks!


Answer



Mystery solved:
The tool owner added a script to /etc/profile.d directory (which is executed on every shell start), that reads in the tool-specific configuration file.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...