You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a service using systemd for its service in an RPM. Everything works. However, when you reboot the server, since /run (and thus /var/run) is based on tmpfs, the service's pid folder is gone on reboot. Thus, the service won't start. We have run into this on CentOS 7, which does not have the latest systemd. Therefore, the convenient solution of using
in the systemd start template is not available. Another option is creating a file in /etc/tmpfiles.d/ that will auto-create the /run folder on every reboot. For example, if you create the file /etc/tmpfiles.d/${{app_name}} that contains just the one line:
d /var/run/ ${{app_name}} 0755 ${{daemon_user}} ${{daemon_group}}
We opted to add the following lines to the systemd start template:
The text was updated successfully, but these errors were encountered:
ekuns
changed the title
RPM services fail on any system where /run is based on tmpfs
RPM services fail after reboot on any system where /run is based on tmpfs
Jun 23, 2015
I can make a pull request. It may take a day or two, but shouldn't be a big deal. I just corrected my post above to add missing $ for ${{app_name}} -- silly typo on my part.
I updated my post above to add detail on the possible /etc/tmpfiles.d/ solution, which may help out with the Debian version. (I'm assuming they use tmpfiles.d?) We tested that solution and it worked perfectly. But it meant adding another file to our solution instead of making small changes to a file we already had.
We have a service using systemd for its service in an RPM. Everything works. However, when you reboot the server, since /run (and thus /var/run) is based on tmpfs, the service's pid folder is gone on reboot. Thus, the service won't start. We have run into this on CentOS 7, which does not have the latest systemd. Therefore, the convenient solution of using
in the systemd start template is not available. Another option is creating a file in
/etc/tmpfiles.d/
that will auto-create the /run folder on every reboot. For example, if you create the file/etc/tmpfiles.d/${{app_name}}
that contains just the one line:We opted to add the following lines to the systemd start template:
The text was updated successfully, but these errors were encountered: