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

If the /var/run (aka /run) folder doesn't exist for the PID file, create it #611

Merged
merged 1 commit into from
Jul 10, 2015

Conversation

ekuns
Copy link
Contributor

@ekuns ekuns commented Jun 24, 2015

CentOS 7 and many other recent Linuxes have switched to a non-persistent (tmpfs) /run folder, with /var/run being a symbolic link to the tmpfs /run mount. The RPM creates the correct folder in /var/run for the PID file, but on reboot, that file is gone. There are many ways to fix it. This way will work on older systemd versions.

This change was tested on CentOS 7.

…ate it

CentOS 7 and many other recent Linuxes have switched to a non-persistent (tmpfs) /run folder, with /var/run being a symbolic link to the tmpfs /run mount.  The RPM creates the correct folder in /var/run for the PID file, but on reboot, that file is gone.  There are many ways to fix it.  This way will work on older systemd versions.
@muuki88
Copy link
Contributor

muuki88 commented Jun 24, 2015

Nice, LGTM. I'm thinking if we should use the same bash-line as in the Debian systemv script:

 [ -d "/var/run/${{app_name}}" ] || install -d -o "$DAEMON_USER" -g "$DAEMON_GROUP" -m755 "/var/run/${{app_name}}"

I don't care if it's a one liner , but using the same snippet for the same thing. Do you know if there are any differences between both bash snippets?

@muuki88
Copy link
Contributor

muuki88 commented Jun 24, 2015

Ah, and we use this in [Upstart](You can optimise for performance and get scale thrown in %28almost for free%29. Your monolith can scale further than you think) as well.

@ekuns
Copy link
Contributor Author

ekuns commented Jun 24, 2015

The one-liner is fine with me. I like the idea of consistency. Let me test it locally to see if it works and get back to you. If someone else could test the same change in Upstart that would be cool. I don't want to make such a change myself without an environment where I can test it. After testing, should I check the change into my fork and issue a new pull request? Can I amend this one?

@muuki88
Copy link
Contributor

muuki88 commented Jun 24, 2015

Sure, just amend and force push.

I will test this locally as well ( just push it on this pr ). Thinks :)

muuki88 added a commit that referenced this pull request Jul 10, 2015
If the /var/run (aka /run) folder doesn't exist for the PID file, create it
@muuki88 muuki88 merged commit 4fd857e into sbt:master Jul 10, 2015
@muuki88
Copy link
Contributor

muuki88 commented Jul 10, 2015

Merging now, and code-style change in a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants