FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 12-11-2009, 10:02 AM
Helmut Jarausch
 
Default What magic does portage use?

On 11 Dec, Alan McKinnon wrote:
> On Friday 11 December 2009 11:11:41 Helmut Jarausch wrote:
>> Hi,
>>
>> I'm curious how portage solves its most difficult part (in my eyes).
>>
>> When installing a dynamic library (by "hand") I have often got an
>> error messages if the corresponding library is currently in use.
>>
>> How does portage succeed anyway.
>> (I have the suspicion that it does not succeed always, since sometimes
>> only rebooting solves some very strange problems)
>>
>> How to replace fundamental X11-libaries on a system running X11
>> or even more suprising, how can I replace a running glibc ?
>>
>> Many thanks for enlightening me,
>> Helmut.
>>
>
> Portage does nothing special, as dealing with this is a Unix thing.
>
> On Unix, the inode is the file, not the directory entry. If you want to
> replace an open file, the system simply does it and updates the dentry to
> point to a new inode. Any spp using the old file will continue to use it as it
> still has a handle to the inode. The inode is only fully deleted when the last
> app using it closes it
>
> If you update a library to a new version with an API break, the lib should get
> a new soname so the file is a different name, hence no collision (symlinks to
> libraries excepted).
>
> This is how it should work, any code that tries to do it a different way is by
> definition broken, that's why portage needs take no special measures.
>
> All of this is in complete contrast to other broken systems, such as Windows
> for example. On Windows, the filename IS the file, so upgrades are horrible.
> Installers must put the file somewhere else and have the final steps and
> registry updates done at next reboot before anything has a chance to open
> libs. This is why fairly deep updates on Windows often require multiple reboot
> - multiple apps installed multiple libs to be fiddled with multiple times ....
>

Many thanks Alan,

so I conclude that rebooting IS necessary to get the new libraries used,
isn't it?
On the other hand running applications should continue to run, which is
not always the case, e.g. recently using cvs as non-root user just
hanged. Rebooting the system solved it (since I update my system nearly
each day).

Thanks again Alan,
Helmut.


--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
Old 12-11-2009, 10:25 AM
Alan McKinnon
 
Default What magic does portage use?

On Friday 11 December 2009 13:02:36 Helmut Jarausch wrote:
> Many thanks Alan,
>
> so I conclude that rebooting IS necessary to get the new libraries used,
> isn't it?

No, not at all, you conclude wrongly.

Unix works the way it does precisely so you *don't* require a reboot to use
new libraries. They are already there and fully installed and fully
operational. You just have to start using them - this may require restarting
the relevant app that uses them and perhaps ldconfig.

Windows is the brain-dead johnnie-come-lately here that requires reboots. But
then again, Windows requires a reboot when it detects the pointer has moved so
that isn't surprising

> On the other hand running applications should continue to run, which is
> not always the case, e.g. recently using cvs as non-root user just
> hanged. Rebooting the system solved it (since I update my system nearly
> each day).

It was probably trying to use different versions of two matched libs. You
should not have needed a reboot to fix that.


--
alan dot mckinnon at gmail dot com
 
Old 12-11-2009, 12:16 PM
Dale
 
Default What magic does portage use?

Helmut Jarausch wrote:

On 11 Dec, Alan McKinnon wrote:


On Friday 11 December 2009 11:11:41 Helmut Jarausch wrote:


Hi,

I'm curious how portage solves its most difficult part (in my eyes).

When installing a dynamic library (by "hand") I have often got an
error messages if the corresponding library is currently in use.

How does portage succeed anyway.
(I have the suspicion that it does not succeed always, since sometimes
only rebooting solves some very strange problems)

How to replace fundamental X11-libaries on a system running X11
or even more suprising, how can I replace a running glibc ?

Many thanks for enlightening me,
Helmut.



Portage does nothing special, as dealing with this is a Unix thing.

On Unix, the inode is the file, not the directory entry. If you want to
replace an open file, the system simply does it and updates the dentry to
point to a new inode. Any spp using the old file will continue to use it as it
still has a handle to the inode. The inode is only fully deleted when the last
app using it closes it


If you update a library to a new version with an API break, the lib should get
a new soname so the file is a different name, hence no collision (symlinks to
libraries excepted).


This is how it should work, any code that tries to do it a different way is by
definition broken, that's why portage needs take no special measures.


All of this is in complete contrast to other broken systems, such as Windows
for example. On Windows, the filename IS the file, so upgrades are horrible.
Installers must put the file somewhere else and have the final steps and
registry updates done at next reboot before anything has a chance to open
libs. This is why fairly deep updates on Windows often require multiple reboot
- multiple apps installed multiple libs to be fiddled with multiple times ....





