[mohaa] console reattatch
Ryan C. Gordon
icculus at clutteredmind.org
Fri Jul 19 13:31:27 EDT 2002
> as i will soon be running this remotely and cannot stay connected to the ssh
> console 24/7, i will be making it run in the background &, so when i leave
> the cosole.. and return to the server.. is there any way to.. reattach to
> it as if u just ran the exec?
Use "screen".
On the Cyberspace Matrix, I use this (this works in the system boot
scripts, or at the regular command line):
screen -d -m su mohaa -c "/usr/local/MOHAA/mohaa_csm_2/mohaa_lnxded
+set fs_userdir /home/mohaa/.mohaa2 +set fs_outputdir /home/mohaa/.mohaa2
+exec server.cfg"
Do that all on one line. Modify as necessary, wrap in a restarting script,
etc...
Then:
screen -r
And you'll be looking at your server output...you can then type commands,
etc. When you are done staring, hit CTRL-A followed by 'd' to detach the
screen. Log off...server will keep running.
Next time you log in, do "screen -r" again to reattach.
When you are done, quit the server and everything should clean up.
> also will there be a chk file for use with cron?
As in, "make sure the server continues to run?"
Just wrap the thing in a shell script that restarts it if/when it dies. Am
I misunderstanding you?
--ryan.
More information about the Mohaa
mailing list