LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Change path in rc.sysinit (https://www.linuxquestions.org/questions/linux-general-1/change-path-in-rc-sysinit-4175586066/)

dfatlq 08-02-2016 02:13 AM

Change path in rc.sysinit
 
Hello,

I have a rc.sysinit that runs at startup and first line outside of #!/bin/sh is to set the PATH=xxxx:xxxx

Later on in the same script (after sourcing two others) there is an if statement that checks if a directory exists, if so, it does (indented) PATH=$PATH:/additional/path

However once booted, the /additional/path is not there? Any ideas on what's going wrong?

Thanks!!

wpeckham 08-02-2016 05:42 AM

I think you misunderstand what the rc files are for. These files (when they work as intended) start processes, services, set system, and exit. Changes to the environment in these will last exactly as long as the script runs and no longer.
You are, I believe, looking for /etc/profile (or a file in /etc/profile.d) or /etc/bashrc if your system is bash centric, to set the environment for users at logon. Changes to the environment in these (done right) will be visible every time you log into the system and for all users.

dfatlq 08-02-2016 02:49 PM

Quote:

Originally Posted by wpeckham (Post 5584580)
You are, I believe, looking for /etc/profile (or a file in /etc/profile.d) or /etc/bashrc if your system is bash centric,

Yep, there it is. Thanks.


All times are GMT -5. The time now is 04:44 PM.