A couple months ago, I had an issue crop up to where the SBBSCTRL var and others "LD_LIBRARY_PATH I think" would not export to the system to be read by SBBS, I've set it up in /etc/profile, ~/.profile ~/.bashrc, and even in script files that will try to set the env variable and then run lets say SBBS, or SCFG. Because if I did not do this, when I would run SBBS it would state:
!SBBSCTRL not set, using default /sbbs/ctrl or something to that point.
and programs like SCFG would state /sbbs/ctrl/main.cnf missing or other errors. jsexec would not run on the cmdline, it would ask for the SBBSCTRL env.
Rob (DM) and I went back and forth a few times on email about this, and never really could figure out what was going on, then all of a sudden it started working without issue.
Here I am a couple months later, I have not touced ANY of my rc, profile, or any other . files, and it is happening again.. right out of the blue..
I don't understand this shit..
SCFG:
......................................................................... ...[.]................................................................... ... Main configuration file (/home/kk4qbn/sbbs/exec/main.cnf) missing! .. ......................................................................... ... .OK .. ......................................................................... .........................................................................
I have my SBBSCTRL env var set to /sbbs/ctrl, notice it is trying to load from the bbs users home directory.
even though I am running scfg, and all
other programs from the symlinked dir /sbbs/exec.
Maybe I should pull all the export commands out of my config files in the bbs users home dir?
attempt to run jsexec from /sbbs/exec:
kk4qbn@kk4qbn:/sbbs/exec$ ./jsexec
SBBSCTRL environment variable not set and -c option not specified.
Example: SET SBBSCTRL=/sbbs/ctrl
or: ./jsexec -c /sbbs/ctrl [module]
Returning error code: 1
kk4qbn@kk4qbn:/sbbs/exec$
I can create scripts to run lets say scfg and jsexec like shown below, and they load correctly.
#!/bin/sh
cd /sbbs/exec
SBBSCTRL=/sbbs/ctrl && export SBBSCTRL
LD_LIBRARY_PATH=/sbbs/exec && export LD_LIBRARY_PATH
./scfg
exit
BUT, when I create a script the exact same way to run SBBS, as sbbs is loading it will give the error !SBBSCTRL environment not found using /sbbs/ctrl (typing from memory).
Why does it do this?
if the script runs scfg correctly with no errors, why
not sbbs?
I don't understand this shit..I think the main point you fail to grasp there are *multiple* environments at any time on the system. Just because you have an environment variable set in one environment, does not mean it has been set in *all* environments.
You didn't specify *how* you ran scfg. If you ran it from an shell (e.g. bash), then immediate after getting that error type 'echo $SBBSCTRL' - it'll be either not set or set incorrectly.
Maybe I should pull all the export commands out of my config files inthe > bbs users home dir?
I'm not sure what config files you're referring to.
attempt to run jsexec from /sbbs/exec:
ning error code: 1kk4qbn@kk4qbn:/sbbs/exec$
So immediately after getting that error, from the same shell/environment, type 'echo $SBBSCTRL' and report back what you see.
I can create scripts to run lets say scfg and jsexec like shownbelow, and > they load correctly.
#!/bin/shcd /sbbs/exec
SBBSCTRL=/sbbs/ctrl && export SBBSCTRL
LD_LIBRARY_PATH=/sbbs/exec && export LD_LIBRARY_PATH
./scfg
exit
BUT, when I create a script the exact same way to run SBBS, as sbbsis > loading it will give the error !SBBSCTRL environment not found
Why does it do this?Because the environment variable was not set.
if the script runs scfg correctly with no errors, whyBut what, It is the EXACT same setup in the script.. I'm not saying it is an SBBS issue, obviously it is an issue on my part.. but I'm just completely lost as to what to do.. thats why this message went to all, I was hopeing someone would see what I've screwed up.
not sbbs?
Because you did something wrong.
Re: My Screwey Ass Linux Box
By: Digital Man to KK4QBN on Tue Apr 17 2018 18:50:25
I don't understand this shit..I think the main point you fail to grasp there are *multiple* environments at any time on the system. Just because you have an environment variable set in one environment, does not mean it has been set in *all* environments.
I'm beginning to realize that, I would hope that using /etc/profile would be universal.
You didn't specify *how* you ran scfg. If you ran it from an shell (e.g. bash), then immediate after getting that error type 'echo $SBBSCTRL' - it'll be either not set or set incorrectly.
I'm running it from bash as usual, I exported SBBSCTRL ~/.bashrc
Maybe I should pull all the export commands out of my config files inthe > bbs users home dir?
I'm not sure what config files you're referring to.
I was speaking of ~/.profile and ~/.bashrc
attempt to run jsexec from /sbbs/exec:
ning error code: 1kk4qbn@kk4qbn:/sbbs/exec$
So immediately after getting that error, from the same shell/environment, type 'echo $SBBSCTRL' and report back what you see.
I'm getting a blank line.
I can create scripts to run lets say scfg and jsexec like shownbelow, and > they load correctly.
#!/bin/shcd /sbbs/exec
SBBSCTRL=/sbbs/ctrl && export SBBSCTRL
LD_LIBRARY_PATH=/sbbs/exec && export LD_LIBRARY_PATH
./scfg
exit
BUT, when I create a script the exact same way to run SBBS, as sbbsis > loading it will give the error !SBBSCTRL environment not found
using /sbbs/ctrl (typing from memory).
Why does it do this?Because the environment variable was not set.
Why did the script not set it for sbbs when it did for scfg?
I'm just trying
to figure out what the crap i've done here.. I have'nt touched any main config settings in linux since it started woring.
if the script runs scfg correctly with no errors, why
not sbbs?
Because you did something wrong.But what, It is the EXACT same setup in the script.. I'm not saying it is an SBBS issue, obviously it is an issue on my part.. but I'm just completely lost as to what to do.. thats why this message went to all, I was hopeing someone would see what I've screwed up.
I don't know much about bash scripting, I've tried putting the export stament in many different places in the script, but mainly just at the end, I have also stuck it in between a if/fi (whaterver that is called) :) to make sure it gets exported. Something worked for a while then it suddenly stopped.
I would like to find a universal way to get the environment variables in the environment, but I guess, from what your saying, that is impossible.
So my "Guess" is that if it is setup *CORRECTLY* in /etc/profile and ~/.bashrc that should cover it?
I'm just lost folks and desperatly needing
help, because it's not too bad right now, because most of the scripts I've made have been keeping a lot of JS errors, etc at bay, but it bugs me that it is not runnig correctly and its more than likely a simple fix. can someone who runs bash and an debian derived system (mint) post a good snippet of the code and which files they are using to set these environment variables..
I know it's not perfect because I might be running different environments than others, for myself I run SBBS with it's output straight to a console, using bash, under X so I can also run GTK monitor, and have other items at my hands quickly..
Now I've have stupid issues with other things, but I have NEVER had an issues setting the reqiired environment variables, and I don't understand as in sbbs for example if I set and export that variable in the same script right before firing of SBBS, why is it still stating that it is not set?
KK4QBN wrote to Digital Man <=-
Why did the script not set it for sbbs when it did for scfg? I'm just trying to figure out what the crap i've done here.. I have'nt touched
any main config settings in linux since it started woring.
KK4QBN wrote to Digital Man <=-
Why did the script not set it for sbbs when it did for scfg? I'm just trying to figure out what the crap i've done here.. I have'nt touched any main config settings in linux since it started woring.
I think you might be having issues with different user contexts. I'm guessing you're starting SBBS with sudo, which means SBBS is starting as root and getting its environment from that user. Have you tried setting SBBSCTRL in root's environment?
While I've had no issues starting SBBS that way, I went to starting it as a user (using the instructions on the wiki to allow it to bind the low ports), for other reasons of ease of management.
Digital Man wrote to Tony Langdon <=-
Also, if you use 'sudo' to execute a program, you don't get a copy of
the caller's environment unless you use 'sudo -e'. I'm pretty sure
that's been pointed on here before as well.
KK4QBN wrote to Digital Man <=-
Why did the script not set it for sbbs when it did for scfg? I'm
just trying to figure out what the crap i've done here.. I have'nt
touched any main config settings in linux since it started woring.
I think you might be having issues with different user contexts. I'm
guessing you're starting SBBS with sudo, which means SBBS is starting
as root and getting its environment from that user. Have you tried
setting SBBSCTRL in root's environment?
While I've had no issues starting SBBS that way, I went to starting it
as a user (using the instructions on the wiki to allow it to bind the
low ports), for other reasons of ease of management.
Also, if you use 'sudo' to execute a program, you don't get a copy of the caller's environment unless you use 'sudo -e'. I'm pretty sure that's been pointed on here before as well.
KK4QBN wrote to Digital Man <=-
I believe Tony has nailed the issues down with this one, so I will give
it a try.
Thanks guys.. the BBS has'nt really been giving any issues (other than this which most of the time I can mygyver my way out of) but the fact
it was'nt running correctly bugged me. I might end up just giving the whole bbs tree to root, but thought it would be on the safer side to
run it in a user environment. Rob, I promise I'll try more manpages
and documentation, it seems bad habits die hard. I've always been a skimmer, and every since my first BBS and my first linux distro I have gotten by (mostly) by skimming if I read the full documentation I may actually learn JS, etc.. or at least how to get this fiasco worked
out..
anyway, Rob, Tony thanks again..
| Sysop: | Winzlo |
|---|---|
| Location: | Minnesota, USA |
| Users: | 11 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 495944:58:11 |
| Calls: | 82 |
| Files: | 1,070 |
| D/L today: |
27 files (11,920K bytes) |
| Messages: | 287,039 |