Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 338447 - emerge should be able to inhibit automatic sleep while it is running
Summary: emerge should be able to inhibit automatic sleep while it is running
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-23 14:08 UTC by Mehmet Giritli
Modified: 2023-05-23 03:46 UTC (History)
0 users

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 Mehmet Giritli 2010-09-23 14:08:29 UTC
Quite often when I let my computer update the world with emerge, I forgot to manually disable gnome sleep function and so, the computer sleeps in the middle of emerge. As far as I know, using dbus emerge should be able to inhibit automatic sleep and I think this is an important feature that portage currently lacks. 

Reproducible: Always
Comment 1 Fabian Groffen gentoo-dev 2010-09-23 15:01:12 UTC
why doesn't the sleep work for you at the moment?
Comment 2 Mehmet Giritli 2010-09-23 19:02:31 UTC
(In reply to comment #1)
> why doesn't the sleep work for you at the moment?
> 

I am sorry if I wasn't clear.

The problem is that the computer would sleep in the midst of an emerge process, if you have the gnome-power-manager set to sleep after a while of inactivity. And it doesn't consider a running emerge process as an activity. Thus, there is always a possibility that the computer will sleep in the middle of a running emerge process.

I am proposing the emerge process to be able to use dbus to send a message to inhibit the automatic sleep.

I hope this explains it better?
Comment 3 Zac Medico gentoo-dev 2010-09-24 02:55:38 UTC
This is one of the many things that could be done by the user by using a wrapper script that does stuff before and after emerge. Something like this:

$ cat /usr/local/bin/emerge
#!/bin/bash

# do stuff before emerge here

/usr/bin/emerge "$@"

# do stuff after emerge here


So that the user doesn't have to use a wrapper script like the above, we can either add general-purpose hooks for users to do things like this (we already have support for a general-purpose --sync hook at /etc/portage/bin/post_sync), or else we can add variables similar to PORTAGE_IONICE_COMMAND that the user would have to set. For example, PORTAGE_SLEEP_INHIBIT_COMMAND and PORTAGE_SLEEP_ENABLE_COMMAND should work.