L2JMobius

Interlude Problem Starting the GameServer & LoginServer on Linux and How I Fixed It

apex · 2 · 1512

Offline apex

  • Vassal
  • *
    • Posts: 2
Hello everyone, I'm not sure if this post is in the correct topic, but I wanted to share what happened in my environment: Eclipse and tools for testing on Windows, production server on Linux Debian 12.

These past few days, I was setting up an L2JMobius server on a Linux environment, but I ran into a problem when trying to start the GameServer using the usual command:

Code: [Select]
./GameServer.sh
The system returned the following error:

Code: [Select]
bash: ./GameServer.sh: cannot execute: required file not found
After checking a few things, I tried running the script directly with bash and got another error:

Code: [Select]
./GameServer.sh: line 2: $'\r': command not found
./GameServer.sh: line 3: ./GameServerTask.sh: cannot execute: required file not found

At that point, I realized something strange was happening with the script files. 🤔

I ran the following command to check the file format:

Code: [Select]
file GameServer.sh GameServerTask.sh
It turned out that the files had incorrect line endings (CRLF instead of LF), which happens when scripts are edited on Windows and then uploaded to Linux.

Here’s the command output:

Code: [Select]
GameServer.sh: Bourne-Again shell script, ASCII text executable, with CRLF, LF line terminators
GameServerTask.sh: Bourne-Again shell script, ASCII text executable, with CRLF line terminators

This meant the files were still in Windows format, preventing the system from interpreting them correctly.


Solution: Convert the Files to Unix Format

Code: [Select]
dos2unix -f GameServer.sh GameServerTask.sh (do same to LoginServer)

If you dont have, you must Run: sudo apt install dos2unix (my case)


"I hope this helps you all."