On 23/11/10 23:01, Lennart Poettering wrote: > On Tue, 23.11.10 23:02, Till Maas (opensource@xxxxxxxxx) wrote: > >> The release notes section contains this: >> | /var/run and /var/lock are now mounted from tmpfs, and hence emptied on >> | reboot. Applications must ensure to recreate their own files/dirs on >> | startup, and cannot rely that doing this at package installtion will >> | suffice >> >> But this does not mention tmpfiles.d which you wrote can be used instead >> of creating files or dirs on startup. > > Added a comment about this now. > >>> c) YOU need to edit your .spec file and place a %ghost where >>> appropriate. >>> >>> c) YOU need to test if you package still works, and if necessary file >>> AVC bugs, add an /etc/tmpfiles.d drop-in file to your program, or patch >>> it so that it is able to recreate these directories beneath /var/run on >>> its own. >> >> Imho there should be a packaging guideline to make it clear what needs >> to be done in which cases. E.g. when to %ghost files and when not. > > I guess extending the guidelines with a line or two about this is a good idea. > >>> <snip> >>> d /var/run/screens 1777 root root 10d >>> d /var/run/uscreens 0755 root root 10d12h >>> </snip> >>> >>> This encodes that two directories are created under the listed names, with >>> automatic clean up after 10 days resp. 10 days and 12h. >> >> Removing /var/run/screens after 10 days sounds wrong. Even removing the >> sockets inside /var/run/screens sounds wrong. Is this just a bad example >> am I not understanding the age means. > > Sorry, it's not necessarily a great example. > > The aging stuff is mostly useful for things like /tmp itself. > >>> For more details consult the man page: >>> >>> http://0pointer.de/public/systemd-man/tmpfiles.d.html >> >> Here it says: >> | If a file or directory is older than the current time minus the age >> | field it is deleted. >> >> And when are the files and dirs created? Only when the system is >> booted? > > Yes. > >> But then after installing an package that requires files to be created >> by tmpfiles.d the system needs to be rebooted before it can be used. Or >> will rpm call something that parses the appropriate tmpfiles.d file when >> the package is installed / updated? > > Hmm, it has been suggested that we should make it possible to create > these dirs in the .spec files by invoking the systemd-tmpfiles tool > directly from the scriptlets. I guess we should add a nice interface for > that. In the meantime it should be sufficient to simply place th right > "mkdir -p -m ..." in the scriptlet. Of course it would be desirable if > we have a single place where the dirs to create are encoded. Why not create the directories in the initscript/systemd equivalent? Paul. -- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel