Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

cherokee-admin usability

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


gwolf at gwolf

Jun 11, 2008, 1:04 PM

Post #1 of 2 (191 views)
Permalink
cherokee-admin usability

(Re: Debian bug report #479346 - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=479346)
(Copying over to the bug report itself, please send copies of your
replies as well)

The cherokee-admin program is a nice and nifty tool... But it lacks
some polish which can easily scare away users. This bug report is a
very good example: cherokee-admin launches a statically configured
Cherokee server, running the admin program via a SCGI
connection... Statically configured to be at TCP port 4000:

cherokee/admin_main.c line 74:
RULE "1!handler!balancer!local1!host = localhost:4000\n"

Granted, we cannot expect much configurability from the configurator,
right? :-) The choice of port 4000 is IMHO unfortunate, as it is a
common port for local use. And it is not documented at all. But the
real problem is the conflict is not reported - The user just gets a
«500 Internal Server Error» message, but nothing in the console.

I just talked with Álvaro, and he agrees that it's a good (and simple
to implement) idea for cherokee-admin to check if the port is
available upon invocation, and send a prominent message to the user in
the console, refusing to run. But in any case, a more robust method
would be very nice to have: Would any of you feel like coding a
failover mechanism, that looks for a free port? I am completely
unfamiliar with the mechanism, so I'd rather ask for a patch than
write one myself ;-)

In the meantime, I'm modifying the Debian package, so instead of
binding to such a popular port (at least it conflicts with mldonkey)
it binds to something else... say, port 31337? No, I guess that's
popular as well ;-) Well, a random high number. Of course, I'll check
it.

And, just for extra points: When you want to close the cherokee-admin
session, you kill the process with an innocuous Ctrl-C, right? Well,
the only problem is it looks as if we hit an error:

$$ /usr/sbin/cherokee-admin
Cherokee Web Server 0.6.1 (May 5 2008): Listening on port 9090, TLS disabled
IPv6 disabled, using epoll, 1024 fds system limit, max. 502 connections
10 threads, 105 fds per thread, standard scheduling policy
Server running.. PID=7355
Traceback (most recent call last):
File "/usr/share/cherokee/admin/server.py", line 164, in <module>
main()
File "/usr/share/cherokee/admin/server.py", line 158, in main
srv.handle_request()
File "/usr/lib/python2.5/SocketServer.py", line 217, in handle_request
request, client_address = self.get_request()
File "/usr/lib/python2.5/SocketServer.py", line 374, in get_request
return self.socket.accept()
File "/usr/lib/python2.5/socket.py", line 167, in accept
sock, addr = self._sock.accept()
KeyboardInterrupt

So, of course, this is just matter of anticipating we will be
terminated by a Ctrl-C, avoiding a head-scratching user ;-) So, would
anybody object to this? (I'm submitting it to the list as I'm a
complete python newbie, and I don't grok cherokee internals)

Index: cherokee-0.7.1/admin/server.py
===================================================================
--- cherokee-0.7.1.orig/admin/server.py 2008-06-11 14:54:46.000000000 -0500
+++ cherokee-0.7.1/admin/server.py 2008-06-11 14:55:56.000000000 -0500
@@ -158,11 +158,14 @@
cfg = Config(cfg_file)

print ("Server running.. PID=%d" % (os.getpid()))
- while True:
- # Do it
- srv.handle_request()
+ try:
+ while True:
+ # Do it
+ srv.handle_request()

- srv.server_close()
+ srv.server_close()
+ except KeyboardInterrupt:
+ print "Server exiting..."

if __name__ == '__main__':
main()

I hope it makes sense (I have not even tested it yet ;-) )

Thank you,

--
Gunnar Wolf - gwolf[at]iiec.unam.mx - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF
Attachments: signature.asc (0.19 KB)


alvaro at gnu

Jun 11, 2008, 3:03 PM

Post #2 of 2 (181 views)
Permalink
Re: cherokee-admin usability [In reply to]

On 11 Jun 2008, at 22:04, Gunnar Wolf wrote:

> Granted, we cannot expect much configurability from the configurator,
> right? :-) The choice of port 4000 is IMHO unfortunate, as it is a
> common port for local use. And it is not documented at all. But the
> real problem is the conflict is not reported - The user just gets a
> «500 Internal Server Error» message, but nothing in the console.

Yeah, it was a bug, indeed. The good news is that it is now fixed
(r1534) in trunk and the 0.7 branch.

> Would any of you feel like coding a
> failover mechanism, that looks for a free port? I am completely
> unfamiliar with the mechanism, so I'd rather ask for a patch than
> write one myself ;-)

Hehe.. of course, you have two wishes left. :)

http://svn.cherokee-project.com/changeset/1534#file2

> So, of course, this is just matter of anticipating we will be
> terminated by a Ctrl-C, avoiding a head-scratching user ;-) So, would
> anybody object to this? (I'm submitting it to the list as I'm a
> complete python newbie, and I don't grok cherokee internals)

It's applied now in trunk and the 0.7 branch:
http://svn.cherokee-project.com/changeset/1535#file1

Thanks a million for the report and the patch!


PS: I will release 0.7.2 tomorrow so we can get the patched version in
Debian on time.

--
Greetings, alo.
http://www.alobbs.com/
_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.