View previous topic :: View next topic |
Author |
Message |
wrc1944 Advocate
Joined: 15 Aug 2002 Posts: 3435 Location: Gainesville, Florida
|
Posted: Mon Mar 15, 2004 7:13 am Post subject: A few Basic env-update questions |
|
|
I'm very comfortable with etc-update, but I've read and reread the Environment Variables doc several times, searched the forums and FAQs, and can't seem to find specific answers to the following questions. I would greatly appreciate it if a Gentoo expert would please give me some clarification on these.
1. Specifically, when should env-update be run? Are there times it's absolutely essential to do so before proceeding on with anything else?
2. What are the consequences of NOT doing so, at the times it should be done?
3. Can running env-update at the wrong time result in disaster, or is it perfectly safe to run at any time, even if not needed, or by mistake?
4. If you do run it, and it causes a problem, what is the correct procedure for figuring out how to repair things?
Thanks,
wrc1944 _________________ Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.4 USE=experimental python3_11 |
|
Back to top |
|
|
adaptr Watchman
Joined: 06 Oct 2002 Posts: 6730 Location: Rotterdam, Netherlands
|
Posted: Mon Mar 15, 2004 9:11 am Post subject: Re: A few Basic env-update questions |
|
|
wrc1944 wrote: | I'm very comfortable with etc-update, but I've read and reread the Environment Variables doc several times, searched the forums and FAQs, and can't seem to find specific answers to the following questions. I would greatly appreciate it if a Gentoo expert would please give me some clarification on these. |
No expert, but I'll gladly give it a try.
wrc1944 wrote: | 1. Specifically, when should env-update be run? Are there times it's absolutely essential to do so before proceeding on with anything else? |
When the Handbook says to.
Specifically, when you've updated or added system libraries that change variable assigments or (the most common cause) the PATH variable.
Best-known example would be after you entered the chroot - you have to run it to set the correct variables for the new environment.
Also needed whenever you would manually run ldconfig on another distro.
wrc1944 wrote: | 2. What are the consequences of NOT doing so, at the times it should be done? |
Non-functioning of your new programs/libraries.
B0rkage is unlikely - unless you proceed to install stuff which depends on this being set correctly.
wrc1944 wrote: | 3. Can running env-update at the wrong time result in disaster, or is it perfectly safe to run at any time, even if not needed, or by mistake? |
No, running env-update at any time should not cause problems.
One exception could be if you are running or trying out something that needs a non-standard environment.
When you run env-update the variables will be re-set to what they would be upon the next reboot.
wrc1944 wrote: | 4. If you do run it, and it causes a problem, what is the correct procedure for figuring out how to repair things?
|
As I said, running it should never cause problems, but if you think it has just reboot. _________________ >>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen |
|
Back to top |
|
|
wrc1944 Advocate
Joined: 15 Aug 2002 Posts: 3435 Location: Gainesville, Florida
|
Posted: Mon Mar 15, 2004 5:52 pm Post subject: |
|
|
adaptr,
Many thanks for the info- your comments certainly help clarify env-update for me.
Am I to understand that every time one reboots, env-update is automatically run, or set? If so, that would explain why I never have any problems, as I reboot every day. Is this assumption correct?
wrc1944 _________________ Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.4 USE=experimental python3_11 |
|
Back to top |
|
|
psyqil Advocate
Joined: 26 May 2003 Posts: 2767
|
|
Back to top |
|
|
slonocode Apprentice
Joined: 03 Jun 2002 Posts: 273
|
Posted: Mon Mar 15, 2004 8:06 pm Post subject: |
|
|
The OP said he read that doc. |
|
Back to top |
|
|
psyqil Advocate
Joined: 26 May 2003 Posts: 2767
|
Posted: Mon Mar 15, 2004 8:17 pm Post subject: |
|
|
Oops, you're right But it's all in there... |
|
Back to top |
|
|
wrc1944 Advocate
Joined: 15 Aug 2002 Posts: 3435 Location: Gainesville, Florida
|
Posted: Tue Mar 16, 2004 7:44 am Post subject: |
|
|
psyqil,
I reread the page you referred me to, and I still can't find where it specifically says env-update is run when you reboot.
Do you mean code listing 6 , where it says:
Code Listing 6: Extending PATH for local usage in ~/.bashrc
PATH="${PATH}:/home/my_user/bin"
When you relogin, your PATH variable will be updated.
Doesn't this only refer to "Extending PATH for local usage in ~/.bashrc"?
If so, I don't have that line in my .bashrc, and I still don't know the definitive answer to the question of whether or not env-update is automatically run when you reboot (not just login to a different user or different WM).
The statement at the end of Code listing 6
"As long as you don't log out, the PATH variable will be using the temporary settings."
seems to imply it would update on a reboot, but if it does, why doesn't it just clearly say so, and not leave one wondering?
wrc1944 _________________ Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.4 USE=experimental python3_11 |
|
Back to top |
|
|
Sven Vermeulen Retired Dev
Joined: 29 Aug 2002 Posts: 1345 Location: Mechelen, Belgium
|
Posted: Tue Mar 16, 2004 8:10 am Post subject: Re: A few Basic env-update questions |
|
|
wrc1944 wrote: |
1. Specifically, when should env-update be run? Are there times it's absolutely essential to do so before proceeding on with anything else?
|
You should run env-update when you have altered files in /etc/env.d, either yourself. env-update reads the contents of that directory and creates the necessary items in /etc/profile.d which is automatically sourced when a user logs in.
If you don't alter files in that directory, you shouldn't run env-update at all as emerges that require you to run env-update do it themselves (for instance xfree's ebuild has "env-update" in the postinstall section).
wrc1944 wrote: |
2. What are the consequences of NOT doing so, at the times it should be done?
|
The changes you made to /etc/env.d won't be visible unless you run env-update and relogin (or run source /etc/profile).
wrc1944 wrote: |
3. Can running env-update at the wrong time result in disaster, or is it perfectly safe to run at any time, even if not needed, or by mistake?
|
You can run it as frequent as you want without problems. If /etc/env.d isn't altered, the outcome of env-update is always the same and therefore fully reproduceable and thus safe to use.
wrc1944 wrote: |
4. If you do run it, and it causes a problem, what is the correct procedure for figuring out how to repair things?
|
Undo the changes you made to /etc/env.d and rerun env-update. If env-update itself fails to work, run "ldconfig" first and try again (we had such an issue some time ago). If this doesn't help, search on https://bugs.gentoo.org for a bugreport and if none exist, file one. |
|
Back to top |
|
|
wrc1944 Advocate
Joined: 15 Aug 2002 Posts: 3435 Location: Gainesville, Florida
|
Posted: Tue Mar 16, 2004 6:49 pm Post subject: |
|
|
Thanks to all for the very informative responses!
I think I'm almost there as to understanding this subject. I'm still not clear on one point, which I'll ask in this way. Is the following statement true or false?
"When you reboot the computer, env-update is run automatically, if needed."
If true, then no further explanation is necessary.
BTW, I have the lines:
source /etc/profile
xhost +localhost
at the bottom of my /home/wrc/.bashrc file, if that's relevant.
wrc1944 _________________ Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.4 USE=experimental python3_11 |
|
Back to top |
|
|
[::Shansa::] n00b
Joined: 16 Mar 2004 Posts: 37
|
Posted: Tue Mar 16, 2004 8:34 pm Post subject: |
|
|
You sound like an overly anxious kind of guy... relax |
|
Back to top |
|
|
adaptr Watchman
Joined: 06 Oct 2002 Posts: 6730 Location: Rotterdam, Netherlands
|
Posted: Tue Mar 16, 2004 9:35 pm Post subject: |
|
|
wrc1944 wrote: |
"When you reboot the computer, env-update is run automatically, if needed."
|
It's a strange question.
When you reboot, yes, all environment variables will be re-initialised, and any changes to the environment will automatically be incorporated.
Two buts.
One: that is not all env-update does - it also runs ldconfig IIRC.
And two: no, it doesn't - that's not the point.
The point is that when installing or updating gentoo one may run env-update to get his running environment up-to-date - hence the command "env-update".
None of this has any bearing on rebooting or whatever.
You seem to need a few more reads to "get your head 'round this concept"
You're trying to lump 3 or 4 different system functions under one command, when in reality they're all separate.
Code: | man env-update
man ldconfig |
and the excellent from-powerup-to-bash-prompt may help, too... _________________ >>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|