Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove stale pid and socket files #36

Merged
merged 4 commits into from
May 8, 2019
Merged

Remove stale pid and socket files #36

merged 4 commits into from
May 8, 2019

Conversation

MorganRodgers
Copy link
Contributor

Fixes #11.

Morgan Rodgers added 2 commits April 30, 2019 13:21
… stale

The reason that files are only removed explicitly if they are stale is Passenger tries to unlink them as part of its shutdown routine and complains when they do not exist.
@ericfranz
Copy link
Contributor

@treydock is there any reason why always removing stale pid files when calling nginx_stage nginx_clean would be problematic?

Is there any utility in retaining stale pid files? I could imagine there would be a case where it would help with diagnosing an issue, but not sure. I'm not sure that nginx_stage nginx_clean prints anything to stdout or stderr or if we started printing to stderr a message when removing stale pid files if that would be captured by anything.

The current approach was to not change behavior and add a new flag that removed pid files, but then again user expectation was different:

I would have expected nginx_stage nginx_clean to remove those stale pidfiles

@treydock
Copy link
Contributor

@ericfranz I think removing stale PIDs is fine. I'd suggest writing the removed PID file and the actual PID (if available) to stdout or stderr and then we would update the deployed cron job to look like the following:

/opt/ood/nginx_stage/sbin/nginx_stage nginx_clean 2>&1 | logger -t nginx_stage

This would be the simplest approach for nginx_stage and would still write the output to syslog and not email people the output. I like this because then it's very easy to setup Splunk or other tools to tell me when something pops up in the logs.

@ericfranz
Copy link
Contributor

@MorganRodgers lets change nginx clean to always remove stale pid files and just output the stale pid removed to stdout stale pid file removed: /var/run/nginx/kilian/passenger.pid

The code should be a whole lot simpler then!

Copy link
Contributor

@ericfranz ericfranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

Morgan Rodgers added 2 commits May 7, 2019 14:53
…ove-stale-files

Conflicts:
	nginx_stage/lib/nginx_stage/generators/nginx_clean_generator.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stale pidfiles not removed
3 participants