July 31, 201015 yr I want to update the PATH environmental variable to include /boot/scripts and have it there upon each reboot. I tried updating the /etc/profile but that didn't seem to stick between reboots. I tried the following in go but that didn't work either: export PATH=${PATH}:/boot/scripts
July 31, 201015 yr Update your go script to update your /etc/profile script at every boot. it would be something like. echo 'PATH=$PATH:/boot/scripts ; export PATH' >> /etc/profile Note the use of single quotes in there. You do not want path getting interpreted in the go script. Note where the colon and semi colon are too. It could be split into two lines if you choose.
July 31, 201015 yr Author did some more digging and found the answer. put in the go script echo 'export PATH=${PATH}:/boot/scripts' > /root/.profile Note: be sure to use single quote, not double quote otherwise you get different results
July 31, 201015 yr did some more digging and found the answer. put in the go script echo 'export PATH=${PATH}:/boot/scripts' > /root/.profile Note: be sure to use single quote, not double quote otherwise you get different results You are overwriting /root/.profile rather then appending >> also updating /etc/profile the same way works for all users.
July 31, 201015 yr Author Thanks WeeboTech. Might do your way if I decide I want the changed PATH for all users, else I might just leave it for /root/.profile So from my experiments, I assume that /etc/profile gets "rebuilt/recreated" at each reboot from the biz* processes ? Will take a little getting used to. Know a little Unix (AIX) and Shell (ksh) Scripting, guess I'll be learning more as I go along regarding linux, bash, and unRAID specifics
July 31, 201015 yr Author You are overwriting /root/.profile rather then appending >> also updating /etc/profile the same way works for all users. Yes, but since /root/.profile didn't exist prior, not overlaying anything. Guess I need to see if /root/.profile is recreated each time on reboot or is persistent. My guess is like /etc/profile it is recreated. In which case there wouldn't be a difference I guess between > and >> for /root/.profile. Would be a HUGE difference for /etc/profile If /root/.profile was persistent between reboots, you'd end up with many many (1 for each reboot) duplicate lines for the added PATH statement
July 31, 201015 yr The root filesystem is loaded from bzroot into ram on ever reboot. I only mentioned the write to vs append in the event a future version of unRAID puts something in that profile (alias or some other setting).
July 31, 201015 yr Author The root filesystem is loaded from bzroot into ram on ever reboot. I only mentioned the write to vs append in the event a future version of unRAID puts something in that profile (alias or some other setting). Excellent point!! I'll modify it to append ( >> ) instead of overwrite ( > )
Archived
This topic is now archived and is closed to further replies.