I'd like to set an environmental variable that could be set when the jail starts.
In the command line (csh), if i do:
In the command line (bash), it also works although with:
Fine.
But what about having it when the jail is started?
Tried to place
Also tried to call a script from /etc/rc.local, either in the
From the man page of rc.local(8), it's said:
Tried to do this.
But to no success.
So, my question. How to set a variable at the boot of a jail?
In the command line (csh), if i do:
Code:
>setenv KK "whatevercsh"
>printenv | grep KK
KK=whatevercsh
In the command line (bash), it also works although with:
Code:
# KK="whateverbash"; export KK
# printenv | grep KK
KK=whateverbash
Fine.
But what about having it when the jail is started?
Tried to place
KK="whateversh"; export KK
in /etc/rc.local as it seems that /etc/rc.local is interpreted by /bin/sh
, but KK
was never set.Also tried to call a script from /etc/rc.local, either in the
csh
or the bash
versions of it, but the variable remained not set.From the man page of rc.local(8), it's said:
if you want to use rc.local, it is still supported. In this case, it should source /etc/rc.conf and contain additional custom startup code for your system.
Tried to do this.
cat /etc/rc.local
:
Code:
. /etc/rc.conf
KK="whatever"; export KK
But to no success.
So, my question. How to set a variable at the boot of a jail?