Gentoo Archives: gentoo-server

From: rdmurray@××××××××.com
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] excute remote emerge
Date: Thu, 07 Sep 2006 15:13:07
Message-Id: Pine.LNX.4.64.0609071140080.8194@matthew.jpcalvin.com
In Reply to: Re: [gentoo-server] excute remote emerge by Francisco Olarte Sanz
1 On Thu, 7 Sep 2006 at 11:48, Francisco Olarte Sanz wrote:
2 > On Wednesday 06 September 2006 23:12, Ben Munat wrote:
3 >> Well, I think the response is overwhelmingly clear: screen!
4 >> I just wanted to add my 2 cents that I absolutely love screen... it has
5 >> saved my ass countless times. The only problem is remembering to run it
6 >> on login before starting the emerge. I suppose I really should look into
7 >> getting bash to run it for me automatically. Anyone got a script for that?
8 >
9 > I don't normally use screen for login, but as none of my servers allow
10 > root-sshing directly what I'm used to to is ssh normaluser@server,
11 > su -c 'screen -DAR', emerge, instead of plain su.
12
13 This is probably more info than most people want to hear, but some other
14 sysadmin may find it useful, so what the heck.
15
16 I work on around two dozen servers that are mixture of unix OSes, and
17 I'm only primary sysadmin on some of them. What I do is set myself
18 up a minimum consistent environment on each machine using a little
19 rsync script. That environment includes my laptop's ssh key and some
20 "helper" scripts. On my laptop, from which I do all my work, I run the
21 'ratpoison' window manager, which is to X what screen is to the console.
22 Then I use ratpoison's 'run a command in a window' function to run a
23 script to connect to whatever machine it is I need to work on. (eg:
24 'workon mail' to get to the mail server I manage.) That script looks up
25 the hostname and screen name associated with the nickname 'mail', sshes to
26 the host, and runs the helper script ('workonscreen') on the target host.
27 That script saves the ssh environment vars (so I can source them inside
28 screen to get access to my ssh-agent connection), does a screen -wipe
29 in case the server crashed since my last connect, and then connects to
30 a named screen session. I use named sessions so I can have more than
31 one screen "workspace" on a given host and get back to them by name.
32
33 This makes for a very efficient work environment. The ratpoison windows
34 essentially become workspaces, where the screen in a given window manages
35 the windows of my workspace. The ratpoison and screen keystroke commands
36 are (by design) very parallel, so the muscle memory is quite strong and
37 getting to exactly the window I need happens almost as fast as I can
38 think it (I'm a fast typist, and I use named windows and use the names
39 for window switching). I can also use the screenrc file to set up a
40 default workspace with various windows and running programs, though I
41 haven't done that much on the hosts yet (I use that feature extensively
42 on the laptop, though).
43
44 Oh, yeah, and I never log in as root. I always use sudo to run root
45 commands :) But there's no reason you couldn't do the same thing but run
46 the screen as root. Personally I always have only one window visible at
47 a time, but I imagine this technique would work quite well even if you
48 do like having your window split into multiple pieces. (I do do that
49 sometimes to, say, have an IRC window up and visible while I'm working
50 in the other pane.)
51
52 I can never figure out what all this fuss is about desktops. I've never
53 found the desktop metaphor to be particularly efficient...
54
55 --David
56 --
57 gentoo-server@g.o mailing list

Replies

Subject Author
Re: [gentoo-server] excute remote emerge Ben Munat <bent@×××××.com>