All users will need to merge their Minecraft Forum account with a new or existing Twitch account starting October 23rd. You can merge your accounts by clicking here. Have questions? Learn more here.
I am using this code as well. I hope you have changed the USERNAME and MCPATH in that script to your own.
To send commands you just have to type in ssh either:-
/etc/init.d/minecraft start
/etc/init.d/minecraft stop
/etc/init.d/minecraft restart
/etc/init.d/minecraft update
Depending on what you want to do. Hope that answers your question.
Also get the following error when trying to stop/restart the server:-
minecraft_server.jar is running... stopping.
There are several suitable screens on:
15957.minecraft(05/12/10 13:22:39)(Detached)
14998.minecraft(05/12/10 12:31:58)(Attached)
15412.minecraft(26/11/10 13:54:29)(Dead ???)
15586.minecraft(26/11/10 13:54:29)(Dead ???)
Remove dead screens with 'screen -wipe'.
Use -S to specify a session.
There are several suitable screens on:
15957.minecraft(05/12/10 13:22:39)(Detached)
14998.minecraft(05/12/10 12:31:58)(Attached)
15412.minecraft(26/11/10 13:54:29)(Dead ???)
15586.minecraft(26/11/10 13:54:29)(Dead ???)
Remove dead screens with 'screen -wipe'.
Use -S to specify a session.
minecraft_server.jar could not be shut down... still running.
So I have to shutdown using
kill -9 [PID]
which isn't a big deal really.
/etc/init.d/minecraft update
works fine.
Server runs fine and gets listed when I run it this way:-
I want to run minecraft server as linux service, i'm using this code
# /etc/init.d/minecraft #Settings SERVICE='minecraft_server.jar' USERNAME="user" MCPATH='/home/user/Escritorio/Minecraft' mc_start() { if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "Tried to start but $SERVICE was allready running!" else echo "$SERVICE was not running... starting." cd $MCPATH su - $USERNAME -c "cd $MCPATH && screen -dmS minecraft java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui" sleep 7 if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE is now running." else echo "Could not start $SERVICE." fi fi } mc_stop() { if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE is running... stopping." su - $USERNAME -c "screen -p 0 -S minecraft -X stuff "stop"" su - $USERNAME -c "screen -p 0 -S minecraft -X stuff `echo '\015'`" sleep 7 else echo "$SERVICE was not running." fi if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE could not be shut down... still running." else echo "$SERVICE is shut down." fi } mc_update() { if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE is running! Will not start update." else su - $USERNAME -c "cd $MCPATH && cp -r world world_`date "+%d.%m.%Y"`" su - $USERNAME -c "cd $MCPATH && mv minecraft_server.jar "minecraft_server_`date "+%d.%m.%Y"`.jar"" su - $USERNAME -c "cd $MCPATH && wget http://www.minecraft.net/download/minecraft_server.jar?v=1289500485639" su - $USERNAME -c "cd $MCPATH && mv minecraft_server.jar?v=1289500485639 minecraft_server.jar" fi } #Start-Stop here case "$1" in start) mc_start ;; stop) mc_stop ;; restart) mc_stopThis script works correctly but i want to send commands and i don't know how i could do it
Thaks
I am using this code as well. I hope you have changed the USERNAME and MCPATH in that script to your own.
To send commands you just have to type in ssh either:-
Depending on what you want to do. Hope that answers your question.
I am running Debian Lenny. When I run the server starts and i have confirmed that the process is running but it doesn't get listed on http://www.minecraft.net/servers.jsp.
Also get the following error when trying to stop/restart the server:-
So I have to shutdown using which isn't a big deal really.
works fine.
Server runs fine and gets listed when I run it this way:-
But I need it running properly as a service.
Any ideas? Thanks