Many thanks Alan,

so I conclude that rebooting IS necessary to get the new libraries used,
isn't it?
On the other hand running applications should continue to run, which is
not always the case, e.g. recently using cvs as non-root user just
hanged. Rebooting the system solved it (since I update my system nearly
each day).

Thanks again Alan,
Helmut.



I'll add two cents here. Let's say I upgrade Seamonkey which is my web
browser / email program. I sync and notice there is a update to
Seamonkey available and I let emerge update it. When the install is
complete, I don't have to reboot or even log out of KDE. All I have to
do is close Seamonkey and start it again. It will then load the new
updated version and run it.


The same could be said for a service like cups. If you update cups, all
you have to do is restart the service. It will stop the old service
then load up the new service that was just installed. Just a simple
"/etc/init.d/cupsd restart" will work just fine.

If you upgrade something kde, say kdelibs or some other kde base
package, then all you need to do is log out of KDE and log back in
again. Sort of the same with updating xorg, logout, go to a console and
restart xdm or whatever you use to start X. I usually use the ctrl alt
backspace key but restarting the service is better, or so some have said
anyway.

Rebooting will also do all of this but it is not needed. From a
technical stand point, the only time you must reboot is to load a new
kernel.


Hope that helps a little.

Dale

:-) :-)
 
Old 12-11-2009, 12:33 PM
Daniel Troeder
 
Default What magic does portage use?

On Fri, 2009-12-11 at 07:16 -0600, Dale wrote:
> Helmut Jarausch wrote:
> > On 11 Dec, Alan McKinnon wrote:
> >
> >> On Friday 11 December 2009 11:11:41 Helmut Jarausch wrote:
> >>
> >>> Hi,
> >>>
> >>> I'm curious how portage solves its most difficult part (in my eyes).
> >>>
> >>> When installing a dynamic library (by "hand") I have often got an
> >>> error messages if the corresponding library is currently in use.
> >>>
> >>> How does portage succeed anyway.
> >>> (I have the suspicion that it does not succeed always, since sometimes
> >>> only rebooting solves some very strange problems)
> >>>
> >>> How to replace fundamental X11-libaries on a system running X11
> >>> or even more suprising, how can I replace a running glibc ?
> >>>
> >>> Many thanks for enlightening me,
> >>> Helmut.
> >>>
> >>>
> >> Portage does nothing special, as dealing with this is a Unix thing.
> >>
> >> On Unix, the inode is the file, not the directory entry. If you want to
> >> replace an open file, the system simply does it and updates the dentry to
> >> point to a new inode. Any spp using the old file will continue to use it as it
> >> still has a handle to the inode. The inode is only fully deleted when the last
> >> app using it closes it
> >>
> >> If you update a library to a new version with an API break, the lib should get
> >> a new soname so the file is a different name, hence no collision (symlinks to
> >> libraries excepted).
> >>
> >> This is how it should work, any code that tries to do it a different way is by
> >> definition broken, that's why portage needs take no special measures.
> >>
> >> All of this is in complete contrast to other broken systems, such as Windows
> >> for example. On Windows, the filename IS the file, so upgrades are horrible.
> >> Installers must put the file somewhere else and have the final steps and
> >> registry updates done at next reboot before anything has a chance to open
> >> libs. This is why fairly deep updates on Windows often require multiple reboot
> >> - multiple apps installed multiple libs to be fiddled with multiple times ....
> >>
> >>
> >
> > Many thanks Alan,
> >
> > so I conclude that rebooting IS necessary to get the new libraries used,
> > isn't it?
> > On the other hand running applications should continue to run, which is
> > not always the case, e.g. recently using cvs as non-root user just
> > hanged. Rebooting the system solved it (since I update my system nearly
> > each day).
> >
> > Thanks again Alan,
> > Helmut.
> >
>
> I'll add two cents here. Let's say I upgrade Seamonkey which is my web
> browser / email program. I sync and notice there is a update to
> Seamonkey available and I let emerge update it. When the install is
> complete, I don't have to reboot or even log out of KDE. All I have to
> do is close Seamonkey and start it again. It will then load the new
> updated version and run it.
>
> The same could be said for a service like cups. If you update cups, all
> you have to do is restart the service. It will stop the old service
> then load up the new service that was just installed. Just a simple
> "/etc/init.d/cupsd restart" will work just fine.
>
> If you upgrade something kde, say kdelibs or some other kde base
> package, then all you need to do is log out of KDE and log back in
> again. Sort of the same with updating xorg, logout, go to a console and
> restart xdm or whatever you use to start X. I usually use the ctrl alt
> backspace key but restarting the service is better, or so some have said
> anyway.
>
> Rebooting will also do all of this but it is not needed. From a
> technical stand point, the only time you must reboot is to load a new
> kernel.
>
> Hope that helps a little.
>
> Dale
>
> :-) :-)

