Modified the PID being inserted to /data/<app>/shared/pids/passenger.<port>.pid #477
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your patch
This is a fix for the Passenger5 bug documented in FB-10179.
The script in
/engineyard/bin/app_<app_name>
has a bug. It leads to monit looking for the incorrect Passenger PID which results to all attemps at stop/restart failing.Previous script logic was:
Meaning that if the Passenger Nginx process is running and the Passenger process is running then the Passenger PID is put into the pidfile. Whereas on a usual start the Nginx PID would be put into the pidfile.
The suggested change to the script is to output $NGINX_PID to $PIDFILE instead of $PASSENGER_PID as shown below:
Recommended Release Notes
Modified Passenger5 app control script to indicate Nginx PID instead of Passenger PID to resolve known issue in stop/restart attempts failures
Estimated risk
High. This changes the Passenger5 app control script. If this is broken then the application may fail to start.
Components involved
Passenger5 recipe
Description of testing done
See QA instructions - tests were done on a staging environment.
QA Instructions
Boot a v5 Passenger environment with 1 app instance (not Solo), then boot an additional application instance and check the PID in the pidfile to see which process it is monitoring.
Review the current behavior
/home/deploy/.passenger/support-binaries/5.1.8/PassengerAgent
monit reload
, this will recreate the PID file by rerunning the script in /engineyard/bin/monit stop all
- Stops/home/deploy/.passenger/support-binaries/5.1.8/PassengerAgent
process only (Kill nginx process to recover both processes)monit restart all
- Functions as intended and creates pidfile with correct PIDUpdate to the QA stack and verify that the bug is fixed
After the modification of the script, test the new behavior, following the same procedure as above:
monit stop all
- Stops both processes (Executemonit start all
to recover)monit restart all
- Functions as intended and creates pidfile with correct PIDVerify that previous functionality still works
Deployment
sudo monit start all -g <app>
orsudo monit restart all -g <app>
Deploy