Good day, I have a centos 4.4 box (all yumed up). Now i have a program that has a sub shell - meaning something like the mysql command line, where once started it takes it's own commands, etc and keeps running until a "quit" command is issued. Now what I was wondering - is there a way to fork it to the background (something like # command & or ctrl -z) and have the subshell keep running? And also to be able to get back to the sub shell? For example, if i do run it with the & at the end it does what I want, yet obviously (to my knowledge) you can't get back to the subshell without killing it and restarting it. I have looked into the "screen" shell utility, which for the most part does what I needed, however after a few days the session had disappeared and I was not able to get back to it from another machine/ssh session. Are there any other options? Thanks! Dustin
> For example, if i do run it with the & at the end it does what I want,yet obviously (to my knowledge) you can't get back to the subshell without killing it and restarting it. I have looked into the "screen" shell utility, which for the most part does what I needed, however after a few days the session had disappeared and I was not able to get back to it from another machine/ssh session.> Are there any other options?screen works pretty well, I have some screen sessions that are more than month old. When you connect from antoher machine, what command do you type? It should be: screen -r -x That forces a reconnect, even if someone else is already connected. On a side note: this is a nice way to collaborate on some work between a few people who are not at the same physical location. Everyone SSH's in to a machine, one person runs screen, the others run screen -r -x. you are now all staring at the same terminal and can all work together. Handy for teaching people. Cheers, Mike
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, Dec 12, 2006 at 09:56:59AM -0800, Dustin Krysak wrote:> I have looked into the "screen" > shell utility, which for the most part does what I needed, however > after a few days the session had disappeared and I was not able to get > back to it from another machine/ssh session. > > Are there any other options?If I recall correctly, screen will create session data files on /tmp. tmpwatch or some other utility might be removing those, and that is why you are "loosing" your sessions. You might want to take a look at the SCREENDIR environment variable, and specify some different directory where your sockets will be safer. []s - -- Rodrigo Barbosa "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFfvfhpdyWzQ5b5ckRAnUSAJ47HNeM2cal9pBXF3XmQWqeLeFAqgCfSO5B Zl82jiU8f3fZX7c+HTEGLqU=OZNb -----END PGP SIGNATURE-----
Am Dienstag, 12. Dezember 2006 18:56 schrieb Dustin Krysak:> For example, if i do run it with the & at the end it does what I want, > yet obviously (to my knowledge) you can't get back to the subshellType in "fg" which means foreground. Also works for jobs suspended with "Ctrl-Z". "bg" can be used to put jobs suspended with "Ctrl-Z" into the background (as if run with &). Googling for "job control" could help. I would also suggest reading a UNIX/Linux Shell Tutorial. It's worth learning a few helpful commands to get your everyday shell work done quicker. regards, Andreas Micklei