I absolutely concur with Alan and Dale, I just want to warn a bit about
complex X11-environments like gnome or kde. If you logout and login
again, it is NOT secure, that all gnome/kde/qt apps have been closed.
There are services (gconf, kded, pulse, etc) that take a time to quit,
or sometimes just don't

Then, when an app was linked against a symlink, and that left-over-app
too, the dynamic loader may not load a newly installed library, but
reuses the one in memory (from the left-over-app). [1]

It's still valid, that no reboot is needed, but you sure can be
unlucky

Bye,
Daniel


[1] don't take this info for granted, I'm no expert in this - just what
I understood from reading...


--
PGP key @ http://pgpkeys.pca.dfn.de/pks/lookup?search=0xBB9D4887&op=get
# gpg --recv-keys --keyserver hkp://subkeys.pgp.net 0xBB9D4887
 
Old 12-11-2009, 12:33 PM
MickaŽl Bucas
 
Default What magic does portage use?

2009/12/11 Alan McKinnon <alan.mckinnon@gmail.com>:
> On Friday 11 December 2009 13:02:36 Helmut Jarausch wrote:
>> Many thanks Alan,
>>
>> so I conclude that rebooting IS necessary to get the new libraries used,
>> isn't it?
>
> No, not at all, you conclude wrongly.
>
> Unix works the way it does precisely so you *don't* require a reboot to use
> new libraries. They are already there and fully installed and fully
> operational. You just have to start using them - this may require restarting
> the relevant app that uses them and perhaps ldconfig.
>

To find out which files have been replaced, you can use the following command :
lsof | grep DEL
This will give you all files that have been deleted since they have
been loaded by the process.
From the process name, you can deduce the service and restart it.
I've never needed a reboot for this kind of problem.
You may have to switch to run level 1 to restart some important
services like udev.

> Windows is the brain-dead johnnie-come-lately here that requires reboots. But
> then again, Windows requires a reboot when it detects the pointer has moved so
> that isn't surprising
>
>> On the other hand running applications should continue to run, which is
>> not always the case, e.g. recently using cvs as non-root user just
>> hanged. Rebooting the system solved it (since I update my system nearly
>> each day).
>
> It was probably trying to use different versions of two matched libs. You
> should not have needed a reboot to fix that.
>
>
> --
> alan dot mckinnon at gmail dot com
>
>


MickaŽl Bucas
 
Old 12-11-2009, 12:41 PM
Alan McKinnon
 
Default What magic does portage use?

On Friday 11 December 2009 15:16:01 Dale wrote:
> Rebooting will also do all of this but it is not needed. From a
> technical stand point, the only time you must reboot is to load a new
> kernel.
>

And these days, not even then :-)

[it requires some voodoo but is certainly possible]

[[and I don't mean build and install a new kernel, I really do mean loa ti
into memory and run it, dispensing with the old one]]

--
alan dot mckinnon at gmail dot com
 
Old 12-11-2009, 01:38 PM
Dale
 
Default What magic does portage use?

MickaŽl Bucas wrote:

2009/12/11 Alan McKinnon <alan.mckinnon@gmail.com>:


On Friday 11 December 2009 13:02:36 Helmut Jarausch wrote:


Many thanks Alan,

so I conclude that rebooting IS necessary to get the new libraries used,
isn't it?


No, not at all, you conclude wrongly.

Unix works the way it does precisely so you *don't* require a reboot to use
new libraries. They are already there and fully installed and fully
operational. You just have to start using them - this may require restarting
the relevant app that uses them and perhaps ldconfig.




To find out which files have been replaced, you can use the following command :
lsof | grep DEL
This will give you all files that have been deleted since they have
been loaded by the process.
>From the process name, you can deduce the service and restart it.
I've never needed a reboot for this kind of problem.
You may have to switch to run level 1 to restart some important
services like udev.


MickaŽl Bucas



Actually, you can kill udev and restart it. Kill the process and then
run "/sbin/udevd --daemon" and it will be started again.


Dale

:-) :-)
 
Old 12-11-2009, 01:43 PM
Dale
 
Default What magic does portage use?

Daniel Troeder wrote:

On Fri, 2009-12-11 at 07:16 -0600, Dale wrote:


Helmut Jarausch wrote:


On 11 Dec, Alan McKinnon wrote:



On Friday 11 December 2009 11:11:41 Helmut Jarausch wrote:



