On Sat, Mar 1, 2014 at 2:18 PM, Tom Gundersen <teg@jklm.no> wrote:<br>
<blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">And a bit further down that thread there was this proposal from Lennar
(which doesn't seem far from what Colin wants):
<<a href="http://lists.freedesktop.org/archives/systemd-devel/2013-July/012024.html">http://lists.freedesktop.org/archives/systemd-devel/2013-July/012024.html</a>>.</div></blockquote><br><div>Right...so rereading that, the discussion seemed to peter out after: <a href="http://lists.freedesktop.org/archives/systemd-devel/2013-July/012090.html">http://lists.freedesktop.org/archives/systemd-devel/2013-July/012090.html</a></div><div><br></div><div>I see Michael's point here as well:</div><div><a href="http://lists.freedesktop.org/archives/systemd-devel/2013-July/012037.html">http://lists.freedesktop.org/archives/systemd-devel/2013-July/012037.html</a></div><div><br></div><div>Certainly it magnifies the pain for the RPM world in that there's nothing that scans the build directory and says "hey you installed something that looks like a tmpfiles.d snippet, let me auto-generate some postinst shell script".</div><div><br></div><div>I think any postinsts like this are still pretty ugly though.  It means the directories are created when the daemon is *installed*, not when it's run.  Which is odd and against the generally dynamic nature of systemd.</div><div><br></div><div>Also, running shell script as root is just full of fail, sorry package people =)  Even if it's auto-generated from a centrally maintained place.</div><div><br></div><div>I admit this is sometimes what you want, e.g. if you need a way to install postgres and then restore a dump file from backup *before* starting it.  Those cases could be covered of course by an administrator doing a mkdir manually and if they're careful about SELinux, using restorecon.</div><div><br></div><div>So basically here'd what I'd propose, which is an extension of Lennart's:</div><div><br></div><div>RuntimeDirectory=/run/mydaemon</div><div>PersistentStateDirectory=/var/lib/mydaemon</div><div><br></div><div>We could cover a lot of simple cases with that - default to being owned by User= and mode 0700, and have RuntimeDirectoryMode= and PersistentStateDirectoryMode= to override that last bit.</div><div><br></div><div>Note - the previous discussion seemed largely about /run, but I am most interested in real permanent directories in /var.</div><div><br></div><div>The primary goal again for me is that I can rm -rf /var/* and reboot, and have the system be clean.</div><div><br></div>