Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
config:env [2018/02/28 16:48] – [bash/sh] Mention /etc/profile and sudo -E digital man | config:env [2020/03/21 15:06] – [SBBSEXEC] more details digital man |
---|
===== SBBSEXEC ===== | ===== SBBSEXEC ===== |
| |
The ''SBBSEXEC'' environment variable //may// be set to the path of your Synchronet ''[[dir:exec]]'' directory. This may be needed for some development situations. | The ''SBBSEXEC'' environment variable //may// be set to the path of your Synchronet ''[[dir:exec]]'' directory. This may be needed for some development situations (e.g. where your Synchornet ''exec'' directory is not ''../exec'' relative to your Synchronet ''[[dir:ctrl]]'' directory). Most sysops will not need to set this environment variable. |
| |
===== SBBSNODE ===== | ===== SBBSNODE ===== |
| |
SBBSCTRL=/sbbs/ctrl && export SBBSCTRL | SBBSCTRL=/sbbs/ctrl && export SBBSCTRL |
(replace ''/sbbs/ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) | (replace ''/sbbs/ctrl'' with the full path to your Synchronet ''[[dir:ctrl]]'' directory) |
| |
=== /etc/profile === | === /etc/profile === |
In Debian and Debian-based Linux distributions (e.g. Ubuntu), you can also set environment variables in your ''/etc/profile'' file, like so: | In Debian and Debian-based Linux distributions (e.g. Ubuntu), you can also set environment variables in your ''/etc/profile'' file (and/or ''~/.profile''), like so: |
| |
export SBBSCTRL=/sbbs/ctrl | export SBBSCTRL=/sbbs/ctrl |
| |
| === env === |
| You may also use the ''env'' utility to set an environment variable for a specific program invocation: |
| |
| env SBBSCTRL=/sbbs/ctrl /sbbs/exec/sbbs |
| |
| Note: You can use the same syntax **without** the ''env'' part. The environment variable(s) specified will only be set for the life of the process being invoked. |
| |
=== sudo === | === sudo === |
When using the ''sudo'' command to execute a Synchronet program with elevated (e.g. root) privileges, you may need to pass the ''-E'' option to preserve the environment variables set the parent shell: | When using the ''sudo'' command to execute a Synchronet program with elevated (e.g. root) privileges, you may need to pass the ''-E'' option to preserve the environment variables set in the parent shell: |
| |
sudo -E sbbs | sudo -E sbbs |
| |
| === Testing === |
| |
| You can use either of the following command-lines to test if a particular environment variable is set correctly (the environment variable's current value should be printed in response to either): |
| |
| * ''echo $SBBSCTRL'' |
| * ''printenv SBBSCTRL'' |
| |
| |
| |
==== csh/tcsh ==== | ==== csh/tcsh ==== |