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

CentOS7 #170

Open
DenValk opened this issue Oct 10, 2014 · 5 comments
Open

CentOS7 #170

DenValk opened this issue Oct 10, 2014 · 5 comments

Comments

@DenValk
Copy link

DenValk commented Oct 10, 2014

Doesn't work well in CentOS7. Generates PID file but wont launch server on boot. Works fine when started manually (service minecraft start).

@shakeyourbunny
Copy link

No wonder, CentOS 7 switched to "the future of init systems" and is not compatible with "old useless System V Init" due to a whole incompatible way of booting the distribution :)

@DenValk
Copy link
Author

DenValk commented Oct 14, 2014

I actually made work around that I will submit/post when I get home. A couple links have to be changed, but other than that it works just fine.

---- On Tue, 14 Oct 2014 03:21:15 -0700 shakeyourbunny <[email protected]> wrote ----

No wonder, CentOS 7 switched to "the future of init systems" and is not compatible with "old useless System V Init".
minecraft-init would need a rewrite from scratch and this won't (hopefully) happen.

Reply to this email directly or view it on GitHub.

@DenValk
Copy link
Author

DenValk commented Oct 14, 2014

So, changes I had to make to get it to run on CentOS7.

In minecraft I changed each occurence of /etc/init.d to $SRVPATH

In config, I added the following lines

Path to Service Location --typically "/etc/init.d"

SRVPATH="/srv/mcsrv"

I created the file minecraft.service in /etc/systemd/system. The file contains:

[Unit]
Description=MineCraft Server
Requires=network.target
After=network.target

[Service]
User=mcserver
ExecStart=/srv/mcsrv/minecraft start
ExecStop=/srv/mcsrv/minecraft stop
Type=forking
GuessMainPID=true

[Install]
WantedBy=multi-user.target

and executed of course
ln -s /home/MCUSER/MCPATH/minecraft /srv/mcsrv/minecraft

It seems to be working well.

I may make some more edits and clean things up later.

@Leopere
Copy link

Leopere commented Feb 25, 2015

Did these changes get accepted? I would love to have this work with systemd I feel like it adds the final missing piece for the uptime puzzle. May I suggest inclusion of the "restart=" directive?

@DenValk
Copy link
Author

DenValk commented Feb 25, 2015

I didn't. Before I really got into it, I started my Ph.D. program, and I haven't played but a few hours of any game, let alone manage my server since. Feel free to clean it up, give it some polish, and submit it yourself if you like. I like the idea of including the "restart=" directive.

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

3 participants