You are not logged in.
I always just run
sudo shutdown -h now
But then some of my running apps freak out and leave errors (that I can see for a few moments after X dies but before it shuts down) along the lines of "Holy crap: can't find screen 0, OMG crash dead"
Is there a smarter way to shutdown? Maybe a script that sends sigterm calls to all running programs first?
Offline
Exit your WM then shutdown (be it via a desktop manager or a terminal)
My login drops me to a shell so I exec `startx` manually. When I'm done I just exit ratpoison then do a `shutdown -h now`
Archlinux | ratpoison + evilwm | urxvtc | tmux
Offline
Exit your WM then shutdown (be it via a desktop manager or a terminal)
My login drops me to a shell so I exec `startx` manually. When I'm done I just exit ratpoison then do a `shutdown -h now`
Yeah, but doesn't logging out from your WM upset your apps?
For example, Claws-mail and Pidgin sit in my system tray. When I shutdown (or just logout my WM) I see errors that they leave. They're obviously trying to draw themselves, but since X is no longer running they just error out.
Offline
Lich wrote:Exit your WM then shutdown (be it via a desktop manager or a terminal)
My login drops me to a shell so I exec `startx` manually. When I'm done I just exit ratpoison then do a `shutdown -h now`Yeah, but doesn't logging out from your WM upset your apps?
For example, Claws-mail and Pidgin sit in my system tray. When I shutdown (or just logout my WM) I see errors that they leave. They're obviously trying to draw themselves, but since X is no longer running they just error out.
Well of course the apps would crash, but that shouldn't matter...Doubt there's one person here that has a perfect setup, and no errors. FFS, I get errors all the time...even when starting X. Just warnings..nothing too bad. If pidgin crashes, it also disconnects and the tray exits, it's not clean, but they do close. I wouldn't worry too much about this.
Last edited by Lich (2009-12-31 22:49:07)
Archlinux | ratpoison + evilwm | urxvtc | tmux
Offline
Same. I doubt even gnome/kde stop all their processes completely without error (I could be wrong though). Something like pidgin shouldn't ever break from being killed. Don't worry about it.
That said, I do tend to shut down any apps like firefox before I shutdown. That's just me though. Nothing to worry about.
Offline
I just close everything by hand and then shutdown in a terminal.
Offline
I use 'h' alias for 'halt'.
arst
Offline
I use
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown
to shutdown instead of using sudo
Offline
I have Super+Shift+Grave bound to `sudo poweroff`.
Offline
@some-guy94 - thats interesting. Is there a similar command for rebooting?
Offline
@some-guy94 - thats interesting. Is there a similar command for rebooting?
Yeah, there are also commands for hibernate and suspend.
I found it here.
EDIT: I might as well just post them here
Reboot
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Reboot
Shutdown
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown
Hibernate
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate
Suspend
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0
Last edited by some-guy94 (2010-01-01 03:29:02)
Offline
Yeah, there are also commands for hibernate and suspend.
I found it here.
Very nice set of commands. Nice find!!!
Last edited by securitybreach (2010-01-01 06:27:39)
"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website Configs
Forum Admin: Bruno's All Things Linux
securitybreach<a>archlinux.us
Offline
anonymous_user wrote:@some-guy94 - thats interesting. Is there a similar command for rebooting?
Yeah, there are also commands for hibernate and suspend.
I found it here.EDIT: I might as well just post them here
Reboot
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.RebootShutdown
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.ShutdownHibernate
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.HibernateSuspend
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0
What's the difference between these and just doing sudo shutdown -h now? Can anyone give me one actual example? (I'm asking anyone who knows)
Last edited by tomd123 (2010-01-01 07:05:06)
Offline
This thread gives a good solution for the shutdown/reboot etc options those who are using no DE.
Offline
I use in acpi/events/power:
event=button/power.*
action=/sbin/shutdown -h now
and then just pressing the power off button will suffice
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
some-guy94 wrote:Yeah, there are also commands for hibernate and suspend.
I found it here.Very nice set of commands. Nice find!!!
I don't see anything nice here. It's sending request to the (widely hated and soon deprecated) HAL. I'd rather trust sudo.
This silver ladybug at line 28...
Offline
A window manager-agnostic session manager that could signal processes to gracefully exit when logging off, shutting down, or rebooting would be nice...
Last edited by Wintervenom (2010-01-15 02:53:35)
Offline
I prefer pressing the power button.
http://wiki.archlinux.org/index.php/Shu … wer_Button
Offline
nothing wrong with a `shutdown -h now` afaik.
of course your apps will lose the connection to X when it shuts down. but that's normal. and all your programs will get a sigterm anyway.
it's not like your apps will start removing files or writing other crap to your hard disk when the connection to X drops/they get sigterm.
(if they do, that's a bug in those apps ;-)
and "just close your WM and do a shutdown after that" brings no advantages, it's just a manual step more, but the same things happen.
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
securitybreach wrote:some-guy94 wrote:Yeah, there are also commands for hibernate and suspend.
I found it here.Very nice set of commands. Nice find!!!
I don't see anything nice here. It's sending request to the (widely hated and soon deprecated) HAL. I'd rather trust sudo.
Well I have found equivalent commands with devicekit-power/upower for suspend and hibernate.
Suspend
dbus-send --system --print-reply --dest="org.freedesktop.DeviceKit.Power" /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.Suspend
Hibernate
dbus-send --system --print-reply --dest="org.freedesktop.DeviceKit.Power" /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.Hibernate
EDIT:
I have found commands that use consolekit for restarting/shutting down, so no more HAL.
Shutdown
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
Reboot
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
Last edited by some-guy94 (2010-01-01 22:20:46)
Offline
lolilolicon wrote:securitybreach wrote:Very nice set of commands. Nice find!!!
I don't see anything nice here. It's sending request to the (widely hated and soon deprecated) HAL. I'd rather trust sudo.
Well I have found equivalent commands with devicekit-power/upower for suspend and hibernate.
Suspend
dbus-send --system --print-reply --dest="org.freedesktop.DeviceKit.Power" /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.SuspendHibernate
dbus-send --system --print-reply --dest="org.freedesktop.DeviceKit.Power" /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.Hibernate
I second what lolicon (or whatever) said. but s/(widely hated and soon deprecated) HAL/bloated incomprehensible dbus/
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
I just open a terminal (ctrl+alt+home on my PC) and type "sudo init 0"
Offline
I've always typed sudo halt and sudo reboot, but now I've chmod u+s /sbin/shutdown and made some keybindings to shutdown -h now and shutdown -r now.
Offline
I've always typed sudo halt and sudo reboot, but now I've chmod u+s /sbin/shutdown and made some keybindings to shutdown -h now and shutdown -r now.
It's probably safer to add an entry to /etc/sudoers, so that arbitrary users can't shutdown. For example:
<USER> ALL=NOPASSWD: /sbin/shutdown
But even better IMHO are the consolekit ones, because you get extra protection from e.g. shutting down with other users logged on
"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page
Offline
Some of my running apps freak out and leave errors (that I can see for a few moments after X dies but before it shuts down) along the lines of "Holy crap: can't find screen 0, OMG crash dead"
Is there a smarter way to shutdown? Maybe a script that sends sigterm calls to all running programs first?
Are you looking for behavior more similar to Windows? I mean, when you tell the computer to shutdown, it first asks all the applications to quit. If an application doesn't want to close yet, (for example, if there is a popup asking if you want to save an unsaved document) then the OS will wait until the application is finished closing. Is that what you are looking for?
I'm sorry, I don't know of a way to do that in Linux. I really like the way Linux handles shutting down though. When I tell it to shutdown now, it shuts down now! This way, the computer is doing exactly what I tell it to do, instead of what the software wants to do. I just close all of applications first, including any web browsers and IM clients.
I'm sorry if I misunderstood your question.
Offline