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

exiting on ubuntu 18.04 without sudo command #86

Closed
ghost opened this issue May 21, 2021 · 1 comment · Fixed by #88
Closed

exiting on ubuntu 18.04 without sudo command #86

ghost opened this issue May 21, 2021 · 1 comment · Fixed by #88
Assignees

Comments

@ghost
Copy link

ghost commented May 21, 2021

"Minecraft Bedrock Server installation script by James Chambers
Latest version always at https://github.com/TheRemote/MinecraftBedrockServer
Don't forget to set up port forwarding on your router! The default port is 19132
This script is not meant to be ran as root or sudo. Please run normally with ./SetupMinecraft.sh. If you know what you are doing and want to override this edit this check out of SetupMinecraft.sh. Exiting..."

Show this on Ubuntu 18.04 using root account without sudo command.

sparagi added a commit to sparagi/MinecraftBedrockServer that referenced this issue May 31, 2021
When exiting due to the guard clause that prevents running
SetupMinecraft.sh as root, explain what to do to "run normally".

Do not mention that knowledgeable admins can remove this check; they
already know this, and it is likely to confuse newer admins.

Minor grammar fixes included.

Fixes TheRemote#86.
@sparagi
Copy link
Contributor

sparagi commented May 31, 2021

This is intended behavior. Here is the relevant part of the error message, emphasis mine:

"This script is not meant to be ran as root or sudo."

However, the instructions for what to do instead ("Please run normally") are unclear for new admins, who may not be aware that being root & running a command and running a command using sudo are very similar. Like the OP, they don't have enough context information to guess that "please run normally" means "please run as a user who isn't root".

I suggest this error message instead:

This script is not meant to be run as root. Please run ./SetupMinecraft.sh as a non-root user, without sudo; the script will call sudo when it is needed.

I would remove the instructions "for those who know what they are doing"; anyone who needs to run SetupMinecraft.sh as root will think of deleting the check. And if they do delete the check, they will also need to make other changes, like not automatically overwriting their changes with the latest version of the script. Since it is not reasonable to list everything they might need to change, and the scripts seem well-documented, I think it is reasonable to leave these folks to their own devices.

Pull request attached.

@TheRemote TheRemote self-assigned this May 11, 2022
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

Successfully merging a pull request may close this issue.

2 participants