allow to set restart/resume time in shutdown dialog
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Shutdown Timer Extension for GNOME shell |
Undecided
|
Unassigned | ||
| consolekit (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
The desktop environments would help saving energy, if their shutdown dialogs could by default provide the option (button/checkbox) to schedule a restart.
Linux provides a simple way to schedule a restart event that is particularly usefull in conjuction with initiating or scheduling a shutdown or suspend.
rtcwake -m no -s <seconds-
Howerever, just as the shutdown command it requires root privileges. Thus the need for a similar consolekit support.
The particular command given in the example above avoids that rtcwake does any switching into another power state (no new mode "-m no").
This allows that all power state switching is still contolled by whatever power management (userspace) tools are installed, which may often be more stable than the pure kernel/rtcwake method, especially on resume.
To test it, just schedule a wake event like above as root, then do a regular shutdown/suspend. Wait, and watch how the real time clock triggers the scheduled power up event and the machine comes back up.
hakaishi (hakaishi) wrote : | #1 |
Thanks for the hint!
Actually, doesn't triggering a shuting down also require root privileges? What framework/
description: | updated |
hakaishi (hakaishi) wrote : | #3 |
That's right. "shutdown" and "reboot" etc. need root privileges.
But there ist also a complicated way to do this via dbus-send. With this also the user can suspend/
For a direct shutdown (without prompt) there is only one way that I know of: "dbus-send --print-reply --system --dest=
Previously there was also a way to "correctly" shutdown the system (not that it is a unclean shutdown, but the session can not be saved before shutdown, even if one has set "Save Session") via org.gnome.
With introspect one can see all the aviable methods etc. for the interface. (e.g. "dbus-send --print-reply --system --dest=
And I haven't noticed something about a wake-up method/option... :'(
Thank you for the pointer to ConsoleKit.
Do I understand it correctly, there is no way to initiate a shutdown in gnome that saves the session, without using the gnome-session buttons?
(I have been disapointed by gnome folks dumbing down functionality in other areas already,
they are not just providing easy options plus expert settings, but really removing options,
maybe it is time I remove gnome.)
description: | updated |
description: | updated |
hakaishi (hakaishi) wrote : | #5 |
Jep, that's how it seems to be...
But you just gave me a nice idea! I'll research how gnome saves the session and put the command just before the execution of dbus-send ... that means if the command can be executed by the user. (Of course with an option to aktivate/deaktivate this)
You are right. I'm also quite dissapointed in how gnome does things...
... Well it's still better than Unity >_>"
Launchpad Janitor (janitor) wrote : | #6 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in consolekit (Ubuntu): | |
status: | New → Confirmed |
hakaishi (hakaishi) wrote : | #7 |
Woooha! I'm really amazed! => http://
I guess they won't make the feature aviable by default for the next coming releases as well...
hakaishi (hakaishi) wrote : | #8 |
*available
Jacopo Lorenzetti (jacopol) wrote : | #9 |
GNOME Session Shutdown can trigger a shutdown from user space via dbus. Its syntax is similar to that of the 'shutdown' command (e.g. 'gnome-
I wrote it because I needed to programmatically shut down the system in a clean fashion (instead of just terminating the GNOME Display Manager like the 'shutdown' command does) and I couldn't find a way to do it.
I don't know about start events, sorry.
Changed in gnome-session-shutdown: | |
status: | New → Invalid |
hakaishi (hakaishi) wrote : | #10 |
Does your shutdown() funktion shutdown without showing the shutdown dialog? - If so, could you please tell me where the imported file imports.
Jacopo Lorenzetti (jacopol) wrote : | #11 |
It does show the shutdown dialog for 60 seconds (that is your last chance to cancel the shutdown) and then it shuts the system down.
hakaishi (hakaishi) wrote : | #12 |
I knew it... >_>"
There is still the bug that the methods of the gnome.SessionMa
Hi jacopoL, you set this to invalid, because you don't know about start events?
Jacopo Lorenzetti (jacopol) wrote : | #14 |
I'm not sure about the older versions, but on my Ubuntu 12.04 they don't do the same: Shutdown shows the dialog with a 60-seconds countdown and RequestShutdown doesn't show any dialog.
GNOME Session Shutdown calls the first method because I liked the idea to have one last chance to cancel the shutdown… maybe I could add an option to let the user choose.
Jacopo Lorenzetti (jacopol) wrote : | #15 |
ceg: I set it to invalid because GNOME Session Shutdown is something like a GNOME high-level equivalent of the 'shutdown' command, and I think that you are looking for some different kind of multipurpose tool… or maybe something to call just before gnome-session-
hakaishi (hakaishi) wrote : | #16 |
jacopoL: Just a second. Did you acually test that? For me both RequestShutdown and Shutdown call the shutdown dialog on Ubuntu 12.04, using gnome-shell. I tested it on my Computer and on my Netbook. Did you by chance add any parameters or something?
I don't know how all the desktop parts work together. However, it is a waste of resources to let your computer run only because for example you need to access it remotely in a couple of hours/days/month, or have it do some task. And I see many user that keep their machines running, just because they do not see a way to schedule it.
The desktop environments would help saving energy, if their shutdown dialogs could by default provide the option (button/checkbox) to schedule a restart.
description: | updated |
hakaishi (hakaishi) wrote : | #18 |
OKAY! Now I know a way to make qshutdown execute multiple commands (using &&). In the coming new version this will be possible. Then you can just put sudo or gksudo or what ever before the command and that's it. If you want that there is no prompt for a password, just add the command to the sudoers disabling the Password. ;)
Jacopo Lorenzetti (jacopol) wrote : | #19 |
hakaishi: I actually tested that in python by connecting to the dbus session bus and calling the two methods (without parameters) on the org.gnome.
hakaishi (hakaishi) wrote : | #20 |
And there I thought that I could get qshutdown to take multiple commands... It actually froze up qshutdown and that shouldn't be... I still hope to finde another solution from Qt.
jacopoL: Yes, I can confirm that the dbus commands work the way they should when one uses Unity. What the heck? - Stupid gnome-shell >_<"
By the way, when using Debian (Testing) and gnome-shell there is no RequestShutdown method. (confirmed via "dbus-send --print-reply --session --dest=
hakaishi (hakaishi) wrote : | #21 |
I finally got qshutdown to accept "&&". One can now define for eg. something like "shutdown -P now && rtcwake -m on -s 60" or any other commands. The new PPA is now uploaded and waits to be build. It will be aviable from Hardy till Precise. For Quantal it will be included via Debian, but that will take some time.
description: | updated |
summary: |
- allow to set restart/resume time + allow to set restart/resume time in shutdown dialog |
description: | updated |
no longer affects: | gnome-session-shutdown |
no longer affects: | xfdesktop4 (Ubuntu) |
no longer affects: | qt-shutdown-p |
Hmm... So you would like to have an option or something like that for qshutdown?
The problem is that qshutdown usually is used by users without admin rights and rtcwake seems to need these rights...
So there are two solutions: add the user or group you want to the sudoers for rtcwake and enter the commands in the advanced settings (aviable from version 1.6.4 on. Upload to Debian and the Launchpads PPA on 29th April) for qshutdown, or make a little script that first executes your rtcwake command and then starts qshutdown. You'll either need to add the user to the sudoers, or start the script and let it first ask for the password with gksudo or something like that.
I hope to have shed a bit light to the problem. :)