View previous topic :: View next topic |
Author |
Message |
SkyTanks n00b
Joined: 09 Feb 2011 Posts: 2
|
Posted: Mon Feb 14, 2011 5:47 am Post subject: Minecraft-Server |
|
|
Seriously kudos for the ebuilds. But I do have one question about the minecraft-server tmux daemon.
After years of using screen, I'm having a little trouble with tmux as no matter where I look, I can't connect to the session.
I'm a little tired of running around for the answer, and could you tell me the exact command I should enter to reattach the session? |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Mon Feb 14, 2011 9:18 am Post subject: |
|
|
The minecraft-server-console script does that for you. I didn't expect people to have to read about tmux.
WastingBody, I'll get back to you on that. |
|
Back to top |
|
|
SkyTanks n00b
Joined: 09 Feb 2011 Posts: 2
|
Posted: Mon Feb 14, 2011 12:46 pm Post subject: |
|
|
Thank you much for the quick reply.
And by the way, never underestimate a Gentoo user's ability to overcomplicated things. |
|
Back to top |
|
|
XQYZ Apprentice
Joined: 19 Jul 2009 Posts: 231 Location: Europe
|
Posted: Mon Feb 14, 2011 12:52 pm Post subject: |
|
|
Chewi wrote: | Okay, I'll take your word for it and have committed that change. Please let me know immediately if it doesn't fix the problem or if anything else breaks. |
Did not fix the problem completely for me. Seems to be less now though, but considering that I don't now exactly how to reproduce it, I can't make any certain statements. Generally though it used to be like 1-2/hour and now it happened twice since you patched it. |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Mon Feb 14, 2011 1:03 pm Post subject: |
|
|
XQYZ wrote: | Chewi wrote: | Okay, I'll take your word for it and have committed that change. Please let me know immediately if it doesn't fix the problem or if anything else breaks. |
Did not fix the problem completely for me. Seems to be less now though, but considering that I don't now exactly how to reproduce it, I can't make any certain statements. Generally though it used to be like 1-2/hour and now it happened twice since you patched it. |
Thanks for letting me know. Even if it hasn't really improved, it hasn't got any worse either so I'll keep the update. |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Mon Feb 21, 2011 12:25 am Post subject: |
|
|
Just warning you guys to say that the upcoming update with the new launcher will probably break things horribly. I'm not sure if they're going to deploy the launcher automatically somehow or force everybody to redownload. I'm also not sure whether the old launcher will still work for a time and whether it will even be feasible to disable the library installation as we have been doing so far. |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Mon Feb 21, 2011 11:37 pm Post subject: |
|
|
Well whaddya know, the same hack still works with no modifications whatsoever! Brilliant! Even the "Force Update" option doesn't break it. The overlay has now been updated. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Wed Feb 23, 2011 10:19 pm Post subject: |
|
|
Nope, it's broken
Code: | 100%[======================================>] 89,406 223K/s in 0.4s
2011-02-23 22:17:23 (223 KB/s) - `/var/cache/paludis/distfiles/minecraft-20110221.jar.-PARTIAL-' saved [89406/89406]
Checking 'minecraft-20110221.jar'... incorrect size |
|
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Wed Feb 23, 2011 11:30 pm Post subject: |
|
|
Damn, they updated it again already! Can't be helped. I would commit the change now but their authentication server is down again. I want to check it works first.
EDIT: At least there was a half-decent reason for the update. They had accidentally introduced some Java 1.6 dependencies, which is a problem for OS X users. This update removes them. |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Thu Feb 24, 2011 8:38 pm Post subject: |
|
|
Okay, it works. Now committed. |
|
Back to top |
|
|
d_logan n00b
Joined: 09 May 2006 Posts: 73
|
Posted: Sat Feb 26, 2011 2:43 pm Post subject: |
|
|
Does the new ebuild use the new launcher? I'm asking before I install because the new launcher is full of fail. |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Sat Feb 26, 2011 2:56 pm Post subject: |
|
|
It does. They don't keep old versions around so I didn't have much choice. The new features seem a little pointless but I haven't had any trouble with it. What's the problem? |
|
Back to top |
|
|
d_logan n00b
Joined: 09 May 2006 Posts: 73
|
Posted: Sat Feb 26, 2011 5:23 pm Post subject: |
|
|
It almost always fails to authenticate (new https they implemented), which is fine if you're just playing single player offline, but I host a small server and don't want to turn auth off and let jackasses grief me. I switched back to using the old launcher and it usually works, unless the site is down which it appears to be again today. Those guys should put their site on a Gentoo box |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Sat Feb 26, 2011 5:25 pm Post subject: |
|
|
I had noticed that it almost always fails to authenticate but I thought they were just overloaded as usual, not because they'd switched to HTTPS. Hopefully they'll get their act together soon, they can't leave it like this. |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Sat Feb 26, 2011 5:43 pm Post subject: |
|
|
I tried to see if replacing the string "https://login.minecraft.net/" inside LauncherFrame.class with http:// would work. Well it didn't NOT work but https:// is also working for me at the moment so I'm not entirely sure it made any difference. Even if that works, I'm not sure if I want to make the change. I'll see how it goes. |
|
Back to top |
|
|
d_logan n00b
Joined: 09 May 2006 Posts: 73
|
Posted: Sat Feb 26, 2011 6:27 pm Post subject: |
|
|
I got in and played for a few minutes, disconnected for lunch now it's down again. I'm not gonna pretend to understand how a million potential users trying to login can pound on a server, I've never had anything nearly that scale, but what's up w/ Amazon S3? Their super cloud based servers can't handle some minecraft auth? Sad. |
|
Back to top |
|
|
Sawn n00b
Joined: 19 Aug 2007 Posts: 18 Location: Reims, France. Yeah...the country ruled by a ridiculous dwarf.
|
Posted: Thu Mar 03, 2011 2:49 pm Post subject: |
|
|
Hi,
I'm trying to make my first ebuild based on yours except mine will setup a Minecraft-Bukkit server.
I will also manage wrappers/plugins via USE flags (for the mods I'm using) and make an initrd script to allow more functions like 'console' (server console access), 'stop'/'restart' (with ingame warning), 'backup' (with ingame warn too), 'update' (to update only the server jar file), 'reload-plugins' (to issue a 'reload into the server console), 'exec' (executing console command), etc. [If I can manage to ^^]
I have many ideas (but almost no skill )
I'm not searching to follow Gentoo or GNU/Linux guidelines on this since it's for my personnal use but I'll "release" the ebuild if someone's interested.
I've just one very noobish question, is it possible to prevent the server jar file to install into "/usr/share/minecraft-bukkit-server/lib/" ?
Don't like this path, it'll be simplier for me to manage the web interface wrapper if the script was in /var/lib/${PN}/<server instance> like the other files.
Is there a clean way to do that ?
I looked at java-pkg-2 and games_pkg eclass but couldn't understood them
Thanks for any answer and for your ebuild _________________ Born Loser. |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Thu Mar 03, 2011 3:30 pm Post subject: |
|
|
I don't mean to put a dampener on this but I stopped doing any work involving Bukkit as soon as it became clear that there were big legal obstacles in the way. You're welcome to pursue this if you want but if free software means anything to you, I suggest you wait. They seem to be resolving the issue slowly but surely.
I did try to use the init script to provide console access instead of the "minecraft-server-console" command I came up with but a bug in OpenRC prevented this from working. It looks like this bug may now be fixed though. I guess those other commands could be useful in conjuction with a cron job. Then again, aren't there plugins that do that sort of thing on a timed basis already? Maybe not. I haven't actually used Bukkit yet so I'm not familiar with all the plugins that are available.
It is possible to install the JAR files elsewhere while still using java-pkg-2 but I wouldn't do it without good reason. Symlinks are your friend and Gentoo's Java stuff will set up the correct classpath for you if you use it properly.
The games eclass is quite straightforward, it mainly just wraps the regular functions to install stuff in /usr/games. The Java eclasses are very complicated and take some time to learn. My experience comes from having had commit access to java-overlay for years. Nevertheless, I highly recommend that you do use them otherwise you'll just end up in a mess. |
|
Back to top |
|
|
Sawn n00b
Joined: 19 Aug 2007 Posts: 18 Location: Reims, France. Yeah...the country ruled by a ridiculous dwarf.
|
Posted: Thu Mar 03, 2011 3:53 pm Post subject: |
|
|
Yeah i'm aware of the licensing issues but the software is nice, i don't want to work on the vanilla server which is too limited for my use and with hMod dying there is no many other alternatives.
But I understand and respect your point of view
Did'nt know for the OpenRC bug... I'll see if I can achieve this or not
Yeah, I know there are current solutions to do backups and everything but none of them use rdiff-backup which is perfect for a Minecraft server in my opinion
Also, I prefer to manage backups with my own script.
You made your point for the jar path, I'll just use a symlink then
Thank you for the answers.
EDIT: Hum. Yeah, i've answered too fast. Free software means something to me and I didn't took enough time to read about this licensing issue (I though it was almost dealed with Mojang but, even if there seems to have a tolerance for Bukkit and even if Bukkit is contributing to Minecraft vanilla there is nothing official right now so i'll stick to the official server for the time being.
It'll give me the time to learn about ebuild writing
Thanks for pointed that out Chewi _________________ Born Loser. |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Thu Mar 03, 2011 10:08 pm Post subject: |
|
|
You're welcome. You've got a good attitude.
If you're wondering, the OpenRC bug was that whenever you invoked an init script as a non-root user, it would result in 100% CPU usage and never returned, even for a command that didn't require you to be root like describe.
I'm a big fan of rdiff-backup so that idea is cool. You're right, it's perfectly suited. |
|
Back to top |
|
|
DarkMoon74 n00b
Joined: 05 Mar 2011 Posts: 15 Location: Brisbane, Queensland, Australia
|
Posted: Sat Mar 05, 2011 11:00 am Post subject: |
|
|
If I understand things correctly, this e-build needs baselayout 2? I'm on baselayout 1, and I'm getting:
jmoe@dream /etc/init.d $ sudo ./minecraft-server start
* Starting Minecraft server "main" ...
./minecraft-server: line 24: ewaitfile: command not found
From what I can tell, that function should be defined in /etc/init.d/functions.sh, but it's not. I assume that's because it needs BL2? Might want to put a dependency in for that, or do like some other initscripts do and detect that BL1 is in use, and warn that it needs BL2? |
|
Back to top |
|
|
Chewi Developer
Joined: 01 Sep 2003 Posts: 886 Location: Edinburgh, Scotland
|
Posted: Sat Mar 05, 2011 4:25 pm Post subject: |
|
|
Sorry about that. I haven't use baselayout 1 for years. It feels so long ago, I was probably using the alpha versions of 2 back in 2007. I grepped the Portage tree to see what else uses ewaitfile and only dev-db/mysql-init-scripts came up. That's where I learnt about the command in the first place! It depends on OpenRC, which is what actually provides ewaitfile so that's what I've done.
Using ewaitfile is actually less than ideal. What I intend to do is wrap the server with Apache Daemons, which will allow it to be stopped safely, but I'm waiting to see what happens with Bukkit first. |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1582 Location: Adelaide/Australia
|
Posted: Tue Mar 22, 2011 5:05 am Post subject: Minecraft server startup scripts for baselayout-1 |
|
|
FYI: I have not dug into what the ebuild contains, but I thought I would share these - they are derivatives of http://www.minecraftforum.net/viewtopic.php?f=10&t=23122&start=150
It is very simple, it works for me.
In this situation, the actual Server JAR is located in /usr/local/bin, if you store it somewhere else, you will need to tweak the scripts.
Basically, I expect a user called 'games' to exist and that the world for the server is in /var/db/minecraft - called 'world' - put your favorite world in there.
All the server data files, including /var/db/minecraft directory are group games, with group write.
Pre-create a file called /var/log/minecraft.log and change it's group to 'games' and make it group writable.
Additionally, we end up with a 'control FIFO' at /var/db/minecraft/control
Once these scripts are in place, you can add minecraft to your default runlevel to boot a minecraft server on start.
Code: | rc-update add minecraft default |
Additionally, if you feel the need, you can send 'control messages', eg. Code: | echo "help" > /var/db/minecraft/control |
Control messages can be anything the server understands, you can monitor the output by simply Code: | tail -f /var/log/minecraft.log |
This script is /usr/local/bin/Minecraft_Server_NoGUI.sh
Code: |
#!/bin/bash
runDir=$(dirname ${0})
worldDir=/var/db/minecraft
controlPipe="${worldDir}/control"
if [ -d ${worldDir} ]
then
cd ${worldDir}
else
echo "${worldDir} directory does not exist - abort."
exit 1
fi
# xterm -e "java -Xmx1024M -Xms1024M -jar \"${runDir}/Minecraft_Server.jar\" nogui"
SRV_PID=""
finished()
{
if [ "${SRV_PID}" != "" ]
then
echo "stop" >&3
wait $SRV_PID
rm "${controlPipe}"
else
echo "** No SERVER PID **" >&2
fi
exit 0
}
trap 'finished' TERM INT
rm -f "${controlPipe}"
mkfifo "${controlPipe}"
chmod g+rw,o-rw,u=rw "${worldDir}/control"
#chown root:games "${worldDir}/control"
exec 3<> "${controlPipe}"
java -Xmx1024M -Xms1024M -jar "${runDir}/Minecraft_Server.jar" nogui <&3 >> /var/log/minecraft.log 2>&1 < "${worldDir}/control" &
SRV_PID=$!
wait $SRV_PID
# should never get here.
exit 0
|
This script is /etc/init.d/minecraft
Code: |
#!/sbin/runscript
depend() {
need net
after logger
after xdm
}
start() {
if [ -x /usr/local/bin/Minecraft_Server_NoGUI.sh ]
then
ebegin "Starting Minecraft Server"
start-stop-daemon --start --background --make-pidfile --pidfile /var/run/minecraft/server.pid --chdir /var/db/minecraft --chuid games --exec /usr/local/bin/Minecraft_Server_NoGUI.sh
eend $?
fi
}
stop() {
if [ -x /usr/local/bin/Minecraft_Server_NoGUI.sh -a -r /var/run/minecraft/server.pid ]
then
ebegin "Stopping Minecraft Server"
start-stop-daemon --stop --pidfile /var/run/minecraft/server.pid --retry TERM/100
eend $?
fi
}
restart() {
stop;
start;
}
status() {
if [ -x /usr/local/bin/Minecraft_Server_NoGUI.sh -a -r /var/run/minecraft/server.pid ]
then
if [ -r /proc/$(</var/run/minecraft/server.pid) ]
then
echo "Minecraft Server is running."
else
echo "Minecraft Server is not running."
fi
else
echo "Minecraft Server is not running."
fi
}
|
_________________ ...Lyall |
|
Back to top |
|
|
Spiesus n00b
Joined: 29 Mar 2011 Posts: 7 Location: Toledo, OH
|
Posted: Wed Mar 30, 2011 12:00 am Post subject: |
|
|
I am looking at adding backup functionality to my server based on this ebuild.
The issue I have is I have no idea about tmux that much and my quick glance at the man page did me no good. Basically what I want to do is pass commands into tmux to issue a command or two (like save-off and save-on). I looked on the minecraft wiki (http://www.minecraftwiki.net/wiki/Server_startup_script) at their init script to get a bit of an idea on how they did it and being that it was with screen (something else I have never used...) I was hoping that someone can shed some light on my issue.
I will continue to look through the man pages but hopefully someone can come up with a quick tip for me.
Thanks |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1582 Location: Adelaide/Australia
|
Posted: Wed Mar 30, 2011 7:31 am Post subject: |
|
|
Did I forget to mention in my post about starting a minecraft server, that you can send console commands to the server?
I have an hourly crontab entry which saves the world.
Code: | @hourly [ -r /var/db/minecraft/control ] && echo "save-all" > /var/db/minecraft/control
|
Any other console commands you could normally do in the GUI version are available using the same technique, simply echo them into /var/db/minecraft/control
You can ban, add ops, give, teleport, etc. If you want to see the output, simply have an xterm that does a Code: | tail -f /var/log/minecraft.log |
It would be relatively simple to have a menu driven control script, a bit like the following :-
Code: | #!/bin/bash
ServerRoot="/var/db/minecraft"
ServerControl="${ServerRoot}/control"
# sourced from http://www.minecraftwiki.net/wiki/Data_Values
itemDB="${ServerRoot}/item.db"
ServerLog="/var/log/minecraft.log"
function control()
{
echo "$*"
echo "$*" > "${ServerControl}"
sleep 1
tail "${ServerLog}"
}
while true
do
read -p "Command (q=quit): " command
case "${command}" in
l* )
firefox "http://www.minecraftwiki.net/wiki/Data_Values"
;;
p* )
control "list"
;;
g* )
giveWhat=""
toWhom=""
itemCode=""
howMany=""
while true
do
read -p "Give what? " giveWhat
grep -i "${giveWhat}" "${itemDB}"
itemCount=$(grep -i "${giveWhat}" "${itemDB}" | wc -l)
if [ "${itemCount}" -gt 1 ]
then
echo "Be more precise - try again."
continue
fi
read -p "Correct (y/n) ? " correct
case "${correct}" in
y | yes )
itemCode=$(grep -i "${giveWhat}" "${itemDB}" | cut -f1 -d:)
break
;;
esac
done
read -p "How many? " howMany
read -p "To whom? " toWhom
if [ "${toWhom}" != "" ]
then
control "give ${toWhom} ${itemCode} ${howMany}"
fi
;;
q* )
echo "Bye."
break
;;
?|h* )
echo "list - opens browser to list of items."
echo "players - show on-line players."
echo "give - give an item to a player."
echo "? or help - this help."
echo "quit - exit this script."
;;
* )
echo "Invalid command. Try again."
;;
esac
done
|
which uses the following /var/db/minecraft/item.db
Code: | 1: smooth Stone
2: Dirt Block with Grass
3: Plain Dirt Block
4: Cobblestone
5: Wood (Plank)
6: Shrub
7: Adminium/bedrock
8: water (Spring)
9: water (Block)
10: Lava (Spring)
11: Lava (Block)
12: Sand
13: Gravel
14: Gold Ore Block
15: Iron Ore Block
16: Coal Block
17: Wood (Tree Trunk)
18: Leaf Block
19: Sponge
20: Glass
21: Unavailable (Red Cloth)
22: Unavailable (Orange Cloth)
23: Unavailable (Yellow cloth)
24: Unavailable (Lime cloth)
25: Unavailable (Green Cloth)
26: Unavailable (Aqua gree Cloth)
27: Unavailable (Cyan Cloth)
28: Unavailable (Blue Cloth)
29: Unavailable (Purple cloth)
30: Unavailable (Indigo cloth)
31: Unavailable (Violet Cloth)
32: Unavailable (Magenta Cloth)
33: Unavailable (Pink Cloth)
34: Unavailable (Black Cloth)
35: White Cloth
36: Unavailable (Grey Cloth?)
37: Yellow Flower
38: Red Rose
39: Brown Mushroom
40: Red Mushroom
41: Gold Block
42: Iron Block
43: Step Block (Double)
44: Step Block (Single)
45: Brick Block
46: TNT
47: Bookcase
48: Mossy Cobblestone
49: Obsidian
50: Torch
51: Fire
52: Pig Spawner (Mob Spawner)
53: Wooden Stairs
54: Treasure Chest
55: Redstone Dust (Wire)
56: Diamond (Ore Block)
57: Diamond (Solid Block)
58: Crafting Bench
59: Crops (like from a Seed)
60: Dirt Tilled
61: Furnace
62: Furnace (Burning)
63: Sign
64: Wood Door (Bottom Half)
65: Ladder
66: Rails
67: Cobblestone Stairs
68: Sign (Like on a Wall)
69: Lever
70: Pressure Plate (Stone)
71: Iron Door (Bottom half only)
72: Pressure Plate (Wooden)
73: Redstone (Ore Block)
74: Redstone (Ore Block, glowing)
75: Redstone torch (off state)
76: Redstone torch (on state)
77: Button
78: Snow (like ontop of a block)
79: Ice Block
80: Snow (Block)
81: Cactus Piece
82: Clay (Block)
83: Bamboo
84: Jukebox
256: Iron Spade
257: Iron Pickaxe
258: Iron Axe
259: Flint and Steel
260: Apple
261: Bow
262: Arrow
263: Coal
264: Diamond
265: Iron Ingot
266: Gold Ingot
267: Iron Sword
268: Wooden Sword
269: Wooden Spade
270: Wooden Pickaxe
271: Wooden Axe
272: Stone Sword
273: Stone Spade
274: Stone Pickaxe
275: Stone Axe
276: Diamond Sword
277: Diamond Spade
278: Diamond Pickaxe
279: Diamond Axe
280: Stick
281: Bowl
282: Mushroom Soup
283: Gold Sword
284: Gold Spade
285: Gold Pickaxe
286: Gold Axe
287: String
288: Feather
289: Gunpowder
290: Wooden Hoe
291: Stone Hoe
292: Iron Hoe
293: Diamond Hoe
294: Gold Hoe
295: Seeds
296: Wheat
297: Bread
298: Leather Helmet
299: Leather Chestplate
300: Leather Pants
301: Leather Boots
302: Chainmail Helmet
303: Chainmail Chestplate
304: Chainmail Pants
305: Chainmail Boots
306: Iron Helmet
307: Iron Chestplate
308: Iron Pants
309: Iron Boots
310: Diamond Helmet
311: Diamond Chestplate
312: Diamond Pants
313: Diamond Boots
314: Gold Helmet
315: Gold Chestplate
316: Gold Pants
317: Gold Boots
318: Flint
319: Pork
320: Grilled Pork
321: Paintings
322: Golden apple
323: Sign
324: Wooden door
325: Bucket
326: Water bucket
327: Lava bucket
328: Mine cart
329: Saddle
330: Iron door
331: Redstone
332: Snowball
333: Boat
334: Leather
335: Milk Bucket
336: Clay Brick
337: Clay Balls
338: Papyrus
339: Paper
340: Book
341: Slime Ball
342: Storage Minecart
343: Powered Minecart
344: Egg
2256: Gold Record
2257: Green Record
|
_________________ ...Lyall |
|
Back to top |
|
|
|