Let me elaborate on the screens concept.
You won't get any screens with
screen -r command, unless you start a program with screens. You have to start your application with screen command for it to work in background and come upfront upon call. So, instead of using ./start_script you will use
Here is the syntax of how to do it.
Code: Select all
screen -A -m -d -S minecraft ./start_script
you can give it any name you want. I just used minecraft just to illustrate.
Once you start the server like that, it will run in the background and you can close putty. The benefit of screen is that you can close your terminal, but your server will still be running in the background. As stated previously, all you gotta do is use this command to bring it upfront.
Remember, you only need to mention name when you are running multiple screen apps. Otherwise
screen -r would be enough for you.
This is the list of all screen parameters, if you wanna learn more about them.
Code: Select all
-a Force all capabilities into each window's termcap.
-A -[r|R] Adapt all windows to the new display width & height.
-c file Read configuration file instead of '.screenrc'.
-d (-r) Detach the elsewhere running screen (and reattach here).
-dmS name Start as daemon: Screen session in detached mode.
-D (-r) Detach and logout remote (and reattach here).
-D -RR Do whatever is needed to get a screen session.
-e xy Change command characters.
-f Flow control on, -fn = off, -fa = auto.
-h lines Set the size of the scrollback history buffer.
-i Interrupt output sooner when flow control is on.
-l Login mode on (update /var/run/utmp), -ln = off.
-list or -ls. Do nothing, just list our SockDir.
-L Terminal's last character can be safely updated.
-m ignore $STY variable, do create a new screen session.
-O Choose optimal output rather than exact vt100 emulation.
-p window Preselect the named window if it exists.
-q Quiet startup. Exits with non-zero return code if unsuccessful.
-r Reattach to a detached screen process.
-R Reattach if possible, otherwise start a new session.
-s shell Shell to execute rather than $SHELL.
-S sockname Name this session <pid>.sockname instead of <pid>.<tty>.<host>.
-t title Set title. (window's name).
-T term Use term as $TERM for windows, rather than "screen".
-U Tell screen to use UTF-8 encoding.
-v Print "Screen version 3.09.13 (FAU) 5-Sep-02".
-wipe Do nothing, just clean up SockDir.
-x Attach to a not detached screen. (Multi display mode).
-X Execute <cmd> as a screen command in the specified session.
Moving onto your second issue which would be TS3 server. TS3 server runs as a service instead of an program, so I doubt you would be able to use screen for that. I never ran TS3 server, but if I remember the basics of TS3 then everything is controlled by admin token. You won't even need to do much from terminal, but again I have a very limited knowledge about TS3 servers, so I could be wrong.
Jake wrote:
Here is a portion of my /etc/rc.local
Code: Select all
sleep 2
su teamspeak -c 'screen -d -m -S ts3 /home/teamspeak/teamspeak/ts3server_minimal_runscript.sh inifile=ts3server.ini'
su minecraft -c 'screen -d -m -S mc java -Xms128M -Xmx1792M -jar /home/minecraft/minecraft/craftbukkit-beta.jar nogui'
If I type screen -r ts3 into root, it replies with this:
Code: Select all
There is no screen to be resumed matching ts3.
You don't need the rc.local thing when you are using screen. Just use screen and run your apps, it works pretty well.