Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16293 - wwwoffle-online should read config-file
Summary: wwwoffle-online should read config-file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal
Assignee: Dan Armak (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-24 13:52 UTC by simon
Modified: 2003-03-22 15:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description simon 2003-02-24 13:52:03 UTC
Please add following lines to /etc/init.d/wwwoffle-online, otherwise wwwoffle
will not read its configuration file.
If you change the default port in /etc/wwwoffle.conf the script fails to put
wwwoffle in online/offline mode.

Another solution is to export the env-variable WWWOFFLE_PROXY (see manpage for
wwwoffle).

start() {
    ebegin "Starting wwwoffled-online"
-    wwwoffle -online
+    wwwoffle -online -c /etc/wwwoffle.conf
    eend $?
}

stop() {
    ebegin "Stopping wwwoffled-online"
-    wwwoffle -offline
+    wwwoffle -offline -c /etc/wwwoffle.conf
    eend $?
}
Comment 1 Dan Armak (RETIRED) gentoo-dev 2003-03-11 10:10:06 UTC
Do you mean the wwwoffled control port (default 8081) or the http proxy port (default 
8080)? 
 
I tried changing each in /etc/wwwoffle.conf and the current wwwoffle-online initscript continued 
working. What exactly was your problem, how did it fail? Why would it need to reread ist config 
file to go into offilne/online mode? 
Comment 2 Chris Carlin 2003-03-21 02:13:18 UTC
He's exactly correct.

The wwwoffle program accessed by the online script isn't the same as the wwwoffled server. wwwoffle communicates with the running server through the control socket. Therefore it has to know where that socket is, and it can get this information from the config file.

If you start wwwoffled with the control socket on a different port and then try to use wwwoffle it will hang for a while before exiting with an error (though the init script will report success).
Comment 3 simon 2003-03-21 09:36:33 UTC
Hi,

it is exactly as Carlin described. wwwoffle cannot switch to online or offline mode if you change the default control port.

From the wwwoffle man-page:

-p <host>[:<port>]
 Sets the hostname and port number that is to be ued for the con-
 nection to the proxy server.  For the -online, -offline, -fetch,
 -config and -purge option this must be the WWWOFFLE daemon port,
 for the url options it must be the http proxy server  port.   If
 no  -p  option  is  specified  then the compiled in defaults are
 used.

Simon
Comment 4 Dan Armak (RETIRED) gentoo-dev 2003-03-22 15:07:54 UTC
Ah, now I understand. I confused wwwoffle parameters -c (use this config file) and -config (tell 
wwwoffled to use this config file). I've added the fix to the wwwoffle-online script as described 
in the orig submission. 
Although, I suppose a yet more generic way would be to make a conf.d file that would specify 
the location of the config file, in case someone wanted to use something other than 
/etc/wwwoffle.conf... But until someone actually asks me to do that I'll pass ;-)