nimmis / docker-spigot

A docker container with spigot, builds spigot.jar on first start
177 stars 81 forks source link

enter the console #29

Open Zappelphilipp opened 6 years ago

Zappelphilipp commented 6 years ago

first of all, thank you very much. Its just awsome how easy this project is making admins life ;) but one thing is just a bit of a hassle: to use the console. Is it possible somehow to return to the console instead of just using "mc_start" and so on? Just like with using screen i would love to somehow get into the server console.

nimmis commented 6 years ago

This version is built without using screen or tmux, it uses files as pipes to communicate with the server.

Is it to difficult to use the mc_send command to pass commands to the console?

nimmis commented 6 years ago

sorry pressed the wrong button

nimmis commented 6 years ago

can you describe the actual problem so can I see if I can find a solution

Zappelphilipp commented 6 years ago

it isnt a problem at all, just a bit inconvenient imo because you ether can see the log "mc_log" or send a command but i helped myself by using two terminals, one for sending commands, one for tracking the status but yeah, maybe there is another way to solve this in the future :)

BertKleewein commented 6 years ago

I think I have the same request. I'm using this to set up a server for my son, so i'm finding myself typing lots of console commands, especially as I'm learning all the different commands. I have 2 bash windows open, one with mc_log running, and one for typing commands. In the command bash, I'm constantly using mc_send, looking at the output, and hitting ctrl-c again.

(I also have a third window running DragonProxy, but that's just a matter of me finding the right way to script it to launch automatically.)

It would be nice if I could have one window with the mc_log output that could also accept input, so that 1) I didn't need the second window 2) My fingers could get used to typing commands with a slash prefix instead of an mc_send prefix. 3) I wasn't constantly pressing ctrl-c between each command.

Like @Zappelphilipp said, it's not a big problem, but it is inconvenient.

By the way, this project is incredible. You have saved me so much pain and this exactly the kind of thing that docker is good at. I really appreciate the work you've put into this!

BertKleewein commented 6 years ago

OK, I found a better workaround for my purposes: from my host, I launch a bash shell on the container:

bert@Beast:/$ docker exec -it spigot /bin/bash

Then, from the container shell, I stop the current instance:

root@2f72218455a3:~# mc_stop
spigot: stopped

Then I launch interactively:

root@2f72218455a3:~#su -s /bin/sh -c "/usr/bin/java -Xmx1G -Xms1G -jar /minecraft/spigot.jar nogui" minecraft
Loading libraries, please wait...

At this point, I can party on. However, if I control-c or otherwise exit the interactive prompt, the server stops. That makes this trick good for quick iteration and learning, but useless for production.