Closed ericfranz closed 7 years ago
Interesting.
Access https://webdev05.hpc.osc.edu/nginx/stop to stop your nginx
In a shell on webdev05 ps fux returns:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
efranz 23908 0.0 0.0 116124 1940 ? S 14:53 0:00 sshd: efranz@pts/0
efranz 23909 0.0 0.0 109728 4960 pts/0 Ss 14:53 0:00 \_ -bash
efranz 28726 0.0 0.0 108328 976 pts/0 R+ 15:53 0:00 \_ ps fux
Add the broken ruby app and access https://webdev05.hpc.osc.edu/pun/dev/ps and see the error. Now do a ps:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
efranz 28780 0.0 0.0 91160 2812 ? S 15:53 0:00 nginx: worker process
efranz 28762 0.0 0.0 711692 3952 ? Sl 15:53 0:00 PassengerHelperAgent
efranz 23908 0.0 0.0 116124 1940 ? S 14:53 0:00 sshd: efranz@pts/0
efranz 23909 0.0 0.0 109728 4960 pts/0 Ss 14:53 0:00 \_ -bash
efranz 28799 0.0 0.0 108320 976 pts/0 R+ 15:53 0:00 \_ ps fux
Now remove the config.ru and add the app.js. Access the URL and see the same rack error. Run ps again:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
efranz 28780 0.0 0.0 91160 2848 ? S 15:53 0:00 nginx: worker process
efranz 28762 0.0 0.0 711692 4108 ? Sl 15:53 0:00 PassengerHelperAgent
efranz 23908 0.0 0.0 116124 1940 ? S 14:53 0:00 sshd: efranz@pts/0
efranz 23909 0.0 0.0 109728 4960 pts/0 Ss 14:53 0:00 \_ -bash
efranz 28839 0.0 0.0 108320 972 pts/0 R+ 15:54 0:00 \_ ps fux
Now explicitly kill the PassengerHelperAgent. Then access the app again. Now it works, loading the node app.
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
efranz 28780 0.0 0.0 91160 2848 ? S 15:53 0:00 nginx: worker process
efranz 28845 0.0 0.0 514236 4960 ? Sl 15:54 0:00 PassengerHelperAgent
efranz 23908 0.0 0.0 116124 1940 ? S 14:53 0:00 sshd: efranz@pts/0
efranz 23909 0.0 0.0 109728 4964 pts/0 Ss 14:53 0:00 \_ -bash
efranz 28856 0.0 0.0 108324 980 pts/0 R+ 15:54 0:00 \_ ps fux
Notice that PassengerHelperAgent restarted automatically after killing it.
It seems the PassengerHelperAgent
(the process that launches the child app processes) caches a given app's passenger_app_type
after its first launch (from then on it will try to launch the app with the corresponding executable: ruby
, node
, python
).
The only way to non-destructively update the passenger_app_type
that I can tell is by telling it to restart that individual app with the tmp/restart.txt
file. Otherwise you need to either kill the PassengerHelperAgent
or restart your PUN.
Not sure if this belongs in this repo or another.
Steps to reproduce:
Accessing the app in your development sandbox should produce a startup error. https://webdev05.osc.edu/pun/dev/ps
Remove all the files in the ps directory. Replace it with a valid node.js app by adding an app.js file with these contents:
Access the app again. You will still see the rack error even though an app.js app is in its place. This should continue until your PUN is stopped and then you access the URL again.
In the ps directory,
mkdir tmp
andtouch tmp/restart.txt
Access https://webdev05.hpc.osc.edu/pun/dev/ps again. Now it loads properly.