Hi,

I'm curious how portage solves its most difficult part (in my eyes).

When installing a dynamic library (by "hand") I have often got an
error messages if the corresponding library is currently in use.

How does portage succeed anyway.
(I have the suspicion that it does not succeed always, since sometimes
only rebooting solves some very strange problems)

How to replace fundamental X11-libaries on a system running X11
or even more suprising, how can I replace a running glibc ?

Many thanks for enlightening me,
Helmut.




Portage does nothing special, as dealing with this is a Unix thing.

On Unix, the inode is the file, not the directory entry. If you want to
replace an open file, the system simply does it and updates the dentry to
point to a new inode. Any spp using the old file will continue to use it as it
still has a handle to the inode. The inode is only fully deleted when the last
app using it closes it


If you update a library to a new version with an API break, the lib should get
a new soname so the file is a different name, hence no collision (symlinks to
libraries excepted).


This is how it should work, any code that tries to do it a different way is by
definition broken, that's why portage needs take no special measures.


All of this is in complete contrast to other broken systems, such as Windows
for example. On Windows, the filename IS the file, so upgrades are horrible.
Installers must put the file somewhere else and have the final steps and
registry updates done at next reboot before anything has a chance to open
libs. This is why fairly deep updates on Windows often require multiple reboot
- multiple apps installed multiple libs to be fiddled with multiple times ....





Many thanks Alan,

so I conclude that rebooting IS necessary to get the new libraries used,
isn't it?
On the other hand running applications should continue to run, which is
not always the case, e.g. recently using cvs as non-root user just
hanged. Rebooting the system solved it (since I update my system nearly
each day).

Thanks again Alan,
Helmut.


I'll add two cents here. Let's say I upgrade Seamonkey which is my web
browser / email program. I sync and notice there is a update to
Seamonkey available and I let emerge update it. When the install is
complete, I don't have to reboot or even log out of KDE. All I have to
do is close Seamonkey and start it again. It will then load the new
updated version and run it.


The same could be said for a service like cups. If you update cups, all
you have to do is restart the service. It will stop the old service
then load up the new service that was just installed. Just a simple
"/etc/init.d/cupsd restart" will work just fine.

If you upgrade something kde, say kdelibs or some other kde base
package, then all you need to do is log out of KDE and log back in
again. Sort of the same with updating xorg, logout, go to a console and
restart xdm or whatever you use to start X. I usually use the ctrl alt
backspace key but restarting the service is better, or so some have said
anyway.

Rebooting will also do all of this but it is not needed. From a
technical stand point, the only time you must reboot is to load a new
kernel.


Hope that helps a little.

Dale

:-) :-)



I absolutely concur with Alan and Dale, I just want to warn a bit about
complex X11-environments like gnome or kde. If you logout and login
again, it is NOT secure, that all gnome/kde/qt apps have been closed.
There are services (gconf, kded, pulse, etc) that take a time to quit,
or sometimes just don't

Then, when an app was linked against a symlink, and that left-over-app
too, the dynamic loader may not load a newly installed library, but
reuses the one in memory (from the left-over-app). [1]

It's still valid, that no reboot is needed, but you sure can be
unlucky

Bye,
Daniel


[1] don't take this info for granted, I'm no expert in this - just what
I understood from reading...




This can be true. I have ran into this a couple times. I sometimes go
to single user, rc single, and when I look at the running processes,
they are still some X or KDE processes running.

If I understand how this works tho, any new things will start with the
new files and not the old ones. For example, you have Konqueror open
and running and it is updated. If you open a new one from the menu, it
should load the new files. A lot of this would depend on how it forks I
guess. I think Seamonkey for example would just fork from the original
process and would use the old files or maybe give a error message. I
know it looks for a already running process when it starts.


I guess some of this depends on how the program is started.

Dale

:-) :-)
 
Old 12-11-2009, 01:50 PM
Volker Armin Hemmann
 
Default What magic does portage use?

