I try to run eggdrop in a chroot environment with a restricted user account without a shell, therefore I can't execute a shell script to change the current directory.
I try to change all relative paths to absolute paths, f.e.
modules/
to
/usr/local/eggdrop/modules/
which seems to work, but I can't find any variable for the language directory and eggdrop nag about missing language files.
Is there a chance to change the language files directory? Or perhaps I can change the current directory with a tcl statement at the begining of the conf file?
thx,
hotrs
Last edited by hotrs on Thu Apr 05, 2007 3:10 am, edited 1 time in total.
In a chroot environment, your chrooted dir is / so your absolute path should be /modules/ and so on. Another possibility would be ~/modules/ (~ is shorthand for /your/home/dir/ )
Edit: I might've misunderstood the question, after thinking about it for a minute, you should be able to resolve the problem with symlinks (ln -s /path/to/languagefiles/ /chrooted/dir/language)
As I recall, the only way of relocating language-files is either to edit the source (LANGDIR macro in src/eggdrop.h), or use the environment variable EGG_LANGDIR
nml375 wrote:As I recall, the only way of relocating language-files is either to edit the source (LANGDIR macro in src/eggdrop.h), or use the environment variable EGG_LANGDIR
Thx for your answer. I allready have done a search BEFORE I post my question - but perhaps I missed the right key words.
I don't want to change the directory structure (f.e. creating links direct unter /chroot/dir/) and I can't execute a shell script.
Is it right that there is no chance for me to use EGG_LANGDIR because of the restricted user account without a home directory and without a shell, too?
Seems to me the only solution is to fix the source or write a little tool which change the current directory and starts eggdrop.
Well, you could access the environment variables from within tcl using the special tcl array-variable "env": ie. setting env(EGG_LANGDIR) to a new value. I'm not sure however if eggdrop has'nt already tried to load languagefiles when the main config-file is read.
There are a few other tricks that could be tried aswell, depending on how you start your eggie...
Sure, you could always use the "cd" command to change current directory.
I'm not too familiar with chrootuid. I don't suppose your eggdrop inherits the environment from where chrootuid were run?
Ie. doing something like this:
Both solutions work. I can start chrootuid with a manipulated EGG_LANGDIR environment and I can put a "cd /usr/local/eggdrop" at the beginning of eggdrop.conf.
The first solution could be a problem for other scripts if they use relative paths without a way to set them - I have to test chanstats and moxxquiz. The second one has the problem that the first messages from eggdrop a shorten to "MSG XYZ", but that doesn't bother me mutch.
If I found some time at the weekend I will write the little start tool.
DragnLord wrote:you could also edit src/eggdrop.h before compile:
Yes, this was allready mentioned by nml375, but I want to avoid changing the source. And it doesn't solve the problems with other scripts using relative paths.