On Fri, May 27, 2011 at 11:10:14AM +0200, Santiago Vila wrote: > El 27/05/11 10:59, Roger Leigh escribió: > >On Fri, May 27, 2011 at 10:49:52AM +0200, Santiago Vila wrote: > >>Ok, I'm starting to understand the idea of making symlinks only in the > >>initial install. > >> > >>Assuming that I manage to do the same in a different way, it would be > >>ok for you, right? > > > >Absolutely. > > > >>(In particular, I'm thinking about creating /var/run and /var/lock > >>symlinks even if they are provided as directories inside the .deb. > >>As far as they are never dropped, I think that would be cleaner than > >>letting dpkg remove them and restoring afterwards). > > > >I was thinking about this while waking up this morning. I've attached > >a patch to do this. > > > >We retain /var/run and /var/lock as directories. This means all > >upgrades will be reliable--there's no gap where they might not > >exist. In the initial install we convert them to symlinks in > >the postinst. I've created a shell function to do this, which > >also takes care to move the contents (if any). At this point it's > >extremely unlikely anything will be present (there isn't testing > >with debootstrap), but it doesn't hurt. > > No "moving things", please. You told me this was for bootstrapping > only, so I'll skip that part. > > If base-files is going to be officially in charge of creating those > symlinks in the initial install, I hope that nobody else is fiddling > with them (in the initial install).
This is to cater for the case that - base files in unpacked (/var/run created) - another package puts something in /var/run in its postinst e.g. service start - base files is configured (/var/run is not removable due to files being present). That said, the chance of this happening during debootstrap is very low (zero at this point in time). No package currently does this, so a simple migrate_directory() { if [ ! -L $1 ]; then rmdir $1 ln -s $2 $1 fi } is quite sufficient. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
signature.asc
Description: Digital signature