[kde-linux] KDE 4 and monitor powering off.

Duncan 1i5t5.duncan at cox.net
Thu Feb 25 23:35:34 UTC 2010


Dale posted on Thu, 25 Feb 2010 16:40:13 -0600 as excerpted:

>> Hmm... I don't believe the standard konsole menu entry runs as root...
>> and certainly, typing in konsole in krunner, and selecting the "run
>> konsole" entry, should run it as the same user (the "terminal" entry
>> simply invokes the menu entry, so it would run whatever the menu is
>> setup to run).
>>
> It doesn't.  I changed it so that it would run as root since I have to
> be root to run portage.  I'm not a real security nut.

=:^)

I actually have three user logins I use, my normal user, an "admin" user, 
and (seldom) root itself.  

I have sudo configured so my normal user has very limited access (some 
with password, some without) to only a few specifically nailed down 
commands, with specific parameters.  One of those commands, however, with 
password, allows me to sudo to my admin user.

The admin user has full passwordless access to do everything root could 
do, except that for most things, I have to sudo <command> where root 
wouldn't have the sudo in front.  (Actually, I'm lazy and don't like to 
type the full sudo, so I have simply "s" aliased to sudo, and just type 
the s and a space.)

For my frequently run admin commands, including portage related commands, 
I have a /l/sudobin/ directory (again, I'm lazy, the traditional /usr/
local/ is simply a symlink to /l/, so that's the equivalent of /usr/local/
sudobin/), which mostly consists of symlinks to a single executable 
script, /l/sudobin/exec-sudo, which is the following:

#!/bin/bash

exec sudo ${0##*/} $*

So all it does is re-execute the command it was called as (thus the 
symlinks) with sudo in front.  IOW, if I run "eas", it executes "sudo 
eas" (where eas is another shortcut, short for emerge --ask
(--update --deep --newuse) @system, e=emerge, a=ask, s=system, I have 
similar shortcuts for the whole set, epw for e=emerge p=pretend w=world, 
for instance).

So as my admin user, esyn will sync (esyn is a script that syncs both 
portage and the layman managed overlays), eas will emerge ask the system 
update, and eaw will emerge ask the world update.  Those take no passwords 
and don't require the s/sudo in front, as I use them enough to have setup 
the symlinks in the sudobin dir, which is in my admin-user's path, to do 
so.

FWIW, I have auto-complete setup to work for s as it would for sudo, and 
ea* and ep* just as it would for emerge, too, so I can do ep 
konq<tab><tab> and have it supply the possible packages (konqueror, konq-
plugins, konquest) I could emerge...

The idea is to avoid logging in as root unless it's really necessary, tho 
I will if I'm doing something major like setting up, gdisking and mkfsing 
raid arrays or something.  And as the admin user, the common admin tasks 
require no "s " in front, so when I'm doing something like rm as root, I 
generally construct the command as a the admin user using tab completion, 
etc, run it, get the permission error, hit the up-arrow to recall the last 
command, home, and s<space> to add the sudo invoke at the beginning, to 
actually run it as root.  By that point I know what I'm actually rming 
(the permissions error told me, so I can double-check before I do the 
actual rm as root), so when I actually add the s to the front of the 
command and hit enter, there's no accidentally rming the wrong thing!

So for syncing and doing the normal updates, it's generally start konsole 
(which I have assigned a hotkey, so it's a two-stroke sequence to start a 
new konsole), ". admin" , to source the script that sudos me to the admin 
user, then esyn, then eps to see what the @system updates are going to be, 
epl <pkg> if any of them look interesting, to get the changelog, edit 
package.use (se /et<tab>po<tab>pa<tab>u<tab>, se being short for sudoedit, 
of course, and using shell autocompletion) or my global USE flags if 
there's any new USE flags in the updates I need to attend to, eas to merge 
them.  Meanwhile, I run a second konsole session and epz (z for @selected, 
since s was already taken for @system) to get the world_sets updates, and 
again inspect them for anything interesting like USE flag changes and 
changelogs I might wish to check.  By the time I get thru checking them, 
the @system update is generally done, and I can run the @world update.

When I'm thru, I eup (short for etc-update), ear (runs revdep-rebuild with 
--ask, I just kept the ea theme), ead (emerge --ask --depclean), and again 
ear if anything was cleaned.  Thus, when I'm fully done, the system is 
again fully config updated (etc-update), self-consistent (revdep-rebuild), 
and has no stale and no longer needed dependencies (depclean).  And most 
of it is simple 3-4 letter commands, with tab-completion on the 
parameters, if needed. =:^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman




More information about the kde-linux mailing list