You are not logged in.
I'll start by saying I don't have a complete understanding of how I/O works in Linux terminals. I have a game server set up, and to run it, I execute the server .jar file. This then causes the server software to use the current screen for I/O (I'm not running an X server - I don't want a GUI). Is there any way I can sort of redirect this I/O in a way that I can access it at any time from SSH and interact with it? Any help would be very greatly appreciated. Thank you!
Offline
I am not sure, but you may be looking for GNU Screen
Last edited by ewaller (2012-04-23 22:25:29)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
I am not sure, but you may be looking for GNU Screen
This seems like what I need. I'm looking through the man pages now. Thanks!
So, with this, I would run my game server with "screen" preceding the command, and then it should create a new screen for it, and I can connect to that screen any time? Is that correct?
Offline
I believe that is correct. To be perfectly honest, I have only researched the product, not used it. I have, however, seen great praise for it on these forums from users I respect.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
When you say input/output, what exactly do you mean? Read/write speeds, network, upload speed, what?
Because you can probably SSH and run iotop. It's just like top but for disk writes.
You can also tail a log file and see the changes being made as they happen (if the game server provides logs, of course).
I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).
Offline
When you say input/output, what exactly do you mean? Read/write speeds, network, upload speed, what?
Because you can probably SSH and run iotop. It's just like top but for disk writes.
You can also tail a log file and see the changes being made as they happen (if the game server provides logs, of course).
By input/output, I meant that of a specific program. I've figured this out with screen - it does just what I want. However, now I'm having another problem. My /etc/rc.local contains this to start the game server:
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
su - huskehn -c "cd /home/huskehn/minecraft/server/; screen -S minecraft java -Xms1G -Xmx1G -jar minecraft_server.jar nogui"
The purpose of the script is to cd to the game server's directory and create a new screen, as my user and not as root, and execute the game server within the screen (that's the java command and everything after it). If I run this script by logging in and typing /etc/./rc.local, it works just as I want it to and the game server starts. However, on system boot, it doesn't seem to run. The game server never starts. Is there some kind of log I can view that could tell me why this is happening?
Last edited by Huskehn (2012-04-24 00:06:02)
Offline
do yourself a favor and use tmux.
https://wiki.archlinux.org/index.php/Tmux
... screen has a terrible config, terrible footprint, and is terribly dead.
don't try to run everything from the rc.local script -- create a script and run that:
#!/bin/bash
exec 1> /path/to/stdout/file
exec 2> /path/to/stderr/file
set > /path/to/variable/dump
[ ... tmux commands here ... ]
chmod +x it, run it from rc.local (run the script itself, using su), then review the output ... possibly unwanted info ... but systemd makes this *very* easy.
Last edited by extofme (2012-04-24 03:49:55)
what am i but an extension of you?
Offline
do yourself a favor and use tmux.
https://wiki.archlinux.org/index.php/Tmux
... screen has a terrible config, terrible footprint, and is terribly dead.
don't try to run everything from the rc.local script -- create a script and run that:
#!/bin/bash exec 1> /path/to/stdout/file exec 2> /path/to/stderr/file set > /path/to/variable/dump [ ... tmux commands here ... ]
chmod +x it, run it from rc.local (run the script itself, using su), then review the output ... possibly unwanted info ... but systemd makes this *very* easy.
All of my problems were fixed by using tmux instead of screen. Tmux is fantastic. Thank you!
Offline
Good to hear you've resolved the issue.
Don't forget to mark your thread as [SOLVED].
Burninate!
Offline