Place for user provided profile and ld.so.conf.d files

Who doesn't love third-party apps? Get together and talk about them here.
Post Reply
MrK
Posts: 127
youtube meble na wymiar Warszawa
Joined: Tue Nov 19, 2013 7:19 pm

Place for user provided profile and ld.so.conf.d files

Post by MrK »

Hi,

That's probably mostly a question for ASUSTOR:
  • If I'd like to add a global script that gets executed everytime a shell (ash) is created. /etc/profile get's restored after every restart. While I right now add what I need to that file in the startup script of the app I'd like to know if there's another path (/usr/local/etc/...) where such a file would automatically is read. I'm aware that I could do that user-based but sometimes that's not convenient.
  • Same as above : an user path for file which would normally be in /etc/ld.so.conf.d. That would be especially helpful sometimes for Optware stuff
Btw: You really got excellent products. I especially like that fact that you provide toolchain which even allow me to compile 64-bit binaries on 32-bit!

Cheers
Thomas
Storage: AS-202T | AS-604T (borrowed)
PC/Laptop: iMac 27" & rMBP 15"
Media Server/Player: Plex on ASUSTOR NAS & Samsung TV
chinbo
Posts: 24
Joined: Wed Jun 26, 2013 1:40 pm

Re: Place for user provided profile and ld.so.conf.d files

Post by chinbo »

I'm not sure how to make a script to be executed every time a shell is opened,
but I think if you put your script under /user/local (actually indicates to /volume1/.@plugins) it can be saved after a reboot.
MrK
Posts: 127
Joined: Tue Nov 19, 2013 7:19 pm

Re: Place for user provided profile and ld.so.conf.d files

Post by MrK »

chinbo wrote:I'm not sure how to make a script to be executed every time a shell is opened,
but I think if you put your script under /user/local (actually indicates to /volume1/.@plugins) it can be saved after a reboot.
The ASH shell does look for an env. variable named ENV and does run the script that is defined there. So right now I add

Code: Select all

export ENV=/opt/etc/profile
to /etc/profile. It works but I just guessed that ASUSTOR may have thought about a user-defined place for such occasions. Like they die with /user/local/init.d.
Storage: AS-202T | AS-604T (borrowed)
PC/Laptop: iMac 27" & rMBP 15"
Media Server/Player: Plex on ASUSTOR NAS & Samsung TV
chinbo
Posts: 24
Joined: Wed Jun 26, 2013 1:40 pm

Re: Place for user provided profile and ld.so.conf.d files

Post by chinbo »

Hi MrK,

think I just figured it out! :D
The idea is that when you create your script with name .profile in user home folder.
it will be executed automatically when you start a new shell.

it's easy to make .profile in the home folder of admin and the file can stay after restart
but for root, I create another script in /usr/local/etc/init.d to cp .profile from volume1 to /root/.
So everytime my NAS boots up, it will copy this .profile and will execute it everytime I login to shell.
is this what you want to achieve?
MrK
Posts: 127
Joined: Tue Nov 19, 2013 7:19 pm

Re: Place for user provided profile and ld.so.conf.d files

Post by MrK »

chinbo wrote:Hi MrK,
[...]The idea is that when you create your script with name .profile in user home folder.[...]
Thanx for your effort. Altough I would like a way to have a profile read which is not depending on a user. Otherwise you have several users and want to change something you have to edit all the .profile.

ASH seems to read three files, /etc/profile, <users home>/.profile and the ENV variable. So it seems that ENV is the only user-Independent solution.
Storage: AS-202T | AS-604T (borrowed)
PC/Laptop: iMac 27" & rMBP 15"
Media Server/Player: Plex on ASUSTOR NAS & Samsung TV
Post Reply

Return to “Developer's Corner”