D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] New distro - and logging off

 

On Sat, 17 Nov 2012 18:27:16 +0000
bad apple <ifindthatinteresting@xxxxxxxxx> wrote:

> >>>
> Now I must think of the best way to short cut this so I don't have to
> type all that out every time. (OK so I am lazy.)
> 
> 
> 
> Well, it's in your command history, so you could always just do CTRL+R
> and retype part of the command: by the time you've typed as far as "shu"
> or just "-h" or any other distinctive part of the line then bash will
> find it and you can just hit return to execute it again. This of course
> presumes that you both have a shell open and you're using bash/dash
> instead of something more funky like tcsh. Or you could just set it up a
> shortcut key as someone else mentioned.
> 
> However, I'm not convinced this is a good idea: when you issue as a
> privileged user (as root or via sudo/su) one of the various shutdown
> commands, your box is going to unilaterally go down *immediately* with
> no warnings, no second chances and no checks. Not a good time to realise
> you didn't unmount a NFS share, or had an important SSH session still
> connected, or an unsaved document or backgrounded jobs... Most modern
> distros are doing helpful things behind the scenes as well, maybe
> packagekit is grabbing the latest list of software updates for example.
> When you choose to logout and shutdown from any decent desktop GUI, your
> system is checking for stuff like unsaved files, shutting down services
> nice and sanely, etc: what's not to like about that? Sure, I routinely
> issue "shutdown -hP now" on my boxes but I'm not exactly your typical
> user and even so, I rotate through all my workspaces first and manually
> check I've not left anything unsaved or remote sessions logged in and so
> on. And who cares if your box takes 60 seconds to shut down from the
> menu? I can definitely understand people wanting to shave every last
> possible second off booting *up* because you're sat in front of your
> machine with the first coffee of the day and you want to get started as
> soon as possible, but shutting down? Surely at that point, you're done
> with it so you click the shutdown icon and then just walk away from it.
> Clicking the shutdown icon definitely takes less time than starting a
> shell (Neil, you don't strike me as the type of guy who usually even has
> a shell open!), typing your manual shutdown command and entering a sudo
> password! Once the process has started, who cares if it takes 5 or 50
> seconds, you're already walking away.
> 
> Fair play about being lazy though - all good computer users are lazy: we
> automate everything, so we never have to waste effort duplicating it
> later. For the same reason I always modify my .bashrc HISTORY entries to
> retain a *massive* amount of my history (basically, all of it) so I
> barely ever have to waste time remembering some complicated stanza from
> three years ago: just good old CTRL+R or hgrep (which I've aliased to
> "history | grep -i ", again in .bashrc) and I've instantly got it back
> again. I hate having to retype stuff - I'm lazy too!
> 
> Cheers
> 
> -- 
> The Mailing List for the Devon & Cornwall LUG
> http://mailman.dclug.org.uk/listinfo/list
> FAQ: http://www.dcglug.org.uk/listfaq

I agree. Making a shortcut to a somewhat more fast and loose option because it 
works, while apparently routing around your issue, isn't very illuminating. 
Presumably there is something holding-up shutdown. 

A better solution than simply "sudo halt", that i use in the KDE environment, is 
"qdbus org.kde.ksmserver /KSMServer logout 0 2 2". I have mapped this to Ctrl + 
Escape on my laptop, and it starts the proper KDE shutdown procedure (checking for 
any running doodads, etc). Though I still find myself checking my desktop-list out 
of habit at shutdown, after using Openbox solo for so long (using sudo halt in the 
rc.xml config file).

It would be nice to find the commands Xfce issues for shutdown, restart, and logout, 
and try those command manually, and see what you get. You could then map those 
commands to the keys of your choice.

>>
And who cares if your box takes 60 seconds to shut down from the
menu?
>> 

Personally, I am uneasy about leaving a computer until i am confident it has 
shutdown completely, in case some thing's borked and needs attention, or it hangs 
all night. So, for me, the faster the shutdown the better. I am really digging 
systemd d for this: shuts down with a snap.

Cheers.

Mike

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq