MinecraftServerControl / mscs

Powerful command-line control for UNIX and Linux powered Minecraft servers
https://minecraftservercontrol.github.io
BSD 2-Clause "Simplified" License
479 stars 61 forks source link

/usr/bin/which: no overviewer.py #339

Open morgantic opened 5 months ago

morgantic commented 5 months ago

I'm this issue with mscs:

$ mscs create testworld 25565
sudo: msctl: command not found

I tried the automatic installation first, and then re-tried with the manual installation, no luck.

$PATH seems fine as well:

$ echo $PATH
/home/opc/.local/bin:/home/opc/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
$ sudo echo $PATH
/home/opc/.local/bin:/home/opc/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin

When I try to run msctl directly I get this

[opc@minecraft-server-main mscs]$ msctl create testworld 25565
/usr/bin/which: no overviewer.py in (/home/opc/.local/bin:/home/opc/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
Creating Minecraft world: testworld.

I'm running the OCI with oracle linux if that help narrow down the issue, can someone help? Thanks!

sandain commented 5 months ago

Hi @morgantic.

I'm not sure what the issue is. It looks like you have things set up correctly. So, I'm just going to ask simple questions to see if we can find the issue together.

  1. What is the output of ls -la /usr/local/bin/msctl
  2. What is the output of ls -la /usr/local/bin/mscs
  3. What is the output of ls -la /opt/mscs
  4. Do you have Overviewer installed? If not, this error can be ignored if you don't want to use the mapping function
morgantic commented 5 months ago

Hi @sandain - I appreciate you taking your time to help me on this.

1.

$ ls -la /usr/local/bin/msctl
-rwxr-xr-x. 1 root root 127248 Feb 10 21:12 /usr/local/bin/msctl

2.

$ ls -la /usr/local/bin/mscs
-rwxr-xr-x. 1 root root 905 Feb 10 21:12 /usr/local/bin/mscs

3.

$ ls -la /opt/mscs
ls: cannot open directory '/opt/mscs': Permission denied
$ sudo !!
sudo ls -la /opt/mscs
total 12
drwx------. 2 minecraft minecraft  62 Feb 10 21:12 .
drwxr-xr-x. 5 root      root       60 Feb 10 21:12 ..
-rw-r--r--. 1 minecraft minecraft  18 Aug  2  2022 .bash_logout
-rw-r--r--. 1 minecraft minecraft 141 Aug  2  2022 .bash_profile
-rw-r--r--. 1 minecraft minecraft 376 Aug  2  2022 .

4. I don't think I have overviewer installed, because I don't know what it is. From what I can find on google, it's a mapper / online map? But I'll just ignore it then, thanks!

sandain commented 5 months ago

That all looks good. How about the following?

  1. sudo "PATH=$PATH" -u minecraft -H which msctl
  2. sudo "PATH=$PATH" -u minecraft -H which mscs
morgantic commented 5 months ago
$ sudo "PATH=$PATH" -u minecraft -H which msctl
/usr/local/bin/msctl

and

$ sudo "PATH=$PATH" -u minecraft -H which mscs
/usr/local/bin/mscs
sandain commented 5 months ago

I don't know why it is not working. Very odd. Maybe modify the mscs script to use the full path to msctl:

#!/bin/sh
### BEGIN INIT INFO
# Provides:       mscs
# Required-Start: $remote_fs $syslog
# Required-Stop:  $remote_fs $syslog
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# chkconfig:      345 50 50
# Description:    Minecraft Server Control Script
### END INIT INFO

# This is a wrapper to msctl that imitates traditional mscs behaviour:
# uses the same default user, config file and location.

# Get executable name
PROG=$(basename $0)

# Setup the default user name.
USER_NAME="minecraft"

# Setup the default installation location.
LOCATION="/opt/mscs"

# Setup the default location of the mscs.defaults file.
MSCS_DEFAULTS="$LOCATION/mscs.defaults"

# Setup the arguments to the msctl script.
MSCS_ARGS="-p $PROG -l $LOCATION -c $MSCS_DEFAULTS $@"

# Run the msctl script.
if [ "$USER_NAME" = "$(whoami)" ]; then
  /usr/local/bin/msctl $MSCS_ARGS
else
  sudo "PATH=$PATH" -u $USER_NAME -H /usr/local/bin/msctl $MSCS_ARGS
fi