Page 2 of 2

Re: How/where to set global environment variables?

Posted: Thu Sep 14, 2017 3:20 pm
by Jes
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

Re: How/where to set global environment variables?

Posted: Fri Sep 15, 2017 9:48 am
by WytWun
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.

Re: How/where to set global environment variables?

Posted: Fri Sep 15, 2017 4:57 pm
by NeverSimple
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'...

Re: How/where to set global environment variables?

Posted: Fri Sep 15, 2017 7:49 pm
by ASX
[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.

Re: How/where to set global environment variables?

Posted: Sat Sep 16, 2017 5:53 am
by NeverSimple
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... :?

Re: How/where to set global environment variables?

Posted: Sat Sep 16, 2017 6:07 am
by ASX
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 ...

Re: How/where to set global environment variables?

Posted: Sat Sep 16, 2017 7:17 am
by NeverSimple
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

Re: How/where to set global environment variables?

Posted: Sun Sep 17, 2017 3:33 am
by WytWun
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...