On Mon, Nov 4, 2013 at 3:48 PM, Richard Hughes <hughsient@xxxxxxxxx> wrote: > On 4 November 2013 14:31, Miloslav Trmač <mitr@xxxxxxxx> wrote: >> That's true in the _general_ case, and therefore the ability to have >> off-line updates is a good _general_ default. We should be able to do >> _much_ better for many common cases (at the very least, a package that >> only has one executable, or one shared library, and no other >> executables or shared libraries or data files with unknown function). > > Even that's basically impossible to do in a race-free way. The way rpm > works is when you update a package, you actually install the new > package, then remove the old one. So there's a small but significant > time where just launching a command line utility makes it crash. That's not what strace says: > open("/usr/bin/youtube-dl;5277b6fc", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 46 <snip> > close(46) = 0 <snip> > write(46, "#!/usr/bin/env python\nPK\3\4\24\0\0\0\10\0"..., 65536) = 65536 <snip> > rename("/usr/bin/youtube-dl;5277b6fc", "/usr/bin/youtube-dl") = 0 rename() is atomic, so at every single moment the path refers to a valid and working executable. (The heuristic above has been intentionally worded in a way that avoids inter-file dependencies.) Mirek -- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct