How/where to set global environment variables?

Need support for GhostBSD. Ask here if your question does not fit elsewhere.

Re: How/where to set global environment variables?

Postby Jes » Thu Sep 14, 2017 2:20 pm

I prefer to fill ~/.profile or ~/.bashrc to place my env variables and settings (alias for example). In this way I don't need ~/.login_conf.

The only system in which I configure /etc/login.conf for specific settings like no coredumps, memory, etc. is in OpenBSD.

BR,

Jes
Jes
 
Posts: 38
Joined: Sun Dec 25, 2016 2:43 pm
Location: Spain
Has thanked: 13 times
Been thanked: 11 times

Re: How/where to set global environment variables?


Re: How/where to set global environment variables?

Postby WytWun » Fri Sep 15, 2017 8:48 am

I know about cap_mkdb and that was the first thing I checked when the /etc/login.conf didn't work for a desktop session.

I have since double checked SSH sessions and both the /etc/login.conf and /etc/profile approaches work as expected for these.

So it seems to me that the graphical desktop login process doesn't support either approach :-(. If it supported /etc/login.conf, the BLOCKSIZE environment variable would be set in a normal user xterm session on a default GhostBSD installation (as that variable is in the default login.conf) but it isn't. That variable is commented out of all the default dot files AFAICS.
WytWun
 
Posts: 13
Joined: Sat Aug 12, 2017 7:54 am
Has thanked: 0 time
Been thanked: 2 times

Re: How/where to set global environment variables?

Postby NeverSimple » Fri Sep 15, 2017 3:57 pm

ASX wrote:I'm starting to think you have come across that FreeBSD cap_mkdb(1) obscenity:


8-) Mhh, I used this when i tried this a few posts back (but forgot to mention it) and it did work for me. Not sure if the OP ommited this fine 'post processing utility'...
NeverSimple
 
Posts: 30
Joined: Sun Aug 20, 2017 9:08 am
Has thanked: 4 times
Been thanked: 1 time

Re: How/where to set global environment variables?

Postby ASX » Fri Sep 15, 2017 6:49 pm

[quote="NeverSimple" Not sure if the OP ommited this fine 'post processing utility'...[/quote]

LoL :D :lol: Hope that imply some irony ! Anyway, yes he wrote he used that fine utility.
ASX
 
Posts: 988
Joined: Wed May 06, 2015 11:46 am
Has thanked: 58 times
Been thanked: 132 times

Re: How/where to set global environment variables?

Postby NeverSimple » Sat Sep 16, 2017 4:53 am

ASX wrote:LoL :D :lol: Hope that imply some irony ! Anyway, yes he wrote he used that fine utility.


Irony? No, not at all.... ;) :P

I now see that the OP has responded that he used that utility, but his post wasn't there when I posted, although it now looks that way. Weird?

Still kinda,sorta (...) works for me though. If I place the environment variables in /etc/profile, they are available in a fish shell under Xfce, where the variables placed in /etc/login.conf are not.
When I SSH into the box, the situation is the other way around: There I see the varaiables defined in /etc/login.conf, and not the ones I defined in /etc/profile.

Two things:
- There is something different between the OP's situation and mine,
- This gives me a headache... :?
NeverSimple
 
Posts: 30
Joined: Sun Aug 20, 2017 9:08 am
Has thanked: 4 times
Been thanked: 1 time

Re: How/where to set global environment variables?

Postby ASX » Sat Sep 16, 2017 5:07 am

NeverSimple wrote:Still kinda,sorta (...) works for me though. If I place the environment variables in /etc/profile, they are available in a fish shell under Xfce, where the variables placed in /etc/login.conf are not.
When I SSH into the box, the situation is the other way around: There I see the varaiables defined in /etc/login.conf, and not the ones I defined in /etc/profile.

Two things:
- There is something different between the OP's situation and mine,
- This gives me a headache... :?


How do you start Xfce ? May be the difference is in using slim or not ...
ASX
 
Posts: 988
Joined: Wed May 06, 2015 11:46 am
Has thanked: 58 times
Been thanked: 132 times

Re: How/where to set global environment variables?

Postby NeverSimple » Sat Sep 16, 2017 6:17 am

ASX wrote:How do you start Xfce ? May be the difference is in using slim or not ...


Standard GhostBSD Xfce installation, so I'm using Slim
NeverSimple
 
Posts: 30
Joined: Sun Aug 20, 2017 9:08 am
Has thanked: 4 times
Been thanked: 1 time

Re: How/where to set global environment variables?

Postby WytWun » Sun Sep 17, 2017 2:33 am

Okay, I've finally had a few hours to dig deeper - my findings:
- the FreeBSD port of Slim does grab some capabilities out of /etc/login.conf, but not the setenv capabity :( See r379608 for more details.
- I haven't been able to identify any support in LightDM (original source or FreeBSD port) for the capability database.

I have however found a workaround: changing the login command in /usr/local/etc/slim.conf to use the commented out bash invocation (with path modified) rather than the FreeBSD sh invocation seems to result in /etc/profile being read during a graphical login. Using bash works because it has a command option to force operation as a login shell; most other shells (ash seems to be an exception) don't have a command option for this.

Now I'm able to use Octopkg to install things...
WytWun
 
Posts: 13
Joined: Sat Aug 12, 2017 7:54 am
Has thanked: 0 time
Been thanked: 2 times

Previous

Return to General support

Who is online

Users browsing this forum: Smit and 2 guests