NSA325 Problem with permanent PATH in PROFILE
hanschuetz
Posts: 7 Freshman Member
Hello everyone,
I want to extend my Profile with a new path.
I edited the profile (located at „/etc/“) with the vi-editor and saved it.
After a reboot all changes are missing.
What am I doing wrong?
Ist the profile in the right location?
I hope someone could help me.
Horst
#NAS_Dec_2018
0
All Replies
-
The problem is that /etc/ is on a ramdrive, and so your changes are lost on reboot.The easiest way around is to install the RandomTools package, which will inject code in /etc/profile to include the scripts in /i-data/sysvol/.PKG/RandomTools/etc/profile.d/
1 -
Hello Mijzelf,
sorry for the delayed response. I was on holiday.
First: I made a mistake. I have a NSA325 and not a NSA325 V2.
I have a description for the download and installation of the RandomTools you talked about.
http://zyxel.nas-central.org/wiki/3rd_party_zypkgs#RandomTools
I downloaded and installed the MetaRepository_20160513_arm_013.zpkg, but the
file is not shown in the list.
What am I doing wrong?
Horst
0 -
How did you install MetaRepository?
0 -
Hello Mijzelf,
I downloaded the file
MetaRepository_20160513_arm_013.zpkg
and
RandomTools_20170220_arm_012.zpkg
with Windows10.
Then I copied the files to NSA325 admin to directory "zy-pkgs"
After this, I pressed the button "Retrieve List from Internet", but the files are not listed.
0 -
0
-
Hello Mijzelf,
many thanks. With this installation instructions I could solve the problem.
I think, the problem was the file extention "txt" on the file web_prefix.
The RandomTool is now installed.
How can I get the path extention into the correct file (file name?) and where should the file be stored?
0 -
As you can see /etc/profile contains now the snippet
for file in $( ls /i-data/sysvol/.PKG/RandomTools/etc/profile.d/ )<br> do<br> full=/i-data/sysvol/.PKG/RandomTools/etc/profile.d/$file<br> [ -x $full ] && . $full<br> done<br>
So any executable file in /i-data/sysvol/.PKG/RandomTools/etc/profile.d/ will be sourced.Create a file containing<div>export PATH=<your-path>:${PATH}</div><div></div>
Make it executable, and you're done.
0 -
Hello Mijzelf,
many thanks.
In my NSA325 the directory "profile.d" is under
"/i-data/c25b59b4/.system/zy-pkgs/etc/"
I hope, this is correct.
Now I see the path extenion with "echo $PATH", but
under "info.php" Environment Path is not displayed.
Why?
0 -
I hope, this is correct.
Yes it is. The path I gave is for firmware 5 models (NAS5xx, NAS326). A more generic path for a firmware 4 model is /i-data/md0/.system/zy-pkgs/etc/profile.d/, or /usr/local/zy-pkgs/etc/profile.d/, which points to the same directory. That c25b59b4 is unique for your box (and is the first 4 bytes of the GUID of the raid array.)
Now I see the path extenion with "echo $PATH", but
under "info.php" Environment Path is not displayed.
Why?I guess you are looking at info.php in a webbrowser, and not on on a command line? In that case you are actually looking at the PATH variable of the php binary which is started by the webserver. In Linux a process inherits it's environment from it's parent, and apache doesn't have the right PATH./etc/profile is only invoked by the shell. And actually, the injection of the profile.d/ directory is guarded by<div>if [ -t 1 ] ; then<br></div><div></div>
That checks if stdout is a real pipe, and so if it's running in a 'real shell'. So only interactive shells get the new PATH. If any shell would get it, it could break the firmware.
1
Categories
- All Categories
- 415 Beta Program
- 2.4K Nebula
- 151 Nebula Ideas
- 98 Nebula Status and Incidents
- 5.7K Security
- 277 USG FLEX H Series
- 277 Security Ideas
- 1.4K Switch
- 74 Switch Ideas
- 1.1K Wireless
- 42 Wireless Ideas
- 6.4K Consumer Product
- 250 Service & License
- 395 News and Release
- 85 Security Advisories
- 29 Education Center
- 10 [Campaign] Zyxel Network Detective
- 3.6K FAQ
- 34 Documents
- 34 Nebula Monthly Express
- 85 About Community
- 75 Security Highlight