On Freitag 11 Dezember 2009, Daniel Troeder wrote:
> On Fri, 2009-12-11 at 07:16 -0600, Dale wrote:
> > Helmut Jarausch wrote:
> > > On 11 Dec, Alan McKinnon wrote:
> > >> On Friday 11 December 2009 11:11:41 Helmut Jarausch wrote:
> > >>> Hi,
> > >>>
> > >>> I'm curious how portage solves its most difficult part (in my eyes).
> > >>>
> > >>> When installing a dynamic library (by "hand") I have often got an
> > >>> error messages if the corresponding library is currently in use.
> > >>>
> > >>> How does portage succeed anyway.
> > >>> (I have the suspicion that it does not succeed always, since
> > >>> sometimes only rebooting solves some very strange problems)
> > >>>
> > >>> How to replace fundamental X11-libaries on a system running X11
> > >>> or even more suprising, how can I replace a running glibc ?
> > >>>
> > >>> Many thanks for enlightening me,
> > >>> Helmut.
> > >>
> > >> Portage does nothing special, as dealing with this is a Unix thing.
> > >>
> > >> On Unix, the inode is the file, not the directory entry. If you want
> > >> to replace an open file, the system simply does it and updates the
> > >> dentry to point to a new inode. Any spp using the old file will
> > >> continue to use it as it still has a handle to the inode. The inode is
> > >> only fully deleted when the last app using it closes it
> > >>
> > >> If you update a library to a new version with an API break, the lib
> > >> should get a new soname so the file is a different name, hence no
> > >> collision (symlinks to libraries excepted).
> > >>
> > >> This is how it should work, any code that tries to do it a different
> > >> way is by definition broken, that's why portage needs take no special
> > >> measures.
> > >>
> > >> All of this is in complete contrast to other broken systems, such as
> > >> Windows for example. On Windows, the filename IS the file, so upgrades
> > >> are horrible. Installers must put the file somewhere else and have the
> > >> final steps and registry updates done at next reboot before anything
> > >> has a chance to open libs. This is why fairly deep updates on Windows
> > >> often require multiple reboot - multiple apps installed multiple libs
> > >> to be fiddled with multiple times ....
> > >
> > > Many thanks Alan,
> > >
> > > so I conclude that rebooting IS necessary to get the new libraries
> > > used, isn't it?
> > > On the other hand running applications should continue to run, which is
> > > not always the case, e.g. recently using cvs as non-root user just
> > > hanged. Rebooting the system solved it (since I update my system nearly
> > > each day).
> > >
> > > Thanks again Alan,
> > > Helmut.
> >
> > I'll add two cents here. Let's say I upgrade Seamonkey which is my web
> > browser / email program. I sync and notice there is a update to
> > Seamonkey available and I let emerge update it. When the install is
> > complete, I don't have to reboot or even log out of KDE. All I have to
> > do is close Seamonkey and start it again. It will then load the new
> > updated version and run it.
> >
> > The same could be said for a service like cups. If you update cups, all
> > you have to do is restart the service. It will stop the old service
> > then load up the new service that was just installed. Just a simple
> > "/etc/init.d/cupsd restart" will work just fine.
> >
> > If you upgrade something kde, say kdelibs or some other kde base
> > package, then all you need to do is log out of KDE and log back in
> > again. Sort of the same with updating xorg, logout, go to a console and
> > restart xdm or whatever you use to start X. I usually use the ctrl alt
> > backspace key but restarting the service is better, or so some have said
> > anyway.
> >
> > Rebooting will also do all of this but it is not needed. From a
> > technical stand point, the only time you must reboot is to load a new
> > kernel.
> >
> > Hope that helps a little.
> >
> > Dale
> >
> > :-) :-)
>
> I absolutely concur with Alan and Dale, I just want to warn a bit about
> complex X11-environments like gnome or kde. If you logout and login
> again, it is NOT secure, that all gnome/kde/qt apps have been closed.
> There are services (gconf, kded, pulse, etc) that take a time to quit,
> or sometimes just don't
>
> Then, when an app was linked against a symlink, and that left-over-app
> too, the dynamic loader may not load a newly installed library, but
> reuses the one in memory (from the left-over-app). [1]
>
> It's still valid, that no reboot is needed, but you sure can be
> unlucky
>
> Bye,
> Daniel
>
>
> [1] don't take this info for granted, I'm no expert in this - just what
> I understood from reading...
>

/etc/init.d/xdm stop
killall -9 X
/etc/init.d/xdm zap
/etc/init.d/xdm start
 
Old 12-11-2009, 02:07 PM
Dale
 
Default What magic does portage use?

Alan McKinnon wrote:

On Friday 11 December 2009 15:16:01 Dale wrote:

Rebooting will also do all of this but it is not needed. From a
technical stand point, the only time you must reboot is to load a new
kernel.




And these days, not even then :-)

[it requires some voodoo but is certainly possible]

[[and I don't mean build and install a new kernel, I really do mean loa ti
into memory and run it, dispensing with the old one]]





I have read about that but never read something from someone who has
actually done it. I have always been curious as to how that would work,
in reality not just theory.


I have also wondered why a person would go to all that trouble.
Wouldn't all the services have to be restarted anyway?


Dale

:-) :-)
 

Thread Tools




All times are GMT. The time now is 11:01 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org