For 1.3.1 the expected strings changed and on "stop" everything gets saved automatically.
So my proposed expect script would be:
_expectScript=$(cat << EOS
spawn attachtty "$_runDir/socket"
send "stop\r"
expect "Stopping server"
expect {
"Stopping server" {
exit 0
}
default {
exit 1
}
}
EOS
)
example log (10s gap due to old expect script):
2012-08-02 18:05:20 [INFO] Saving...
2012-08-02 18:05:20 [INFO] Saved the world
2012-08-02 18:05:30 [INFO] Stopping the server
2012-08-02 18:05:30 [INFO] Stopping server
2012-08-02 18:05:30 [INFO] Saving players
2012-08-02 18:05:30 [INFO] Saving worlds
2012-08-02 18:05:30 [INFO] Saving chunks for level 'mult10final'/xd@97919f6
2012-08-02 18:05:30 [INFO] Saving chunks for level 'mult10final'/xc@6d976a55
2012-08-02 18:05:30 [INFO] Saving chunks for level 'mult10final'/xe@6fc62aa8
2012-08-02 18:05:30 [INFO] Stopping server
log with my expect script:
2012-08-02 18:44:47 [INFO] Stopping the server
2012-08-02 18:44:47 [INFO] Stopping server
2012-08-02 18:44:47 [INFO] Saving players
2012-08-02 18:44:47 [INFO] Saving worlds
2012-08-02 18:44:47 [INFO] Saving chunks for level 'mult10final'/xd@c5f468
2012-08-02 18:44:47 [INFO] Saving chunks for level 'mult10final'/xc@3eb52a28
2012-08-02 18:44:47 [INFO] Saving chunks for level 'mult10final'/xe@67e2c841
2012-08-02 18:44:47 [INFO] Stopping server
Yes. "Stopping server" has to be expected twice.
Search Criteria
Package Details: minecraft-server 26.2-1
Package Actions
| Git Clone URL: | https://aur.archlinux.org/minecraft-server.git (read-only, click to copy) |
|---|---|
| Package Base: | minecraft-server |
| Description: | Minecraft server unit files, script, and jar |
| Upstream URL: | https://minecraft.net/ |
| Keywords: | bash minecraft official script server |
| Licenses: | custom |
| Conflicts: | minecraft-canary, minecraft-server-systemd |
| Submitter: | sorcix |
| Maintainer: | edh |
| Last Packager: | edh |
| Votes: | 171 |
| Popularity: | 0.26 |
| First Submitted: | 2010-11-29 15:52 (UTC) |
| Last Updated: | 2026-06-17 02:20 (UTC) |
Dependencies (8)
- awk (gawk-gitAUR, gawk)
- bash (bash-gitAUR, bash-devel-gitAUR)
- java-runtime-headless (jre10AUR, jre12AUR, jdk10AUR, jdk10-openj9-binAUR, jdk7AUR, jre7AUR, jdk16-adoptopenjdkAUR, liberica-jre-11-binAUR, jdk11-j9-binAUR, jre16-openjdk-headlessAUR, jre14-openjdk-headlessAUR, jre15AUR, jre14AUR, jre13AUR, jre16AUR, jre18-openjdk-headlessAUR, liberica-jre-11-full-binAUR, liberica-jre-8-full-binAUR, jre-openj9-headlessAUR, jre12-openjdk-headlessAUR, jdk11-dragonwell-standard-binAUR, jdk11-jetbrains-binAUR, jdk20-openj9-binAUR, zulu-13-binAUR, jdk8-dragonwell-extended-binAUR, jdk8-dragonwell-standard-binAUR, jdk11-dragonwell-extended-binAUR, jdk8-j9-binAUR, jdk7-j9-binAUR, jdk7r1-j9-binAUR, jre13-openjdk-headlessAUR, jre15-openjdk-headlessAUR, jre19-openjdk-headlessAUR, zulu-fx-binAUR, zulu11-fx-binAUR, zulu17-fx-binAUR, jre-zulu-binAUR, jre-zulu-fx-binAUR, jre17AUR, jre-zuluAUR, jre-zulu-fxAUR, jdk21-dragonwell-standard-binAUR, jdk23-temurinAUR, zing-23-binAUR, jdk17-dragonwell-standard-binAUR, jdk21-dragonwell-extended-binAUR, openjdk-zulu-ca-fx-binAUR, openjdk-zulu17-ca-fx-binAUR, openjdk-zulu21-ca-fx-binAUR, amazon-corretto-17AUR, amazon-corretto-21-binAUR, zulu-24-binAUR, liberica-nik-23-full-binAUR, liberica-nik-24-full-binAUR, liberica-nik-25-full-binAUR, amazon-corretto-24-binAUR, jdk8-openj9-binAUR, openjdk-liberica11-full-binAUR, openjdk-liberica17-full-binAUR, openjdk-liberica21-full-binAUR, openjdk-liberica8-full-binAUR, openjdk-liberica-full-binAUR, jdk-openjdk-wakefieldAUR, jre-openjdk-wakefieldAUR, jre-openjdk-wakefield-headlessAUR, amazon-corretto-15AUR, jre25-temurinAUR, jre21-temurinAUR, jre17-temurinAUR, zulu-jre21-fxAUR, zulu-jre25-fxAUR, zulu-jre17-fxAUR, jre8-temurinAUR, jre11-temurinAUR, zulu-jre8-fxAUR, zulu-jre11-fxAUR, microsoft-openjdk-21-binAUR, microsoft-openjdk-25-binAUR, microsoft-openjdk-17-binAUR, microsoft-openjdk-11-binAUR, amazon-corretto-25-binAUR, jdk8-perfAUR, jdk25-openjdk-wakefieldAUR, jre25-openjdk-wakefieldAUR, jre25-openjdk-headless-wakefieldAUR, zulu-26-fx-binAUR, jdk21-jetbrains-binAUR, liberica-jdk-21-binAUR, jdk16-temurinAUR, liberica-jdk-8-full-binAUR, jdk25-temurinAUR, jdk21-temurinAUR, jdk17-temurinAUR, jre22-openjdk-headlessAUR, jre22-openjdkAUR, jdk22-openjdkAUR, jre23-openjdk-headlessAUR, jre23-openjdkAUR, jdk23-openjdkAUR, jdk24-openjdkAUR, jre24-openjdkAUR, jre24-openjdk-headlessAUR, zulu-17-fx-binAUR, jdk11-temurinAUR, jdk17-openj9-binAUR, jdk21-openj9-binAUR, jdk11-graalvm-ee-binAUR, jdk8-graalvm-ee-binAUR, sapmachine11-jdkAUR, zulu8-fx-binAUR, zulu21-fx-binAUR, zulu-jre-fx-binAUR, zulu-jdk-fx-binAUR, jreAUR, jdkAUR, jre-ltsAUR, jdk-ltsAUR, jre21-zulu-binAUR, jre25-zulu-binAUR, jre17-zulu-binAUR, zulu-17-binAUR, zulu-21-binAUR, zulu-8-binAUR, zulu-11-binAUR, jdk-temurinAUR, zulu-25-binAUR, jre8AUR, jdk8AUR, jre11AUR, zing-17-binAUR, zing-8-binAUR, zing-21-binAUR, jdk17-jetbrains-binAUR, jdk-openj9-binAUR, jdk11-openj9-binAUR, liberica-jdk-full-binAUR, liberica-jdk-25-full-binAUR, liberica-jdk-21-full-binAUR, jre-jetbrainsAUR, jdk25-graalvm-binAUR, jdk25-graalvm-ce-binAUR, jdk25-jetbrains-binAUR, mandrel-binAUR, java-openjdk-ea-binAUR, jdk25-openj9-binAUR, java-openjdk-binAUR, amazon-corretto-11AUR, amazon-corretto-8AUR, sapmachine17-jdkAUR, liberica-jdk-11-full-binAUR, liberica-jdk-17-full-binAUR, liberica-jdk-11-binAUR, liberica-jdk-11-lite-binAUR, jdk-openjdk, jdk11-openjdk, jdk17-openjdk, jdk21-openjdk, jdk25-openjdk, jre-openjdk, jre-openjdk-headless, jre11-openjdk, jre11-openjdk-headless, jre17-openjdk, jre17-openjdk-headless, jre21-openjdk, jre21-openjdk-headless, jre25-openjdk, jre25-openjdk-headless, jre8-openjdk-headless)
- sed (sed-gitAUR, uutils-sedAUR)
- sudo (sudo-gitAUR, fudo-gitAUR, sudo-selinuxAUR, doas-sudo-shim-gitAUR, run0-sudoAUR, run0-sudo-shim-selinuxAUR, run0-sudo-shimAUR, run0-sudo-shim-gitAUR, doas-sudo-shimAUR, voixAUR, sudo-rs-system-names-gitAUR)
- tmux (tmux-sixel-gitAUR, tmux-gitAUR)
- netcat (gnu-netcat-svnAUR, gnu-netcatAUR, nmap-netcatAUR, openbsd-netcat-tlsAUR, openbsd-netcat-gitAUR, openbsd-netcat) (optional) – required in order to suspend an idle server
- tar (tar-gitAUR, uutils-tar-gitAUR) (optional) – needed in order to create world backups
Required by (0)
Sources (2)
Latest Comments
« First ‹ Previous 1 .. 25 26 27 28 29 30 31 32 33 34 35 .. 37 Next › Last »
JonnyJD commented on 2012-08-02 16:49 (UTC)
artemklevtsov commented on 2012-07-05 06:02 (UTC)
@Luigi_Panache: sorry for that, but it's effectively that post omments:)
SirPenguins commented on 2012-07-05 03:58 (UTC)
Updated, but please only use the Out-Of-Date flag for when there is a new software version, not for when there is improper packaging convention.
artemklevtsov commented on 2012-07-04 10:51 (UTC)
Service file should be in /usr/lib/systemd/system/
Update package please.
dvzrv commented on 2012-05-26 23:57 (UTC)
The unit file should be installed to /usr/lib/systemd/system
This is the default directory for unit files now.
SirPenguins commented on 2012-04-10 04:23 (UTC)
Yes, there certainly is. Besides the usual piping of the program, it is also possible to simply symlink /srv/minecraft/server.log to /var/log/minecraft.log (unless there's something bad about that practice that I don't know about.)
I plan to include that in the next revision of the package, just for you. :)
zosodk69 commented on 2012-04-09 21:08 (UTC)
Sir, one of the things I like about the minecraft-server package is the ability to log server output to a file under /var/log. Is there any way of achieving that behavior through the systemd package?
<deleted-account> commented on 2012-04-05 08:30 (UTC)
I did some testing and it does seem that most of the times expect misses the "Save complete.$" case and falls back to the default case.
"Save complete." without $ seems to work every time.
The default case is intended to shut down the server in case of a save-all failure (after a 10s timeout).
JonnyJD commented on 2012-04-05 00:49 (UTC)
expect {
"Save complete.$" {
exit [exitServer]
}
default {
exit [exitServer]
}
}
Doesn't wait for "Save complete" at all. It will exit right after it gets "Forcing save.." due to the default. Please skip the default. If Save complete is not matched expect will go on 10 seconds later.
However I only got "Save complete." to work (without $). Something about expect not beeing line based, I guess.
This is not that bad because exitServer does expect "Saving Chunks", but then having expect at all after "save-all" doesn't help.
Pinned Comments
edh commented on 2016-06-18 18:24 (UTC) (edited on 2021-10-02 08:19 (UTC) by edh)
To get an overview of the available options provided by the management script, be sure to have a look at the help page or read the according section on the ArchWiki article [1].
You can quit the console without shutting down the server by press ctrl+a d (first ctrl+a and after releasing the buttons press d; ctrl+b also works). This will detach your input from the server console. The attaching and detaching is done with tmux (previously GNU screen) since it lets you view and type into the console, send single commands to it and keep it alive without a connected user. Take a look at the the command overview at the ArchWiki [2] to get a feel for its power. (@carmelo12341)
[1] https://wiki.archlinux.org/title/Minecraft#Setup [2] https://wiki.archlinux.org/title/Tmux