-
Notifications
You must be signed in to change notification settings - Fork 2
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
Run from systemd unit file. #12
Comments
Hmm, interesting! The best bit of information about what's going on is in this log line:
Looking around the internet, I see a wide variety of possibilities for what that could mean.
Are there any logs from |
Hey, i know it's been a while since i posted. But. I got this working by simply using screen to open mc-server-wrapper in a active terminal session. I believe your package just exits once it sees that it's not running interactively(?) At least this is my theory. Here's the config i'm using rn.. It doesn't exit appropriately so systemd ends up waiting like 2 minutes during shutdown and kills the process.. that sucks.. I'm not enough of a systemd wizard to figure out a better solution : p
|
Oh neat! If I ever spend time on this project again I'll look into cleaning that up. I haven't played MC for a while so I don't have much of a reason to work on this tool. |
Hey I'm trying to run this from a systemd unit file on a up to date ubuntu server.
I previously used https://github.com/marcsello/minecraftd
So it's running from a specific user account and directory.
It sounds like the binary doesn't not like running from systemd for some reason. However if i run it manually from the "minecraft" user account in the /opt/minecraft folder your program works without issue(cool!)
Here's the issue i get for the systemd unit with debug systemd turned on:
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: Will spawn child (service_enter_start): /opt/minecraft/.cargo/bin/mc-server-wrapper
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: Passing 0 fds to service
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: About to execute /opt/minecraft/.cargo/bin/mc-server-wrapper
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: Forked /opt/minecraft/.cargo/bin/mc-server-wrapper as 1527
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: Changed dead -> running
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: Job 4668 mc-server-wrapper.service/start finished, result=done
Apr 02 02:59:29 minecraft systemd[1]: Started mc-server-wrapper.
░░ Subject: A start job for unit mc-server-wrapper.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit mc-server-wrapper.service has finished successfully.
░░
░░ The job identifier is 4668.
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: User lookup succeeded: uid=997 gid=998
Apr 02 02:59:29 minecraft systemd[1527]: mc-server-wrapper.service: Executing: /opt/minecraft/.cargo/bin/mc-server-wrapper
Apr 02 02:59:29 minecraft mc-server-wrapper[1527]: Error: Resource temporarily unavailable (os error 11)
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: Child 1527 belongs to mc-server-wrapper.service.
Apr 02 02:59:29 minecraft systemd[1]: mc-server-wrapper.service: Main process exited, code=exited, status=1/FAILURE
Here is my systemd unit file, I've tried different types, using simple and then not specifying it. I also tried specifying kill mode/killsignal and not using these options.
[Unit]
Description=mc-server-wrapper
After=network-online.target
[Service]
Type=simple
ExecStart=/opt/minecraft/.cargo/bin/mc-server-wrapper
WorkingDirectory=/opt/minecraft
Restart=always
User=minecraft
Group=minecraft
KillMode=process
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
The text was updated successfully, but these errors were encountered: