MinecraftServerControl / mscs

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

EL7 issues #142

Closed rrimc69 closed 7 years ago

rrimc69 commented 7 years ago

Hi, Thanks very much for your script and efforts. I've been using it for quite a while running on several Scientific Linux iterations, currently on 6.8. I've recently had the need to move my VM to a EL7 Centos base (clean, minimal, no desktop). I have discovered some issues with installing mscs. Hopefully I can contribute the beginnings of a fix ..

I have gotten current stable to work but the primary problem I encountered, for my EL7 build at least, is that sudo has it's own ideas on paths in the ENV. I received two errors, one for overviewer.py which I had to manually install due to no EL7 repo (nice dependency chase there too ... :/ ), the other from EL7 sudo when called within your script.

I could reliably find msctl and mscs in my user's path and root's path, and also when I used "su - minecraft". When I ran the mscs script however, sudo could not see the command and throws this error: sudo: mscs: command not found

This also appeared to effect your scripts view of overviewer.py, as it too could not be found, no user could find overviewer in their path for that matter. For my system overviewer lives in /opt/Minecraft-Overviewer/overviewer.py, and this error was presented: which: no overviewer.py in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin)

Again it seemed like a path issue. Searching with google I found references of sudo "culling" the paths within ENV, see here for one such reference: http://serverfault.com/questions/528096/sudo-passenger-memory-stats-command-not-found

My solution was following your "Manual Install" instructions to fix permissions, then symlinking mscs, msctl found in /usr/local/sbin/, and overviewer.py into /usr/sbin directory. I don't know what wider security implications that would have on use of your script for external facing hosts, but my instance will only ever be local so it works for me.

A couple of suggestions:

World imports worked like a charm, I look forward to tinkering with the new features.

Cheers,

Rory.

sandain commented 7 years ago

Hi @rrimc69. I'm glad you were able to figure out the issue and get the script working for you.

I haven't added a better link to the manual install instructions yet, but I did come up with a possible solution for your problem that doesn't seem to affect my install. Here is the patch:

diff --git a/mscs b/mscs
index 19a196f..74c7437 100755
--- a/mscs
+++ b/mscs
@@ -31,5 +31,5 @@ MSCS_ARGS="-p $PROG -l $LOCATION -c $MSCS_DEFAULTS $@"
 if [ "$USER_NAME" = "$(whoami)" ]; then
   msctl $MSCS_ARGS
 else
-  sudo -u $USER_NAME msctl $MSCS_ARGS
+  sudo "PATH=$PATH" -u $USER_NAME msctl $MSCS_ARGS
 fi

Let me know if something like that would work for you, and I'll send in the patch.

sandain commented 7 years ago

I just pushed commit c16068cc4086537c1860a6d4de1decc561c66f57 to the README file to make the manual instructions a little more prominent. I didn't add a link to the index, but if you think it would be useful I can. Let me know.

sandain commented 7 years ago

As to your other suggestions:

sandain commented 7 years ago

I've been running with this patch for 22 days now. I don't know if it fixes the issue brought up by @rrimc69, but it doesn't break my install. Does anyone have any issues with me just sending this patch in?

zanix commented 7 years ago

Seems ok to me

sandain commented 7 years ago

I went ahead and sent in the patch with commit 3544e45b51d8cce90c5cca85a395ff187d231325. Hopefully this fixes the problem noticed by @rrimc69. Closing this issue.

@rrimc69, if you come back and give this a test and it doesn't fix the problem feel free to reopen this issue.

rrimc69 commented 7 years ago

I shall, but life conspires to rob me of that, ... holidays are coming up though .. :)

On 22 December 2016 at 02:35, Jason M. Wood notifications@github.com wrote:

I went ahead and sent in the patch with commit 3544e45 https://github.com/MinecraftServerControl/mscs/commit/3544e45b51d8cce90c5cca85a395ff187d231325. Hopefully this fixes the problem noticed by @rrimc69 https://github.com/rrimc69. Closing this issue.

@rrimc69 https://github.com/rrimc69, if you come back and give this a test and it doesn't fix the problem feel free to reopen this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MinecraftServerControl/mscs/issues/142#issuecomment-268552515, or mute the thread https://github.com/notifications/unsubscribe-auth/AIU33BYJThnsN-ki3ErFDYQTu2wZvt0bks5rKUckgaJpZM4K47on .