It took me less than 4 years to finally revisit this subject. I'd like to thank all the people who commented the original blog post. It looks like for those years SystemD (am I writing it wrong?) was in constant evolution and new features were added.
This is what I'm running in production. Containing System
and omitting Unit
and Install
-parts as they are unchanged:
[Service]
Type=forking
PrivateTmp=yes
User=nobody
Group=nobody
RuntimeDirectory=dhis
RuntimeDirectoryMode=0750
ExecStart=/usr/sbin/dhid -P /run/dhis/dhid.pid
PIDFile=/run/dhis/dhid.pid
This also makes my RPM spec-file simpler, I got to remove stuff there, because temporary directory creation is taken care. Finally, I think that this one is done and ready!
If you want to download my source RPM-package, go here.
If you want to know more about RPM-specs, read Maximum RPM - Taking the RPM Package Manager to the Limit.
Phillip Odam on :
I've recently hit the same issue you mention in your previous post with /run and tmpfs. And this detail here looked promising until I drilled in deeper and read up on systemd-tmpfiles where configuration can be maintained in /etc/tmpfiles.d/ which is a little more flexibility and we think will be beneficial for our particular situation.
Having said that, wouldn't have as easily found systemd-tmpfiles if it wasn't for this post of yours, so thanks!