Closed Flowneee closed 1 year ago
Can you use the same trick as for git and put an empty useless file in the directory?
This could be a solution, but not good IMO. I think people could find other usage for this feature.
If I come up with PR, will you consider it or you against hacking rules
at all? If latter, I'll close this issue.
How do other packages do it?
I'd rather not add a "hacky" solution, but something that's accepted as standard in Debian and Ubuntu.
For systemd-based distros, you should probably use directives like LogsDirectory=
in a unit, or, in more complex cases, install a file describing wanted directories into /usr/lib/tmpfiles.d
.
EDIT: that won't solve directory deletion on uninstall, but neither apt-get remove
nor apt-get purge
deletes logs for any existing package I can think of.
I'm gonna close this issue since I didn't come up to non-hacky way and it was quite some time. We actually did what @WGH- recommended - just don't delete existing logs, this is actually correct I think, so thanks for recommendation. Also systemd-based solutions is worth the shot, although we didn't try it yet.
I still think that alternating rules could be useful, but at this time I don't have an actual case to demonstrate that necessity)
Hi.
I am trying to create an empty folder in my package (my case - prepare folders for logs, something like /var/log/), but I didn't found any way to do that rather than in
postinst
, but this approach have a problem - package doesn't own folder and won't remove them on uninstall. And there is no way to modifyrules
to runhttps://man7.org/linux/man-pages/man1/dh_installdirs.1.html
.In RPM:
I think it should be cool to have some way to hack
rules
, however right now I can't imagine how it might look.