Server failing to restart (session.lock)
Greetings, I've managed to get the server set up and working except for the one small thing, when server tries to restart - it generates a session.lock files in all worlds and it fails to restart. I'm thinking the issue could be due to my launch scripts. This is what I'm currently running:
start.sh //
#!/bin/sh
# Define the screen session name
SESSION_NAME="mc_spigot_server"
# Check if a screen session with the specified name already exists
if screen -list | grep -q "$SESSION_NAME"; then
echo "Killing existing screen session: $SESSION_NAME"
screen -S "$SESSION_NAME" -X quit
fi
# Start a new screen session with the specified name
echo "Starting new screen session: $SESSION_NAME"
screen -d -m -S "$SESSION_NAME" ./startserver.sh
startserver.sh //
#!/bin/bash
JAR=server.jar
MAXRAM=12884M
MINRAM=8192M
TIME=10
while [ true ]; do
java -Xmx$MAXRAM -Xms$MINRAM -jar $JAR nogui
if [[ ! -d "exit_codes" ]]; then
mkdir "exit_codes";
fi
if [[ ! -f "exit_codes/server_exit_codes.log" ]]; then
touch "exit_codes/server_exit_codes.log";
fi
echo "[$(date +"%d.%m.%Y %T")] ExitCode: $?" >> exit_codes/server_exit_codes.log
echo "----- Press enter to prevent the server from restarting in $TIME seconds -----";
read -t $TIME input;
if [ $? == 0 ]; then
break;
else
echo "------------------- SERVER RESTARTS -------------------";
fi
done
Has anybody encountered a similar issue, and if so - would you please help me out?
Big thanks! 😄4 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by gamashiki#0
from the looks of it, you're immediately killing the server
instead of running
stop
on the mc server itself, which saves chunks and clears the session.lock
you can just delete the session.lock
file and you should be able to start up, but you're likely to encounter the same issue againI think what caused the issue was the fact that I've forgot to chmod the launch scripts - now it seems to be working both on /stop and /reset
It no longer seems to be generating session.lock files.
Thank you for the help! 😄
!solved
post closed!
The post/thread has been closed!
Requested by gamashiki#0