On Thu, 7 Sep 2006 at 11:48, Francisco Olarte Sanz wrote:
On Wednesday 06 September 2006 23:12, Ben Munat wrote:
Well, I think the response is overwhelmingly clear: screen!
I just wanted to add my 2 cents that I absolutely love screen... it has
saved my ass countless times. The only problem is remembering to run it
on login before starting the emerge. I suppose I really should look into
getting bash to run it for me automatically. Anyone got a script for that?
I don't normally use screen for login, but as none of my servers allow
root-sshing directly what I'm used to to is ssh [EMAIL PROTECTED],
su -c 'screen -DAR', emerge, instead of plain su.
This is probably more info than most people want to hear, but some other
sysadmin may find it useful, so what the heck.
I work on around two dozen servers that are mixture of unix OSes, and
I'm only primary sysadmin on some of them. What I do is set myself
up a minimum consistent environment on each machine using a little
rsync script. That environment includes my laptop's ssh key and some
"helper" scripts. On my laptop, from which I do all my work, I run the
'ratpoison' window manager, which is to X what screen is to the console.
Then I use ratpoison's 'run a command in a window' function to run a
script to connect to whatever machine it is I need to work on. (eg:
'workon mail' to get to the mail server I manage.) That script looks up
the hostname and screen name associated with the nickname 'mail', sshes to
the host, and runs the helper script ('workonscreen') on the target host.
That script saves the ssh environment vars (so I can source them inside
screen to get access to my ssh-agent connection), does a screen -wipe
in case the server crashed since my last connect, and then connects to
a named screen session. I use named sessions so I can have more than
one screen "workspace" on a given host and get back to them by name.
This makes for a very efficient work environment. The ratpoison windows
essentially become workspaces, where the screen in a given window manages
the windows of my workspace. The ratpoison and screen keystroke commands
are (by design) very parallel, so the muscle memory is quite strong and
getting to exactly the window I need happens almost as fast as I can
think it (I'm a fast typist, and I use named windows and use the names
for window switching). I can also use the screenrc file to set up a
default workspace with various windows and running programs, though I
haven't done that much on the hosts yet (I use that feature extensively
on the laptop, though).
Oh, yeah, and I never log in as root. I always use sudo to run root
commands :) But there's no reason you couldn't do the same thing but run
the screen as root. Personally I always have only one window visible at
a time, but I imagine this technique would work quite well even if you
do like having your window split into multiple pieces. (I do do that
sometimes to, say, have an IRC window up and visible while I'm working
in the other pane.)
I can never figure out what all this fuss is about desktops. I've never
found the desktop metaphor to be particularly efficient...
--David
--
[email protected] mailing list