* [gentoo-user] Dumb question @ 2006-10-11 4:21 Anthony E. Caudel 2006-10-11 4:42 ` Troy Curtis Jr ` (2 more replies) 0 siblings, 3 replies; 16+ messages in thread From: Anthony E. Caudel @ 2006-10-11 4:21 UTC (permalink / raw To: Gentoo Mailing List I have been using Gentoo for more than 2 years now and have always wondered (but never asked - That's the "dumb" part) how Gentoo manages to update a package that happens to be running at the time. Given that the old version (the one running) is deleted, how does it manage to keep standing if you just cut its legs off? I've never seen this discussed anywhere which probably means everyone else already knows and are probably thinking to themselves, "Dumb question." Tony -- Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 4:21 [gentoo-user] Dumb question Anthony E. Caudel @ 2006-10-11 4:42 ` Troy Curtis Jr 2006-10-11 6:20 ` Nick Rout 2006-10-11 6:30 ` Anthony E. Caudel 2006-10-11 7:44 ` Pawel Kraszewski 2006-10-11 16:23 ` Daniel Barkalow 2 siblings, 2 replies; 16+ messages in thread From: Troy Curtis Jr @ 2006-10-11 4:42 UTC (permalink / raw To: gentoo-user On 10/10/06, Anthony E. Caudel <acaudel@gt.rr.com> wrote: > I have been using Gentoo for more than 2 years now and have always > wondered (but never asked - That's the "dumb" part) how Gentoo manages > to update a package that happens to be running at the time. > > Given that the old version (the one running) is deleted, how does it > manage to keep standing if you just cut its legs off? > > I've never seen this discussed anywhere which probably means everyone > else already knows and are probably thinking to themselves, "Dumb question." > > Tony > -- > Those who would give up essential Liberty, to purchase a little temporary > Safety, deserve neither Liberty nor Safety. > -- Benjamin Franklin > -- > gentoo-user@gentoo.org mailing list > > Simple and short answer is that at run-time the binary and libraries are loaded into memory and run from there. When you do the update it replaces the binary and/or libraries on disk, but you won't actually be running those updates until you restart the process. There may be other, more dynamic, cases that I am aware of, but that is the general gist of it. Troy -- "Beware of spyware. If you can, use the Firefox browser." - USA Today Download now at http://getfirefox.com Registered Linux User #354814 ( http://counter.li.org/) -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 4:42 ` Troy Curtis Jr @ 2006-10-11 6:20 ` Nick Rout 2006-10-11 18:05 ` Thomas T. Veldhouse 2006-10-11 6:30 ` Anthony E. Caudel 1 sibling, 1 reply; 16+ messages in thread From: Nick Rout @ 2006-10-11 6:20 UTC (permalink / raw To: gentoo-user On Tue, 10 Oct 2006 23:42:33 -0500 "Troy Curtis Jr" <troycurtisjr@gmail.com> wrote: > On 10/10/06, Anthony E. Caudel <acaudel@gt.rr.com> wrote: > > I have been using Gentoo for more than 2 years now and have always > > wondered (but never asked - That's the "dumb" part) how Gentoo manages > > to update a package that happens to be running at the time. > > > > Given that the old version (the one running) is deleted, how does it > > manage to keep standing if you just cut its legs off? > > > > I've never seen this discussed anywhere which probably means everyone > > else already knows and are probably thinking to themselves, "Dumb question." > > > > Tony which leads top the point that if you update a daemon like sshd, yopu need to restart it, or else you are still running the old daemon. -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 6:20 ` Nick Rout @ 2006-10-11 18:05 ` Thomas T. Veldhouse 2006-10-11 18:29 ` Neil Bothwick 0 siblings, 1 reply; 16+ messages in thread From: Thomas T. Veldhouse @ 2006-10-11 18:05 UTC (permalink / raw To: gentoo-user Nick Rout wrote: > which leads top the point that if you update a daemon like sshd, yopu > need to restart it, or else you are still running the old daemon. > > And ... if the startup scripts change or a major version bump occurs, a clean shutdown should happen BEFORE the new package is installed. The portage system really should shutdown any services before an upgrade occurs. Tom Veldhouse -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 18:05 ` Thomas T. Veldhouse @ 2006-10-11 18:29 ` Neil Bothwick 0 siblings, 0 replies; 16+ messages in thread From: Neil Bothwick @ 2006-10-11 18:29 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 731 bytes --] On Wed, 11 Oct 2006 13:05:12 -0500, Thomas T. Veldhouse wrote: > And ... if the startup scripts change or a major version bump occurs, a > clean shutdown should happen BEFORE the new package is installed. The > portage system really should shutdown any services before an upgrade > occurs. So you're updating SSH over a remote link, portage shuts down sshd then the new version fails to compile, leaving the old version there but not running and no way to fix it from a hundred miles away. No thanks! I can live with portage warning me of what needs to be done, but I'd rather it didn't make unilateral decisions on my behalf. -- Neil Bothwick I've got a mind like a... a... what's that thing called? [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 4:42 ` Troy Curtis Jr 2006-10-11 6:20 ` Nick Rout @ 2006-10-11 6:30 ` Anthony E. Caudel 2006-10-11 8:28 ` Neil Bothwick 1 sibling, 1 reply; 16+ messages in thread From: Anthony E. Caudel @ 2006-10-11 6:30 UTC (permalink / raw To: gentoo-user Troy Curtis Jr wrote: > On 10/10/06, Anthony E. Caudel <acaudel@gt.rr.com> wrote: >> I have been using Gentoo for more than 2 years now and have always >> wondered (but never asked - That's the "dumb" part) how Gentoo manages >> to update a package that happens to be running at the time. >> >> Given that the old version (the one running) is deleted, how does it >> manage to keep standing if you just cut its legs off? >> >> I've never seen this discussed anywhere which probably means everyone >> else already knows and are probably thinking to themselves, "Dumb >> question." >> >> Tony >> -- >> Those who would give up essential Liberty, to purchase a little temporary >> Safety, deserve neither Liberty nor Safety. >> -- Benjamin Franklin >> -- >> gentoo-user@gentoo.org mailing list >> >> > > Simple and short answer is that at run-time the binary and libraries > are loaded into memory and run from there. When you do the update it > replaces the binary and/or libraries on disk, but you won't actually > be running those updates until you restart the process. There may be > other, more dynamic, cases that I am aware of, but that is the general > gist of it. > > Troy I suspected it might be memory. However I still find it difficult. If I'm running KDE for example, it requires at least kdelibs which is a lot to hold in memory. Tony -- Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 6:30 ` Anthony E. Caudel @ 2006-10-11 8:28 ` Neil Bothwick 0 siblings, 0 replies; 16+ messages in thread From: Neil Bothwick @ 2006-10-11 8:28 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 813 bytes --] On Wed, 11 Oct 2006 01:30:59 -0500, Anthony E. Caudel wrote: > I suspected it might be memory. However I still find it difficult. If > I'm running KDE for example, it requires at least kdelibs which is a lot > to hold in memory. Programs only load the libraries they use, you're unlikely to have all KDE libraries loaded at once. This can lead to problems if you are updating KDE and have updated the libs but not the packages. I've had Konqueror fail to work during an upgrade because of a library mismatch. The easy way to avoid this is to load all the programs you are likely to be using before starting the the upgrade. That way you are sure that all you need is in memory and independent of changes in the on-disk versions. -- Neil Bothwick I am Flatulus of Borg. Pull my finger. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 4:21 [gentoo-user] Dumb question Anthony E. Caudel 2006-10-11 4:42 ` Troy Curtis Jr @ 2006-10-11 7:44 ` Pawel Kraszewski 2006-10-11 16:23 ` Daniel Barkalow 2 siblings, 0 replies; 16+ messages in thread From: Pawel Kraszewski @ 2006-10-11 7:44 UTC (permalink / raw To: gentoo-user Dnia środa, 11 października 2006 06:21, Anthony E. Caudel napisał: > I have been using Gentoo for more than 2 years now and have always > wondered (but never asked - That's the "dumb" part) how Gentoo manages > to update a package that happens to be running at the time. > > Given that the old version (the one running) is deleted, how does it > manage to keep standing if you just cut its legs off? > > I've never seen this discussed anywhere which probably means everyone > else already knows and are probably thinking to themselves, "Dumb > question." Observe CAREFULLY sequence of operations during emerge. It doesn't remove old package and install new ones. It installs the new one over the old and then removes unnecessary remains. It may overwrite file in use due to the way Unices handle file management. On Windows you can't delete open file. On Unix you can, and process keeping file open won't usually notice that. Moreover, as long as the file is open, its data isn't removed from disk. Once the process closes it, it is physically removed - not sooner. So after overwriting file (library, application) currently running applications (having it open) will still have access to old version and each newly run application will use the new one. Which in turn means - yes, you need to 'power cycle' application to use new libraries or new version of executable. -- Pawel Kraszewski www.kraszewscy.net -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 4:21 [gentoo-user] Dumb question Anthony E. Caudel 2006-10-11 4:42 ` Troy Curtis Jr 2006-10-11 7:44 ` Pawel Kraszewski @ 2006-10-11 16:23 ` Daniel Barkalow 2006-10-11 17:43 ` Michael Sullivan 2006-10-12 6:17 ` Anthony E. Caudel 2 siblings, 2 replies; 16+ messages in thread From: Daniel Barkalow @ 2006-10-11 16:23 UTC (permalink / raw To: Gentoo Mailing List On Tue, 10 Oct 2006, Anthony E. Caudel wrote: > I have been using Gentoo for more than 2 years now and have always > wondered (but never asked - That's the "dumb" part) how Gentoo manages > to update a package that happens to be running at the time. > > Given that the old version (the one running) is deleted, how does it > manage to keep standing if you just cut its legs off? Userspace technically never "deletes" anything in the UNIX model; it either "truncates" it (not what's going on here) or it "unlinks" it. "Unlink" causes the file not to have the filename any more, and the kernel gets rid of files which aren't in use and have no name (of course, nobody can tell when or if this happens, aside from the disk not filling up, because there would be no way to look at the file anyway). If you look at /proc/<PID>/maps for a program you've upgraded, you'll probably find funny notations in there, indicating that the file it's using is not the file that currently has that filename. ("truncate" and otherwise openning the file for writing actually affect the file, not the filename, and would therefore cause programs to crash if you overwrote them.) Technical terms: the file itself is called an "inode", and the name is a "dentry" (actually, the last part of the path, which is all that goes away in a single operation, is the dentry). A dentry stores the inode number of the inode at that path, and "unlink" removes the dentry. What's actually happening in an upgrade is "rename", which, as a single operation, unlinks any dentry with the destination path, links the source inode to the destination dentry, and unlinks the source dentry. This means that no program can see the path empty or with half of a file or see the file with two names. -Daniel *This .sig left intentionally blank* -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 16:23 ` Daniel Barkalow @ 2006-10-11 17:43 ` Michael Sullivan 2006-10-12 7:28 ` Alan McKinnon 2006-10-12 6:17 ` Anthony E. Caudel 1 sibling, 1 reply; 16+ messages in thread From: Michael Sullivan @ 2006-10-11 17:43 UTC (permalink / raw To: gentoo-user On Wed, 2006-10-11 at 12:23 -0400, Daniel Barkalow wrote: > On Tue, 10 Oct 2006, Anthony E. Caudel wrote: > > > I have been using Gentoo for more than 2 years now and have always > > wondered (but never asked - That's the "dumb" part) how Gentoo manages > > to update a package that happens to be running at the time. > > > > Given that the old version (the one running) is deleted, how does it > > manage to keep standing if you just cut its legs off? > > Userspace technically never "deletes" anything in the UNIX model; it > either "truncates" it (not what's going on here) or it "unlinks" it. > "Unlink" causes the file not to have the filename any more, and the kernel > gets rid of files which aren't in use and have no name (of course, nobody > can tell when or if this happens, aside from the disk not filling up, > because there would be no way to look at the file anyway). > > If you look at /proc/<PID>/maps for a program you've upgraded, you'll > probably find funny notations in there, indicating that the file it's > using is not the file that currently has that filename. > > ("truncate" and otherwise openning the file for writing actually affect > the file, not the filename, and would therefore cause programs to crash if > you overwrote them.) > > Technical terms: the file itself is called an "inode", and the name is a > "dentry" (actually, the last part of the path, which is all that goes away > in a single operation, is the dentry). A dentry stores the inode number of > the inode at that path, and "unlink" removes the dentry. What's actually > happening in an upgrade is "rename", which, as a single operation, unlinks > any dentry with the destination path, links the source inode to the > destination dentry, and unlinks the source dentry. This means that no > program can see the path empty or with half of a file or see the file with > two names. > > -Daniel > *This .sig left intentionally blank* Wow, files can exist without file names. I think I found a topic for discussion in philosophy class... -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 17:43 ` Michael Sullivan @ 2006-10-12 7:28 ` Alan McKinnon 0 siblings, 0 replies; 16+ messages in thread From: Alan McKinnon @ 2006-10-12 7:28 UTC (permalink / raw To: gentoo-user On Wednesday 11 October 2006 19:43, Michael Sullivan wrote: > Wow, files can exist without file names. I think I found a topic for > discussion in philosophy class... Nope. A file is an inode and that either eists or doesn't. A filename is just a dentry in a directory, it is not the file itself, it may or may not exist, may or may not actually mean something and is there purely for *your* benefit in userspace. So there's no conflict. alan -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-11 16:23 ` Daniel Barkalow 2006-10-11 17:43 ` Michael Sullivan @ 2006-10-12 6:17 ` Anthony E. Caudel 2006-10-12 6:22 ` Bo Ørsted Andresen 1 sibling, 1 reply; 16+ messages in thread From: Anthony E. Caudel @ 2006-10-12 6:17 UTC (permalink / raw To: gentoo-user Daniel Barkalow wrote: > On Tue, 10 Oct 2006, Anthony E. Caudel wrote: > >> I have been using Gentoo for more than 2 years now and have always >> wondered (but never asked - That's the "dumb" part) how Gentoo manages >> to update a package that happens to be running at the time. >> >> Given that the old version (the one running) is deleted, how does it >> manage to keep standing if you just cut its legs off? > > Userspace technically never "deletes" anything in the UNIX model; it > either "truncates" it (not what's going on here) or it "unlinks" it. > "Unlink" causes the file not to have the filename any more, and the kernel > gets rid of files which aren't in use and have no name (of course, nobody > can tell when or if this happens, aside from the disk not filling up, > because there would be no way to look at the file anyway). > > If you look at /proc/<PID>/maps for a program you've upgraded, you'll > probably find funny notations in there, indicating that the file it's > using is not the file that currently has that filename. > > ("truncate" and otherwise openning the file for writing actually affect > the file, not the filename, and would therefore cause programs to crash if > you overwrote them.) > > Technical terms: the file itself is called an "inode", and the name is a > "dentry" (actually, the last part of the path, which is all that goes away > in a single operation, is the dentry). A dentry stores the inode number of > the inode at that path, and "unlink" removes the dentry. What's actually > happening in an upgrade is "rename", which, as a single operation, unlinks > any dentry with the destination path, links the source inode to the > destination dentry, and unlinks the source dentry. This means that no > program can see the path empty or with half of a file or see the file with > two names. > > -Daniel > *This .sig left intentionally blank* Thanks all. I guess I now understand how it works. Someone noted that if you update sshd for example, a restart would be in order afterward. This would seem to be true of a lot of programs. So would a total restart of the system (just short of a reboot) be warranted? Tony -- Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-12 6:17 ` Anthony E. Caudel @ 2006-10-12 6:22 ` Bo Ørsted Andresen 2006-10-12 6:42 ` PaulNM 0 siblings, 1 reply; 16+ messages in thread From: Bo Ørsted Andresen @ 2006-10-12 6:22 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 513 bytes --] On Thursday 12 October 2006 08:17, Anthony E. Caudel wrote: > Thanks all. I guess I now understand how it works. > > Someone noted that if you update sshd for example, a restart would be in > order afterward. This would seem to be true of a lot of programs. So > would a total restart of the system (just short of a reboot) be warranted? It would of course solve the issue. *Nothing* short of a kernel upgrade requires a reboot though. And I mean that literally. So usually not. -- Bo Andresen [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-12 6:22 ` Bo Ørsted Andresen @ 2006-10-12 6:42 ` PaulNM 2006-10-12 7:30 ` Alan McKinnon 2006-10-12 11:55 ` Boyd Stephen Smith Jr. 0 siblings, 2 replies; 16+ messages in thread From: PaulNM @ 2006-10-12 6:42 UTC (permalink / raw To: gentoo-user Bo Ørsted Andresen wrote: > > It would of course solve the issue. *Nothing* short of a kernel upgrade > requires a reboot though. And I mean that literally. So usually not. > Just being a bit pedantic here, but what about init? Even switching to runlevel 1 would leave it running. Is it possible to tell the kernel to re-run init, and how? PaulNM -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-12 6:42 ` PaulNM @ 2006-10-12 7:30 ` Alan McKinnon 2006-10-12 11:55 ` Boyd Stephen Smith Jr. 1 sibling, 0 replies; 16+ messages in thread From: Alan McKinnon @ 2006-10-12 7:30 UTC (permalink / raw To: gentoo-user On Thursday 12 October 2006 08:42, PaulNM wrote: > Bo Ørsted Andresen wrote: > > It would of course solve the issue. *Nothing* short of a kernel > > upgrade requires a reboot though. And I mean that literally. So > > usually not. > > Just being a bit pedantic here, but what about init? Even switching > to runlevel 1 would leave it running. Is it possible to tell the > kernel to re-run init, and how? I don't believe so - every attempt i've ever made to kill or restart init causes a kernel panic. It's not init doing this - the same effect is achieved by booting with init=/bin/bash and then exiting that bash alan -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [gentoo-user] Dumb question 2006-10-12 6:42 ` PaulNM 2006-10-12 7:30 ` Alan McKinnon @ 2006-10-12 11:55 ` Boyd Stephen Smith Jr. 1 sibling, 0 replies; 16+ messages in thread From: Boyd Stephen Smith Jr. @ 2006-10-12 11:55 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 773 bytes --] On Thursday 12 October 2006 01:42, PaulNM <gentoo@paulscrap.com> wrote about 'Re: [gentoo-user] Dumb question': > Bo Ørsted Andresen wrote: > > It would of course solve the issue. *Nothing* short of a kernel > > upgrade requires a reboot though. And I mean that literally. So > > usually not. > > Just being a bit pedantic here, but what about init? Modern versions of init will watch not only /etc/initab, but also the path they were started from. If that path is pointed to a different file, it will exec() that file in place. -- "If there's one thing we've established over the years, it's that the vast majority of our users don't have the slightest clue what's best for them in terms of package stability." -- Gentoo Developer Ciaran McCreesh [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2006-10-12 11:59 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-10-11 4:21 [gentoo-user] Dumb question Anthony E. Caudel 2006-10-11 4:42 ` Troy Curtis Jr 2006-10-11 6:20 ` Nick Rout 2006-10-11 18:05 ` Thomas T. Veldhouse 2006-10-11 18:29 ` Neil Bothwick 2006-10-11 6:30 ` Anthony E. Caudel 2006-10-11 8:28 ` Neil Bothwick 2006-10-11 7:44 ` Pawel Kraszewski 2006-10-11 16:23 ` Daniel Barkalow 2006-10-11 17:43 ` Michael Sullivan 2006-10-12 7:28 ` Alan McKinnon 2006-10-12 6:17 ` Anthony E. Caudel 2006-10-12 6:22 ` Bo Ørsted Andresen 2006-10-12 6:42 ` PaulNM 2006-10-12 7:30 ` Alan McKinnon 2006-10-12 11:55 ` Boyd Stephen Smith Jr.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox