You are not logged in.
I've always done a telinit 0 or simply "poweroff" when I decide to turn my computer off, but that kills programs without asking about saving things, firefox always starts up saying it has crashed, etc. Is there a better way to turn off the machine?
Offline
I use XFCE4 and I have it autologin to my user in the inittab to runlevel 5.
Offline
Another solution maybe. Install gdm, start it on boot, configure it for autologin and then you have a "normal" shutdown possibility within xfce. Normally xfce should save your session then, if xfce support session management. Don't know, I don't use it.
Last edited by ise (2008-01-19 19:05:33)
Offline
sudo shutdown -h now
From man:
"shutdown brings the system down in a secure way. All logged-in users
are notified that the system is going down, and login(1) is blocked.
It is possible to shut the system down immediately or after a specified
delay. All processes are first notified that the system is going down
by the signal SIGTERM. This gives programs like vi(1) the time to save
the file being edited, mail and news processing programs a chance to
exit cleanly, etc... "
It needs the following row in sudoers:
user ALL=NOPASSWD:/sbin/shutdown
Where user are your user name.
Offline
Offline
I would use the 'halt' command. It does what I want it to do, that is shut down the computer.
Check me out on twitter!!! twitter.com/The_Ringmaster
Offline
Use /usr/lib/xfce4/xfsm-shutdown-helper
Cleanest method.
Offline
Use /usr/lib/xfce4/xfsm-shutdown-helper
Cleanest method.
xfsm-shutdown-helper just calls shutdown See http://svn.xfce.org/index.cgi/xfce/brow … own-helper
I haven't found the source code to xfce's logout/shutdown button yet, still looking. When I use that button, OpenOffice does offer to save before quitting. Firefox just terminates, and would nag me on startup too, except that I disabled the nagging with an option in "about:config".
Offline
What I did is use suspend instead of shutdown.
Add resume=/dev/sda5 to your kernel line (/dev/sda5 is your swap partition). Install lilo if that's what you're using.
Modify /etc/acpi/handler.sh so it says:
button/power)
#echo "PowerButton pressed!">/dev/tty5
case "$2" in
PWRF)
logger "PowerButton pressed: $2"
acpitool -S
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
Just press your power button and go to sleep. It will suspend to disk, and when you turn it on it will come back exactly as it was before.
Offline
sudo shutdown -h now
That's how I learned when I first switched to Linux and it's always worked for me ... reboots too.
What I did is use suspend instead of shutdown.
I've actually started suspending instead of total shutdown on my desktop now too.
Offline
I just found a very simple way about a week ago: wmctrl. It's available in AUR.
Use wmctrl -c $windowname or wmctrl -i -c $windowid to close a window as if you clicked on the close button in the title bar. I tried it on firefox, and it didn't report any crash or anything. Write a simple bash script to recursively close all windows, then power off.
Edit: Just wrote and tried that myself, works well.
#!/bin/bash
windows=`wmctrl -l | cut -d' ' -f1`
wmctrl -i -c $windows
while [ -n "$windows" ]; do
windows=`echo $windows | cut -d' ' -f1 -s --complement`
wmctrl -i -c $windows
done
halt
Don't run that in a terminal, because the script would close the terminal and terminates the script before it can call halt. For example, I run it in fluxbox and I put this script in my fluxbox menu. As you use XFCE, maybe put it in your menu or launch bar.
Last edited by dumas (2008-01-24 07:35:33)
Offline