Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerging currently running processes and interruptions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
kyptin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2002
Posts: 95
Location: UNC (Chapel Hill, NC, USA)

PostPosted: Sun Sep 15, 2002 7:14 am    Post subject: emerging currently running processes and interruptions Reply with quote

I hope this hasn't been addressed before, but I searched and didn't find it.

I recently read about a PostGreSQL vulnerability, and since I am hosting a website with PHP/PostGreSQL on a Gentoo box, I figured it would be best if I upgraded. However, the machine (lovingly refered to as "The Moldy Crow") is slow: a Pentium 133, and it (as in anything, but especially emerging) takes forever. I made the mistake of starting it when I went home for the weekend via PuTTY + SSH, and now I am paranoid one of my family members will come in and accidentally crash Windows, causing all the past few days of compiling to be for naught. So my (first) question is, will I be able to resume it where it left off if my SSH connection is interrupted for some reason? If I suspend it via ctrl-Z and resume it in the background via bg, can I safely log off and have the emerge continue?

Also, PostGreSQL is currently running (postmaster I think is the name of the service). The way I understand it, emerge postgresql won't interrupt the service, so that my website's uptime can be maintained. However, when I emerge clean, would it be a good idea to stop the postmaster service and any others associated with PostGreSQL, or does it matter? I thought I remembered reading somewhere that you shouldn't emerge KDE and run it at the same time...is this a good idea in general, or specifically for KDE (or do I just falsely remember that)?

Oh, one more thing. I have heard mention of the "binary" option for emerge (-b). Are binaries available for all types of processor architectures? The Pentium 133 is, of course, an i586. The binary option doesn't seem to be mentioned very much in the documentation. I think I could avert future potential disasters such as this one if emerge could happen within a few minutes, as opposed to days. (Incidentally, installing Gentoo 1.2 from stage 1 on the Moldy Crow took over a month.)

Thanks for the help!
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Sun Sep 15, 2002 2:04 pm    Post subject: Reply with quote

Regarding the first question. If someone kills the ssh session, the current emerge will be borked. ssh will 'wait' for the process to terminate if you try to do a ^Z and logout unless the process was started with stdin/out/err redirected. You can also use "screen" on your remote box for future sessions that will allow you to do all kinds of nifty things with suspending and continuing sessions. This thread has some pointers. This thread has a script that will allow you to minimize downtime for essential services across an emerge.

-b is to build the binary package in addition to emerging. You can use the binary on other boxes to emerge packages without rebuilding from source. However, you need to get the binaries built for your platform in the first place.
Back to top
View user's profile Send private message
kyptin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2002
Posts: 95
Location: UNC (Chapel Hill, NC, USA)

PostPosted: Sun Sep 15, 2002 5:08 pm    Post subject: thanks Reply with quote

Wow, thanks, that pretty much answered all my questions. And that softmerge script...I might hafta start using that. I wonder if it's in the Gentoolkit.... (Gentoo Forums OWN! :o ) Thanks again.
Back to top
View user's profile Send private message
gir
n00b
n00b


Joined: 02 Sep 2002
Posts: 37

PostPosted: Sun Sep 15, 2002 6:08 pm    Post subject: Reply with quote

Coincidentally I just started a 'emerge -e world' last night and over a bowl of cereal this morning it hit me that I'm going to have to install over running applications and loaded libraries (glibc, my slew of daemons, etc...) which might or might not work. While the script linked to in the post above works if emerging a daemon or service there is still no way to automate that for a 'emerge -e world' or 'emerge -u world' is there?

I guess I also want to broaden the scope of this thread and ask what happens during an 'emerge -e world' when applications are already resident in memory and running? I can't imagine that emerge is able to replace the binary or .a or .so while the system is using it. My knowledge of linux's application init code is currently nonexistent so I guess that if linux loaded all of the apps binary (and required libs) into memory on init then emerge would be fine... just reboot and all applications will be up to date. However, if things like shared libs get loaded dynamically (which I think they do) then emerge could really munge things up with an 'emerge -e world'.

Somebody care to refute and clarify my presupposed problems with 'emerge -e world'? (Please refute... I'm in the middle of an whole tree rebuild! :wink:) If I am correct in my assumptions, what is the prescribed method of rebuilding one's system. I can't think of any method of upgrading that wouldn't require *some* part of my system to be loaded.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Sep 15, 2002 9:16 pm    Post subject: Reply with quote

gir wrote:
I can't imagine that emerge is able to replace the binary or .a or .so while the system is using it.

It can. It saves the file and unlinks the existing version. The existing file, even though unlinked, if currently opened by a running process, does not really go away until that process quits. This tactic is often used to create secure temporary files, that other processes can't read. Running applications will not see the newly installed shared library until they are restarted.

There are some complications with things like GNOME (and maybe KDE) where there are processes that are spawned all the time without direct user intervention - sometimes they can get launched with a version of a shared library they are incompatible with and get temporarily messed up, but in general, upgrading running applications is not a problem in UNIX.

Quote:
just reboot and all applications will be up to date.

Unless you have changed the kernel or upgraded sysvinit, you shouldn't even have to reboot - just restart the upgraded processes.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
gir
n00b
n00b


Joined: 02 Sep 2002
Posts: 37

PostPosted: Sun Sep 15, 2002 11:12 pm    Post subject: Reply with quote

Quote:
It can. It saves the file and unlinks the existing version. The existing file, even though unlinked, if currently opened by a running process, does not really go away until that process quits.


Ah, yes... I forgot completely about the behaivor of file descriptors and unlinking. God, I love unix based operating systems! :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum