This page is READ-ONLY. It is generated from the old site.
All timestamps are relative to 2013 (when this page is generated).
If you are looking for TeX support, please go to VietTUG.org

Cherokee 1.3.0 damn stupid

It deletes pid file when checking for configuration syntax
Added by ruby 10 months ago  »  Votes: 2/2

When invoking cherokee --test to test if the configuration is good, cherokee will delete the current pid file (if any), and this makes the system sucks and you can't reload, restart cherokee by using trivial methods. On my Ubuntu system, the script /etc/init.d/cherokee will not check if the configuraton is good before reloading: it simply sends a signal (HUP) to the running process. That's quite stupid!!

 1 # The web server is running
 2 $ kill -0 `cat /var/run/cherokee.pid `; echo $?
 3 0
 4 
 5 # Check again using ps command
 6 $ ps xauww |grep cher
 7 root     27942  0.0  0.0  22972   872 ?        Sl   05:18   0:00 /usr/sbin/cherokee
 8 www-data 28692  177  0.2 596760 20120 ?        Sl   05:20   2:40 /usr/sbin/cherokee-worker
 9 
10 # Invoke command to check configuration
11 $ cherokee --config=/etc/cherokee/cherokee.conf  --test
12 Test on /etc/cherokee/cherokee.conf: OK
13 
14 # The pid file is now deleted. The first command doesn't work any more
15 $ kill -0 `cat /var/run/cherokee.pid `; echo $?
16 cat: /var/run/cherokee.pid: No such file or directory
17 kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
18 1
19 
20 # Try to reload the process. It sucks as the pid file was deleted
21 $ /etc/init.d/cherokee reload
22 Reloading cherokee configurationNo process in pidfile '/var/run/cherokee.pid' found running; none killed.
23 failed
24 
25 # Restore the pid file
26 $ echo 27942 > /var/run/cherokee.pid 
27 
28 # Now you can reload the web server
29 $ /etc/init.d/cherokee reload
30 Reloading cherokee configuration.
31 
32 # What is my running version? It's 1.3.0, may be a development branch
33 $ cherokee --version | grep ^Cherokee
34 Cherokee Web Server 1.3.0

Comments