View previous topic :: View next topic |
Author |
Message |
MudPutty n00b
Joined: 06 Oct 2003 Posts: 42
|
Posted: Fri Oct 17, 2003 6:14 pm Post subject: Doing an "emerge" over ssh? |
|
|
If I do an "emerge" to install something over ssh, and then dissconect my ssh session, can I reconnect using ssh and be able to see the progress of the emerge install?
Or is there a better way of remotely installing using emerge? |
|
Back to top |
|
|
compu-tom Guru
Joined: 09 Jan 2003 Posts: 415 Location: Berlin, Germany
|
Posted: Fri Oct 17, 2003 6:19 pm Post subject: |
|
|
No.
You can use or .
Screen gives you an interactive screen session which can be detached from the terminal and later on be re-attached.
Nohup sends the output of a command to a log file and ignores SIGHUP. Therefore it will survive a ssh logout and keep on running...
Personally I prefer screen. |
|
Back to top |
|
|
MudPutty n00b
Joined: 06 Oct 2003 Posts: 42
|
Posted: Fri Oct 17, 2003 6:57 pm Post subject: |
|
|
At the end of the emerge of "Screen" I recieved this msg: Quote: | * screen is not installed as setuid root, which effectively disables multi-user
* mode. To enable it, run:
*
* chmod u+s /usr/bin/screen
* chmod g-w /var/run/screen |
Does this mean that if I want "root" access to the screen command I need to follow their directions of "chmod..."? |
|
Back to top |
|
|
compu-tom Guru
Joined: 09 Jan 2003 Posts: 415 Location: Berlin, Germany
|
Posted: Fri Oct 17, 2003 7:03 pm Post subject: |
|
|
No.
It means that you (if root or not) cannot simultanously hack into another user's screen session (and see and type what he/she sees or types).
+s permissions are not necessary to run screen as root.
BTW, I have the following ~/.screenrc Code: | caption always
defscrollback 10000
startup_message off
#caption string "%Y-%m-%d %0c %3n %t (%W)"
caption string "%3n %t (%W)" | which makes screen even more usable |
|
Back to top |
|
|
MudPutty n00b
Joined: 06 Oct 2003 Posts: 42
|
Posted: Fri Oct 17, 2003 7:11 pm Post subject: |
|
|
AHHHH, "the light goes on " Great...Thanks! I will play around with "Screen" and see what I can break hehe. |
|
Back to top |
|
|
MudPutty n00b
Joined: 06 Oct 2003 Posts: 42
|
Posted: Fri Oct 17, 2003 7:25 pm Post subject: |
|
|
MY HECK!!! There is a "TON" of information to read through for "Screen". Can you give me a few pointers/command examples to get started? |
|
Back to top |
|
|
MudPutty n00b
Joined: 06 Oct 2003 Posts: 42
|
Posted: Fri Oct 17, 2003 7:31 pm Post subject: |
|
|
I found something to get me going...thanks again:
Quote: | SCREEN Command Quick Reference
Screen creates a virtual terminal in which you can perform actions. The unique thing about this virtual terminal is that
you can disconnect from it and then reconnect to it without disturbing what is happening within it. The cool thing
about screen is that it uses a buffer, so any output to the terminal that happened while you were detached will be visible
when you reattach.
The screen command is useful for executing processes remotely, which you dont want to kill when you log out. i.e. If
I wanted to download a 650MB cdrom image to a school computer while I at home on my modem. I would log into
Lisa, use the screen command to launch ftp, start downloading the file, then detach from that screen and log out. Later
I can log back into Lisa and reattach to the screen to check on the ftp progress.
Launching and detaching
screen <command> Example: screen emacs Starts a new screen running Emacs
To detatch type Ctrl-A Ctrl-D Will take you back to the shell (Similar to an Emacs command)
Then to reattach
screen -r If you have multiple screens this command will list them.
screen -r 1234 Reattach to session 1234 as listed. |
|
|
Back to top |
|
|
compu-tom Guru
Joined: 09 Jan 2003 Posts: 415 Location: Berlin, Germany
|
Posted: Fri Oct 17, 2003 7:35 pm Post subject: |
|
|
All screen commands start with Ctrl-a (press the Ctrl-key and a lowercase a).
Here are some important commands (case-sensitive):
"Ctrl-a h" gives you a help screen.
"Ctrl-a c" creates a new screen window (it shows up in the bottom bar if you use my .screenrc). A fresh shell gets started in this window.
"Ctrl-a <SPACE>" cycles through the screen windows.
"Ctrl-a <NUMBER>" goes directly to the screen window with this number.
"Ctrl-a A" sets the shown title of the current screen window.
If you leave a shell the corresponding screen window goes away.
With the last screen window goes the screen itself.
To detach the screen (but keep the shells inside running), type "Ctrl-a d".
To re-attach screen, type.
For further information see the man page.
Good luck |
|
Back to top |
|
|
MudPutty n00b
Joined: 06 Oct 2003 Posts: 42
|
Posted: Fri Oct 17, 2003 7:51 pm Post subject: |
|
|
huh, some of the commands are not working. like "Ctrl-a h" I can't kill any of the windows either (instructions per the man file)...any ideas? |
|
Back to top |
|
|
compu-tom Guru
Joined: 09 Jan 2003 Posts: 415 Location: Berlin, Germany
|
Posted: Fri Oct 17, 2003 7:53 pm Post subject: |
|
|
Ooops: It's "Ctrl-a ?" |
|
Back to top |
|
|
MudPutty n00b
Joined: 06 Oct 2003 Posts: 42
|
Posted: Fri Oct 17, 2003 7:59 pm Post subject: |
|
|
OK, i'm starting to get the hang of things now thanks again!!! |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20588
|
Posted: Sat Oct 18, 2003 3:57 am Post subject: |
|
|
Moved from Installing Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
dma Guru
Joined: 31 Jan 2003 Posts: 437 Location: Charlotte, NC, USA
|
Posted: Sun Oct 19, 2003 7:52 pm Post subject: |
|
|
MudPutty wrote: | At the end of the emerge of "Screen" I recieved this msg: Quote: | * screen is not installed as setuid root, which effectively disables multi-user
* mode. To enable it, run:
*
* chmod u+s /usr/bin/screen
* chmod g-w /var/run/screen |
Does this mean that if I want "root" access to the screen command I need to follow their directions of "chmod..."? |
If you make it setuid root, you can do all sorts of wacky ACL stuff.
I once used it so a friend could watch me emerge stuff (I was demonstrating gentoo) in my root shell without being able to type anything. It was pretty cool. |
|
Back to top |
|
|
MudPutty n00b
Joined: 06 Oct 2003 Posts: 42
|
Posted: Tue Oct 21, 2003 9:16 pm Post subject: |
|
|
Now that I have been using Screen for a little bit i'm hooked! I have been showing it off to everyone that isn't familure with it...Screen is a great tool to have! |
|
Back to top |
|
|
magic Tux's lil' helper
Joined: 16 Apr 2002 Posts: 118 Location: Alameda, CA
|
Posted: Wed Oct 22, 2003 11:39 am Post subject: |
|
|
Thanks ... I've been looking for this for a long time!! |
|
Back to top |
|
|
triad Apprentice
Joined: 10 Jul 2003 Posts: 234 Location: Dark Side of the Moon
|
Posted: Sun Nov 02, 2003 1:48 pm Post subject: |
|
|
Never new this program existed. Thanks all for the info. Screen Rocks _________________ It's not the size of your processor that matters... But how you use it! |
|
Back to top |
|
|
chrisis Tux's lil' helper
Joined: 22 May 2003 Posts: 112 Location: Auckland
|
Posted: Sat Apr 03, 2004 6:37 am Post subject: |
|
|
can screen be used as default shell? In otherwords can I create a user that when logged in /usr/bin/screen is the shell instead of /bin/bash?
I'm just a little unclear how to best use this. Do I, for eg:
1. ssh into my server, then start screen
2. Do stuff, then detach, then exit my ssh
3. Go somewhere else, ssh again, screen -r to get my screen session back?
Or does my /etc/password have to have shell set to screen instead of bash? _________________ But the situation seemed to call for witty repartee. "Huh?" I said. |
|
Back to top |
|
|
OdinsDream Veteran
Joined: 01 Jun 2002 Posts: 1057
|
Posted: Sat Apr 03, 2004 9:37 am Post subject: |
|
|
You could put screen into your .bashrc file, or whatever file gets automatically read when you log in. _________________ s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi
Don't blame me. I didn't vote for him.
http://john.simplykiwi.com |
|
Back to top |
|
|
creche n00b
Joined: 25 Apr 2003 Posts: 23 Location: Livorno, Italy
|
Posted: Sat Apr 03, 2004 10:15 am Post subject: Re: Doing an "emerge" over ssh? |
|
|
MudPutty wrote: | If I do an "emerge" to install something over ssh, and then dissconect my ssh session, can I reconnect using ssh and be able to see the progress of the emerge install?
Or is there a better way of remotely installing using emerge? |
--nospinner
anyway use screen if u are making critical jobs.
Greets |
|
Back to top |
|
|
|