[Catalyst] Running Catalyst apps with start_server
Octavian Rasnita
orasnita at gmail.com
Sat Jan 21 22:16:03 GMT 2012
Hi,
Is Server-Starter a good way for starting a Catalyst app?
I am asking this because I don't have success with using start_server with the --daemonize option.
I use Perl 5.14.2 under Ubuntu 11.
Here is the command I used:
start_server \
--port :5000 \
-- starman \
--workers 15 \
--max-requests 1000 \
--pid /srv/log/site.pid \
--access-log /srv/log/access.log \
--error-log /srv/log/error.log \
--daemonize \
/srv/BRK/brk.psgi
The command is not executed in the background, but it keeps printing the following errors:
new worker 7423 seems to have failed to start, exit status:256
starting new worker 9044
Pid_file already exists for running process (27684)... aborting
new worker 9044 seems to have failed to start, exit status:256
starting new worker 10428
Pid_file already exists for running process (27684)... aborting
new worker 10428 seems to have failed to start, exit status:256
....
So I need to break it. After breaking it, I can see that there are still some starman processes running, and their number seems to decrease, then increase again and so on, but the Starman web server doesn't answer to requests:
teddy 12843 0.0 0.0 0 0 pts/2 Z+ 23:05 0:00 [starman] <defunct>
teddy 14076 0.0 0.1 9820 5096 ? R 23:05 0:00 starman master --workers 15 --max-requests 1000 --pid /srv/log/site.pid --access-log /srv/log/access.log --error-log /srv/log/error.log --daemonize
teddy 14080 0.0 0.0 0 0 ? R 23:05 0:00 [starman master ]
teddy 14082 0.0 0.0 0 0 ? Z 23:05 0:00 [starman master ] <defunct>
teddy 14083 0.0 0.1 9820 5020 ? R 23:05 0:00 starman master --workers 15 --max-requests 1000 --pid /srv/log/site.pid --acce
ss-log /srv/log/access.log --error-log /srv/log/error.log --daemonize
...
On the other hand, if I use the same command, but without the --daemonize option, start_server seems to work fine and the web server can be also accessed with no problems. It prints:
start_server (pid:17145) starting now...
starting new worker 17146
But of course, it doesn't go in the background...
I can put it to run in the background if I add a " &" after the command line start_server ... and I've seen that if I do that it works and I can also add or remove workers with kill -TTIN|TTOU, but... is it a good way? Or it is better recommended to run starman directly?
Octavian
More information about the Catalyst
mailing list