Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
morgantic opened this issue Feb 10, 2024 · 5 comments
Open

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

morgantic opened this issue Feb 10, 2024 · 5 comments

Comments

@morgantic
Copy link

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
Copy link
Member

sandain commented Feb 13, 2024

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
Copy link
Author

morgantic commented Feb 13, 2024

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

$ ls -la /usr/local/bin/msctl
-rwxr-xr-x. 1 root root 127248 Feb 10 21:12 /usr/local/bin/msctl
$ ls -la /usr/local/bin/mscs
-rwxr-xr-x. 1 root root 905 Feb 10 21:12 /usr/local/bin/mscs
$ 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 .

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
Copy link
Member

sandain commented Feb 13, 2024

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
Copy link
Author

$ 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
Copy link
Member

sandain commented Feb 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants