[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

INN2: rc.news script has empty directory paths



Package: INN2
Version: 2.3.2-1

Problem: "IIND:   No active file!" when trying to start the news server.

Symptom Summary: Environment variables are not properly set. Some are
empty leading to incorrect paths.

How to reproduce: In inn.conf put a TAB after setting a variable
(usually for a subsequent comment). For example:

immediatecancel:	true			#false
				^TABs in here

News server will no longer start and returns the cryptic error message
above. From futher testing I have determined that the tab causes this
problem. The news server still starts with a comment using spaces.

I found what was causing this by doing (another) purge and install of
inn2 and checking step by step what was stopping the news server from
starting.

This is a non-obvious bug. Through my initial analysis below (before I
had diagnosed the true cause of problem) there may be slightly incorrect
processing of inn.conf by innconfval (are the tabs or # ending up in the
environment variables?).

Regards,
Adam Warner


> I've traced the error message into rc.news. The reason no active file is
> found, and nothing else works, is that the path variables such as ACTIVE
> are empty (PATHBIN etc are empty as well).
> 
> I have traced the setting of the path variables to inn.conf. pathdb is
> valid and sets the location of the active etc. files.
> 
> First /etc/init.d/inn2 is started:
> 
> #! /bin/sh
> #
> # init.d/inn2	Start/stop the news server.
> #
> 
> test -f /usr/lib/news/bin/innd || exit 0
> 
> start () {
>     su news -c /usr/lib/news/bin/rc.news
> }
> 
> 
> So all we see here is that inn2 just switches execution to rc.news
> running as user news.
> 
> So let's look at rc.news:
> 
> #! /bin/sh
> . /usr/lib/news/innshellvars
> 
> Ah, this is where the paths are set.
> 
> The permissions on innshellvars are root:root rw,r,r
> 
> I have never seen the use of a dot-space-path before. I guess this is
> the way of inserting an external script into a running script. I have
> checked the Debian stable inn2 source and the notation is similar:
> 
> . @LIBDIR@/innshellvars
> 
> so it doesn't appear to be a typo.
> 
> Now if I add an "echo ${PATHLIB}" or "echo ${ACTIVE}" into this script I
> find the paths are empty and /active respectively. Obviously active
> won't be found in the root directory.
> 
> So now I check out /usr/lib/news/innshellvars and discover that this is
> how the paths are retrieved:
> 
> eval `/usr/lib/news/bin/innconfval -s`
> 
> I can execute this from the command line and many of the variables are
> in the shell environment. However variables such as PATHDB are missing,
> even though they are clearly in the /usr/lib/news/bin/innconfval -s
> output.
> 
> Could this all be caused by too little space to store all the new
> environment variables? Should I receive an error message if this is
> happening?
> 
> Many thanks,
> Adam



Reply to: