4 echo "$0 is broken under Rubinius for now"
9 t_plan
5 "config.ru inside alt working_directory"
11 t_begin
"setup and start" && {
13 rtmpfiles unicorn_config_tmp
17 cat > $t_pfx.app
/config.ru
<<EOF
18 #\--daemonize --listen $listen
19 use Rack::ContentLength
20 use Rack::ContentType, "text/plain"
21 run lambda { |env| [ 200, {}, [ "#{\$master_ppid}\\n" ] ] }
23 # we have --host/--port in config.ru instead
24 grep -v ^listen
$unicorn_config > $unicorn_config_tmp
26 # the whole point of this exercise
27 echo "working_directory '$t_pfx.app'" >> $unicorn_config_tmp
29 # allows ppid to be 1 in before_fork
30 echo "preload_app true" >> $unicorn_config_tmp
31 cat >> $unicorn_config_tmp <<\EOF
32 before_fork
do |server
,worker|
33 $master_ppid = Process.ppid
# should be zero to detect daemonization
37 mv $unicorn_config_tmp $unicorn_config
39 # rely on --daemonize switch, no & or -D
40 rainbows
-c $unicorn_config
44 t_begin
"hit with curl" && {
45 body
=$
(curl
-sSf http
://$listen/)
48 t_begin
"killing succeeds" && {
52 t_begin
"response body ppid == 1 (daemonized)" && {
56 t_begin
"cleanup working directory" && {