You are not logged in.
Hello again,
I'm not sure where to post this but since the question I have is somehow related to remastering with refractasnapshot I'll use this section.
In short, my question is whether ignoring ~/.profile is the intended behavior while running a live image of devuan (made with refractasnapshot).
In long, this is what I did:
1. Installed devuan ascii (using the livedvd and refractainstaller).
2. Created ~/bin and placed there a couple of scripts I needed so I can execute them by just typing their name. I'm able to do that since ~/bin is in my $PATH, as ~/.profile says:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
3. Logged out, logged back in. Everything works fine so far:
omnio@devuan:~$ echo $PATH
/home/omnio/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
4. Ran refractasnapshot.
5. Booted in Virtualbox the resulted image. Everything looks fine here (my scripts are in ~/bin and ~/.profile has the lines about adding ~/bin to $PATH) but for some reason it didn't happen:
omnio@devuan:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Any idea about this?
Thanks,
Omnio
Offline
Copy those lines to ~/.bashrc and they'll work. I don't know why. I should, and I'm sure I've read an explanation, but I don't remember it. It's been like that for as long as I can remember (maybe as far back as lenny or etch.)
Offline
From the man page for bash:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands
from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that
order, and reads and executes commands from the first one that exists and is readable.
So if there is a .bashrc on the system .profile will be ignored (unless I've misread that).
Chris
Offline
I've misread that
^ This.
~/.profile is only ignored if ~/.bash_profile (or ~/.bash_login) is present.
Last edited by Head_on_a_Stick (2019-10-14 19:55:06)
Brianna Ghey — Rest In Power
Offline
Thank you very much, guys. In the end I chose another way of doing things - I placed all my stuff in /opt (mainly scripts and artwork) and symlink it from there to /usr/local/bin or wherever necessary. This may seem odd but it has this big advantage that pretty much everything I did to "alter" the system can be found in one place (/opt).
A while ago I thought it was a good way to go to create deb packages (with fpm it's fast and easy) but that would mean to re-create and re-install those packages every time I make a minor change so I gave up on that
Best wishes,
Omnio
Last edited by omnio (2019-10-17 08:13:32)
Offline