Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16592 - wishlist! portage suspend, resume jobs
Summary: wishlist! portage suspend, resume jobs
Status: RESOLVED CANTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-28 18:07 UTC by dan
Modified: 2011-10-30 22:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dan 2003-02-28 18:07:08 UTC
Portage lacks a feature to suspend what it's doing, then resume later. 
It can take hours and hours to compile certain packages like kde or xfree. Sometimes I've 
invested more than an hour in compiling a package, when I decide to use my computer for 
other tasks. I have to stop portage because the system is not responsive enough with 
compiling going on even at nice 19. 
Then when i later resume the work, portage has to start everything over from the beginning, 
loosing invaluable hours of cpu time. 
 
It would be nice to be able to tell portage to put everything on hold, use no cpu resources, and 
later resume from where the job was suspended. 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Tyler Nielsen 2003-09-22 14:52:48 UTC
You should already have the ability to do this.  It's not in portage but built into bash (and other shells I'm sure).  It's called Job Control.  Type:
man bash
/JOB CONTROL
(to search for job control in the man page)

A simple summary:
Start your program ('emerge -uD world' for example)
When you need to suspend (pause) hit 'ctrl-z'.
  You should get something like "[1]+  Stopped                 emerge -uD world"
  and a prompt.  Use computer as needed.
When you want to resume run the command 'fg'
Comment 2 Shan Destromp 2004-05-23 09:43:27 UTC
I agree with Tyler, theres no need to spend time reinventing the wheel as it were.  In addtion to the CTRL-Z option, should you CTRL-C (or KILL) the emerge process, you can still use emerge --resume to start re-merging at the last package it was working on (only works if you haven't run another emerge command between them)
Comment 3 Kent Martin 2005-01-05 20:44:41 UTC
Neither of the above comments solve the problem the original bug mentions in all cases.

The job control solution won't survive a reboot.

The emerge --resume won't preserve all the CPU time already invested in emerging a package.

What would be nice is to be able to send emerge a signal (say USR1) which causes it to send HUPs/KILLs to compiles, or, cleanly finish patching/merging/whatever it is doing that you *don't* want to stop in the middle of, then die.  It could also potentially write some tracking information to a file to be used when the resume begins (ie, unpack completed, patch completed, partway through compile).

emerge --resume could then pick up that unpack, patch are completed, and simply kick off make again.
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-02-28 18:20:02 UTC
I can't see any reasonable way to do this generically. Simply restarting src_compile is not an option. Adding a src_resume is not enough either - some sort of src_pause would be necessary. Although, that's not really doable either because src_compile is already doing its thing. Signal handling from within ebuilds? I don't think so. The only other way I can think of would be to write a virtual machine for compiling in. Not really doable either...