LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-02-2016, 02:13 AM   #1
dfatlq
Member
 
Registered: May 2012
Posts: 49

Rep: Reputation: Disabled
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!!
 
Old 08-02-2016, 05:42 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,573

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
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.
 
Old 08-02-2016, 02:49 PM   #3
dfatlq
Member
 
Registered: May 2012
Posts: 49

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
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.
 
  


Reply

Tags
startup


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to change permissions of rc.sysinit in run level 1 Andrew Dufresne Linux - Newbie 3 04-06-2010 04:51 AM
change windows path to unix path gibsosmart Linux - Newbie 7 09-15-2009 03:35 AM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 01:05 PM
can i change the rc.sysinit file sibu_rajappan Programming 0 11-09-2004 04:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration