Screen
#1
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.
#2
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.
#3
[root@test ~]# screen -S 'mc' -p 0 -X echo test
No screen session found.
#4
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.
#5
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
#6
Did you look at the init script I sent you?
#7
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.
#8
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.
#9
What about do screen -x
Quality VPS and Shared Hosting at MitiHost.com
FreeVPS, for give me a good vps ...............

#10
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)