Skip to content

Commit 8118d10

Browse files
authored
Merge pull request #308 from iammattcoleman/monitor.pid-not-found
suppress error when crash detection is not used
2 parents 039051f + 7f8b265 commit 8118d10

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

msctl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,9 +1337,13 @@ stopServerMonitor() {
13371337
local WORLD_DIR MONITOR_LOG MONITOR_PID MONITOR_LOCK_FILE ACQUIRED_LOCK
13381338
WORLD_DIR="$WORLDS_LOCATION/$1"
13391339
MONITOR_LOG="$WORLD_DIR/logs/mscs.monitor.log"
1340-
MONITOR_PID=$(cat "$WORLD_DIR/monitor.pid")
13411340
MONITOR_LOCK_FILE="$WORLD_DIR/monitor.lock"
13421341
# Check if server monitor instance currently running.
1342+
MONITOR_PID_PATH="$WORLD_DIR/monitor.pid"
1343+
if [ ! -f "$MONITOR_PID_PATH" ]; then
1344+
return
1345+
fi
1346+
MONITOR_PID=$(cat "$MONITOR_PID_PATH")
13431347
(
13441348
$FLOCK -n 9
13451349
ACQUIRED_LOCK=$?

0 commit comments

Comments
 (0)