[MacPorts] #33719: keep machines from sleep during port building
#33719: keep machines from sleep during port building ------------------------------------------+--------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.4 Keywords: | Port: all ------------------------------------------+--------------------------------- Frequently I noticed that my iMac G5 will go to sleep during a time extensive build (gcc45 at the moment). I googled and found some other people with that problem - and an easy solution: {{{ #!/bin/bash pmset noidle & <<<... do the work here ...>>> kill %pmset }}} Wouldnt it be smart to put the "noidle" command at the very beginning of any build script - and the "kill %pmset" at the very ending? I'd like the iMac to do the building - and then go to sleep after it's finished if nothing else is to do. -- Ticket URL: <https://trac.macports.org/ticket/33719> MacPorts <http://www.macports.org/> Ports system for Mac OS
#33719: keep machines from sleep during port building ------------------------------------------+--------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: ports | Version: 2.0.4 Keywords: | Port: ------------------------------------------+--------------------------------- Changes (by cal@…): * cc: cal@… (added) * port: all => * milestone: => MacPorts Future -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#33719: keep machines from sleep during port building ------------------------------------------+--------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 2.0.4 Keywords: | Port: ------------------------------------------+--------------------------------- Changes (by macsforever2000@…): * component: ports => base -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#33719: keep machines from sleep during port building ------------------------------------------+--------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 2.0.4 Keywords: | Port: ------------------------------------------+--------------------------------- Changes (by ryandesign@…): * cc: ryandesign@… (added) Comment: Seems like a good suggestion to me. On the mailing list, some people expressed the opinion that they would want to opt out of this behavior. So we might consider adding a macports.conf option. Other users were worried this would require root / sudo to use, but that does not appear to be the case. -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#33719: keep machines from sleep during port building ------------------------------------------+--------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 2.0.4 Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by raimue@…): At the moment, we have several code paths where this action would be required. Also, there is currently no handling when port fails or is interrupted by the user, so we cannot guarantee that we can restore the old behavior in any case. I don't think adding this to each single build would be enough. When the first port finishes the computer could go to sleep immediately as we kill this pmset noidle process, right? I would recommend to just use this in a custom wrapper around the port command for now. -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#33719: keep machines from sleep during port building ------------------------------------------+--------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 2.0.4 Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by drechsel@…): I don't think that after killing the pmset process the machine will go to sleep immediately. My experience is that it depends on the "energy saving" settings - that means that it normally will wait the number of minutes set and then go to sleep. I'd like an option which makes the machine behave like raimue says: 'shutdown -s now' after the build was finished (successfully or not), so in the case I know I will not attend the building machine all the time, I get the most energy saving possible. Play a sound or something when finished would be another nice option, by the way. If building a port fails, the "kill pmset" command could be executed nevertheless - as an error message is displayed now. -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#33719: keep machines from sleep during port building ------------------------------------------+--------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 2.0.4 Keywords: | Port: ------------------------------------------+--------------------------------- Comment(by ryandesign@…): Replying to [comment:5 drechsel@…]:
I'd like an option which makes the machine behave like raimue says: 'shutdown -s now' after the build was finished (successfully or not), so in the case I know I will not attend the building machine all the time, I get the most energy saving possible.
In the Terminal where the port process is running, type your shutdown command. (I use a sleep command myself.) It will run when the port command is finished. I personally use a shell script that does: {{{ osascript -e 'tell app "System Events" to sleep' & }}} I save this script in my scripts folder as "sleepmac". If you want shutdown instead of sleep, use: {{{ osascript -e 'tell app "System Events" to shut down' & }}} I save this script as "shutdownmac". Or you could use a new terminal and do "[browser:users/ryandesign/scripts/waitport waitport] && shutdownmac".
Play a sound or something when finished would be another nice option, by the way.
I used a shell function (a wrapper around "port") to do this. But MacPorts 1.9.0 largely broke it, since it won't work when you use "sudo", which since MacPorts 1.9.0 you pretty much have to. (I used to have non-root MacPorts installations where that wasn't necessary.) -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#33719: keep machines from sleep during port building --------------------------+-------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 2.0.4 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by bfrancis9898@…): I am not sure that this is a feature that needs to be in the program because power management is generally a system function rather than an application function. If some apps are telling the system to stay awake and others are commanding it to sleep it could get interesting. I use a menu bar app called Caffeine that is free, works well, and will keep my system awake until I click the coffee cup icon. I have a visual cue that the system is in "stay awake" mode and can run builds or do anything else that does not like or benefit from the system going to sleep. -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#33719: keep machines from sleep during port building --------------------------+-------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 2.0.4 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by jpenney@…): I'm not sure when it was added (possibly Mountain Lion?), but there's a command line tool for this scenario in OS X: {{{ $ caffeinate -h usage: caffeinate [-disu] [-t timeout] [command] [arguments] }}} If you pass it a command and arguments, it prevents the system from sleeping until the command exits. I use this all the time with macports: {{{ $ caffeinate sudo port upgrade outdated }}} -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#33719: keep machines from sleep during port building --------------------------+-------------------------------- Reporter: drechsel@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts Future Component: base | Version: 2.0.4 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by ryandesign@…): `caffeinate` appears to have been introduced in OS X 10.8 Mountain Lion, yes. -- Ticket URL: <https://trac.macports.org/ticket/33719#comment:12> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts