Thread Closed 
Screen
03-27-2012, 09:46 AM
Post: #1
Screen
Does anyone know how to start a new screen with the name mc and then run a command in it?

I've been trying
Code:
screen -S 'mc' -d -m java -jar /home/mc/minecraft/craftbukkit.jar

But it's not working.
User Tools


03-27-2012, 11:28 AM
Post: #2
RE: Screen
Start screen without any options and then run the command. Then, disconnect the SSH connection. The command will continue running.
I got it.
Code:
screen -S 'mc' -p 0 -X command

Don't worry about the world coming to an end today. It's already tomorrow in Australia.
User Tools
03-27-2012, 01:41 PM
Post: #3
RE: Screen
[root@test ~]# screen -S 'mc' -p 0 -X echo test
No screen session found.
User Tools
03-27-2012, 02:09 PM
Post: #4
RE: Screen
This doesn't work unless a screen session has been started. You can put that in .screenrc or setup a bash script to invoke a screen first snd send the command using the above flags. Are you trying to create a cron job?

Don't worry about the world coming to an end today. It's already tomorrow in Australia.
User Tools
03-27-2012, 02:39 PM
Post: #5
RE: Screen
No, this would be a start-up script for a Minecraft server.
When they execute the script, it will start a new screen named mc and run java -jar craftbukkit.jar
User Tools
03-27-2012, 02:49 PM
Post: #6
RE: Screen
Did you look at the init script I sent you?

KVM2 (VPS 15, 19 and 25) Munin report | Check your VPS 15, 19 or 25's IOPS usage
User Tools
03-27-2012, 03:02 PM
Post: #7
RE: Screen
Inside your init script, it's:
screen -dmS minecraft /minecraft/rtoolkit.sh

I modified that to be:
screen -dmS minecraft 'java -jar craftbukkit.jar'

However, when I do screen -r, it says that there are no screens to be resumed.
User Tools
03-27-2012, 03:35 PM
Post: #8
RE: Screen
What happens when you run "java -jar" ? It may be that the screen session is closing since java exits or has an error or something.\

Edit: Also keep in mind that if its in the init script, you need an absolute path to craftbukkit.jar specified

Edit 2: FYI, screen -ls will list the screen sessions for the current user.
User Tools
03-27-2012, 03:35 PM
Post: #9
RE: Screen
What about do screen -x

Quality VPS and Shared Hosting at MitiHost.com
FreeVPS, for give me a good vps ...............
User Tools
03-27-2012, 03:37 PM
Post: #10
RE: Screen
Oh!
I forgot to set the privvmpages to 700M for the OpenVZ container that I was testing it in, so it kept running out of memory.
Thanks!

EDIT: For me, it's just a bash script.
User Tools
Thread Closed 


Forum Jump:



User(s) browsing this thread:
1 Guest(s)