Re: Set environment variable for non-interactive shell

2020-11-06 Thread Stuart Henderson
On 2020-11-06, Kirill Peskov wrote: > This is a cryptographically signed message in MIME format. > > --ms02050204090901080203 > Content-Transfer-Encoding: 7bit > Content-Type: text/plain; charset=utf-8 > > Unfortunately manpage for login.conf does not give any example, only > brief

Re: Set environment variable for non-interactive shell

2020-11-06 Thread Allan Streib
Kirill Peskov writes: > I'm currently trying to figure out, how to set global environment > variable, valid for multiple users including root, so Ansible will be > able to accept it as "fact" for both root and non-root users. I've > already tried to play with .cshrc files and /etc/rc.local, nothi

Re: Set environment variable for non-interactive shell

2020-11-06 Thread Otto Moerbeek
On Fri, Nov 06, 2020 at 07:38:35PM +0100, Kirill Peskov wrote: > Unfortunately manpage for login.conf does not give any example, only > brief description: > > setenv envlist A list of environment > variables and associated >

Re: Set environment variable for non-interactive shell

2020-11-06 Thread Kirill Peskov
Unfortunately manpage for login.conf does not give any example, only brief description: setenv envlist A list of environment variables and associated values to be set for the

Re: Set environment variable for non-interactive shell

2020-11-06 Thread Kirill Peskov
Unfortunately neither /etc/profile nor ~/.profile won't be parsed if shell is non-interactive. Simplest example will be: if the content of /etc/profile is: MY_ENV=DEV export MY_ENV Then if I login to the host like this: ssh username@myopenbsdhost.local myopenbsdhost$ env _=/usr/bin/env LOGNAM

Re: Set environment variable for non-interactive shell

2020-11-06 Thread Todd C . Miller
Typically, this kind of thing is done in /etc/login.conf. - todd

Re: Set environment variable for non-interactive shell

2020-11-06 Thread Dante Catalfamo
Hey Kirill, The default shell in OpenBSD is usually ksh unless otherwise specified. You should check out the ksh(1) man page. You should be able to achieve what you want by setting the variable in /etc/profile. Hope that helps. Dante On 2020-11-06 6:23 a.m., Kirill Peskov wrote: Hi All,

Re: Set environment variable for non-interactive shell

2020-11-06 Thread Janne Johansson
Check init files in /etc, and not only those for csh, since that is not default for all users. The manpage for the shell would be a good place to learn which global configuration files are run. Den fre 6 nov. 2020 kl 12:27 skrev Kirill Peskov : > Hi All, > > I'm currently trying to figure out, h

Set environment variable for non-interactive shell

2020-11-06 Thread Kirill Peskov
Hi All, I'm currently trying to figure out, how to set global environment variable, valid for multiple users including root, so Ansible will be able to accept it as "fact" for both root and non-root users. I've already tried to play with .cshrc files and /etc/rc.local, nothing worked so far, looks