GithubHelp home page GithubHelp logo

seyfahni / minecraft-server-scripts Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 2.0 67 KB

Linux shell scripts and systemd units to help with setting up and maintaining minecraft servers.

License: MIT License

Shell 89.25% R 10.75%
minecraft minecraft-server shell shell-script shell-scripts systemd systemd-unit systemd-service systemd-timer setup

minecraft-server-scripts's People

Contributors

roxeteer avatar seyfahni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

roxeteer kropto

minecraft-server-scripts's Issues

Ubuntu cannot use [email protected]

@roxeteer reported in #2, about bd72db5:

Didn't actually manage to get the latest version to run on a new Ubuntu server at all […]. Downgraded to the previous version that I already had running on a different server, and that worked without a hitch.

This is what the master version status said:

$ minecraftctl status mine2
● [email protected] - Minecraft Dedicated Server mine2
   Loaded: loaded (/etc/systemd/system/[email protected]; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2021-05-24 17:29:12 CEST; 37s ago
  Process: 5551 ExecStop=/usr/bin/screen -S minecraft-mine2 -p 0 -X stuff stop^M (code=exited, status=1/FAILURE)
  Process: 5548 ExecStart=/usr/bin/screen -dmS minecraft-mine2 -- $JAVA_RUNTIME -server -Xms2G -Xmx2G -XX:+UseG1GC
 Main PID: 5549 (code=exited, status=0/SUCCESS)

Minecraft user is not able to execute `minecraftctl start {instance name}` without root password prompt

Hi,

What permissions does the minecraft user need?

I've got the user set up using useradd --system --no-create-home --home /opt/minecraft -g minecraft minecraft yet when executing minecraftctl start {instance name} either with the user minecraft or root I get the following prompt.

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'minecraft@{instance name}.service'.
Authenticating as: root
Password:

To get around this online sources mention the use of a sudoers entry, which I've tried the below as a catch-all for the moment yet it didn't work.

%minecraft ALL=(ALL) NOPASSWD:ALL

The only way I managed to get the script to run without the prompt is by using sudo and removing the below from minecraftctl

if [[ "$(id -un)" != "$MINECRAFT_USER" ]]; then
  sudo -n -u "$MINECRAFT_USER" "$SAFE_SELF" "$@"
  exit
fi

I'm sure I'm missing something,
Thanks in advance.

Linux version 5.4.0-77-generic (buildd@lgw01-amd64-028) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.