Mailing List Archive

Issue 1267 in cherokee: When Cherokee fails to start up it does not properly set a return value
Status: Accepted
Owner: gunnarwo...@gmail.com
Labels: Type-Defect Priority-Low Component-Scripts Component-Logic Usability

New issue 1267 by gunnarwo...@gmail.com: When Cherokee fails to start up it
does not properly set a return value
http://code.google.com/p/cherokee/issues/detail?id=1267

What steps will reproduce the problem?
1. Launch /usr/sbin/cherokee in any way it should fail to start (i.e. when
another instance is already running or without the needed privileges to
open a low port)
2. It properly prints out a descriptive message
3. But it returns 0 (success)

What is the expected output? What do you see instead?

It should return any other value, so that the init script (or any other
thing that launches Cherokee) nocites the startup was not successful.

This can be exemplified by Debian bug report #643005:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643005


_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev
Re: Issue 1267 in cherokee: When Cherokee fails to start up it does not properly set a return value [ In reply to ]
Comment #1 on issue 1267 by gunnarwo...@gmail.com: When Cherokee fails to
start up it does not properly set a return value
http://code.google.com/p/cherokee/issues/detail?id=1267

I guess the culprit is function may_demonize() in cherokee/main.c, as the
check is done after the process forks, when the server actually tries to
set up the basic infrastructure. I cannot propose a patch, but it might
require a minor IPC call to ensure the child was able to properly start its
functionality - Or deferring the process split until the needed resources
are secured.

But of course you already know that ;-)

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev
Re: Issue 1267 in cherokee: When Cherokee fails to start up it does not properly set a return value [ In reply to ]
Comment #2 on issue 1267 by psaod8fz...@gmail.com: When Cherokee fails to
start up it does not properly set a return value
http://code.google.com/p/cherokee/issues/detail?id=1267

It seems this has been fixed:

# cherokee -d
Cherokee Web Server 1.2.102 (Dec 17 2012): Listening on port ALL:80, TLS
disabled, IPv6 enabled, using epoll, 4096 fds system limit, max. 2041
connections, 5 threads, 408 connections per thread, standard scheduling
policy

# cherokee
[19/12/2012 08:27:57.587] (critical) bind.c:283 - Could not bind() port=80
(UID=0, GID=0) | Most probably there is another web server listening to
the
same port. You will have to shut it down before launching Cherokee. It
could also be a permissions issue as well. Remember that non-root user
cannot listen to ports < 1024.

# echo $?
1
# cherokee -V
Cherokee Web Server 1.2.102
[...]

_______________________________________________
Cherokee-dev mailing list
Cherokee-dev@lists.octality.com
http://lists.octality.com/listinfo/cherokee-dev