Giter VIP home page Giter VIP logo

minecraft-init-script's People

Contributors

occanowey avatar superjamie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minecraft-init-script's Issues

Any interest in backup to AWS S3 feature?

I've got a separate script that performs offsite backups to Amazon Web Services S3 on my server. Is this a feature that people want? Would a pull request be looked on favourably?

Not Starting with Ubuntu.

Hello.
(I'm sorry for my English, I'm french)
Thank you for this script, but it didn't start with Ubuntu. It works with a manual command ("minecraft start").
Have you an Idea ?

The Screen plays Hide & Seek

Hello guys !
I've got a problem, your Script can't start with my OS (Ubuntu Server 14.04) !
We can see this error in boot.log :
Cannot make directory '/var/run/screen': Permission denied

Google thinks that I use :
sudo /etc/init.d/screen-cleanup start
If I add this line in your Script, it works ! BUT : The Screen doesn't exist !!!
Why ?!?
And if I add : sleep 1, we have the same problem ?
What do you think ? Have you an Idea ?
Thanks.

Improve implicit sleeps

The script implicitly sleeps for a set amount of time, assuming that time is enough.

A better way would be to sleep in 1-second loops with a bound on the loop, eg:

+    C=0
+    while [ $C -lt 15 ]; do
+      C=$[C+1]
+      echo -n "."
+      if server_running
+      then
+        echo
+        echo " * [OK] $SERVERNAME is now running (pid $JAVAPID)."
+        exit 0
+      else
+        sleep 1
+      fi
+    done

Thanks to Jon Stephens for this idea.

Password Twenty Times For Commands?

This init script works really nice, except I can't open up the console. I do "minecraft console" and I get in return "Cannot open your terminal '/dev/pts/0' - please check." Is this me or the script?

It also seems to make me type in my password so many times for any command, but that might be my fault.

Settings file not working

I cant seem to get the settings file to work. i am running centOS 6 and i copy between the lines and paste it in a new file at /etc/default/minecraft. i run minecraft start and i get these errors:

[root@localhost ~]# minecraft start
: command not foundaft: line 2:
: command not foundaft: line 5:
: command not foundaft: line 8:
: command not foundaft: line 11:
: command not foundaft: line 14:
: command not foundaft: line 17:
: command not foundaft: line 20:
: command not foundaft: line 23:
: command not foundaft: line 26:
: command not foundaft: line 29:
: command not foundaft: line 31:
: command not foundaft: line 34:
: command not foundaft: line 38:
: command not foundaft: line 41:
: command not foundaft: line 44:
: command not foundaft: line 48:

  • [ERROR] Settings file /etc/default/minecraft is not applying. Can't run!
    Check your options are uncommented and you haven't copied the <<COMMENT block.

the lines seem to be where ever there is a blank space so i removed the spaces and i get this:

[ERROR] Settings file /etc/default/minecraft is not applying. Can't run!
Check your options are uncommented and you haven't copied the <<COMMENT block.

here is my settings file

image

Multiple server support

As it is mentionned in the title, it would be great to have a multi-server startup script.
Actually copying the script for each server raise the maintenance costs.

Take out log file logic

Upstream CraftBukkit now rotates and compresses its own logs into logs/latest.log and logs/YYYY-MM-DD-#.log so just remove all the logfile handling from the script.

Backup issue

If backup dir does not exist, it should be created.

[ERROR] Could not start MC Test Server.

I am fairly certain the error is from:

if server_running
then
echo " * [OK] $SERVERNAME is now running (pid $JAVAPID)."
else
echo " * [ERROR] Could not start $SERVERNAME.
exit 1
fi

I have gone through it several times and made sure that it is formatted correctly and as far as I can tell it is. The logic seems to be solid as well.

Help, please, if you are still paying attention to this.

Thanks!

centos 6 error

on centOS 6 i the following error when i run chkconfig --add minecraft.

error reading information on service minecraft: No such device

[ERROR] Could not start CraftBukkit

Hello! This is a fine script.

However.. I would like to find out what is stopping me from starting up the service. When I run service minecraft start I get the following:

* CraftBukkit was not already running. Starting...
 * Using map named "world"...
 * Checking CraftBukkit is running...
 * [ERROR] Could not start CraftBukkit.

Of course that's not very helpful. I can run the .jar file from the command line without any problems, and I have replaced the invocation for a simple one as: java -Xmx1024M -jar craftbukkit.jar -o true and still no luck :(

Is there any way to get a more verbose output and find out what's going on?

I'm running this on Ubuntu 13.10 with CraftBukkit 1.6.4-R2.
Thanks!

BungeeCord server support

I would be great to also support BungeeCord proxy.

It should not be hard, maybe using a flag to tell that you run Bungee to limit some commands.

No automatic start/stop on Ubuntu

When an Ubuntu 12.04.4 LTS server starts, the Minecraft server doesn't start automatically.

On shutdown, the following error is printed:

[error] settings file /etc/default/K20minecraft does not exit. Can't run !

Starting and stopping the service manually post-boot works.

This can be worked around by changing:

SETTINGSFILE="/etc/default/$(basename $0)"

to:

SETTINGSFILE="/etc/default/minecraft"

Add "minecraft say" support

Add in lorenzorota's "minecraft say" support from

Super Jamie, I created a new case statement for the initscript which I thought would be pretty useful for people who are not so familiar with the MC console or just prefer not using it.

So I added this function:

## Broadcasts a message something

mc_say() {
    s_string="${@:1}"
  if [[ -z "$s_string" ]]
  then
    echo " * You need to enter your message. Usage; \"minecraft say message\""
  elif server_running
  then
    echo " * Broadcasting \"$s_string\""
    as_user "screen -p 0 -S $SCRNAME -X eval 'stuff \"say $s_string\"\015'"
  else
    failure && echo " * $SERVERNAME was not running!"
    exit 1
  fi
}

Created this case statement:

  say)
mc_say ${@:2}
;;

And well... I also edited the usage display list:

 echo " * Usage: minecraft {start|stop|restart|backup|update|status|info|console|say}"

My version may be rather a bit clumsy, but I just wrote it as a small script which would allow me to easily create crontab jobs with adjustable messages such as:

0 0 25 2 * /etc/init.d/minecraft say Today is Lorenzo's Birthday, Let's party and eat some cake WOO!

or even displaying the time every 10 minutes:

*/10 * * * * /etc/init.d/minecraft say The time right now is: $(date +"%r")

integer expression expected

When i run my server and to the info command i get in the middle of the info this line:
/etc/init.d/minecraft line 444: [: : integer expression expected

Running CentOS 6.4 min.
Java JDK 1.7.0_45

Script error

I get the following errors when calling the script:

[bukkit@localhost ~]$ minecraft start

  • CraftBukkit was not already running. Starting...
  • Using map named "world"...
    bash: line 1: -XX:MaxPermSize=128M: command not found
    bash: line 2: -XX:+UseParallelOldGC: command not found
    bash: line 3: -XX:+AggressiveOpts: command not found
  • Checking CraftBukkit is running...
  • [ERROR] Could not start CraftBukkit.
    [bukkit@localhost ~]$

Move settings out to a file in /etc/sysconfig to enable easy script updates

Currently when users update the script, they have to manually put all their settings in again. This is inconvenient and annoying.

A settings file in /etc/sysconfig/minecraft would be a better solution to this. The settings and script could be separate, and users could update the script without the need to change the settings.

SETTINGSFILE gets wrong name on system boot

I realise this script has been retired. Just thought I'd leave a note for those who come after me and have the same problem.

On RHEL-derived systems at least (don't know about Ubuntu etc.), the init script can fail to start on system boot. The reason is the following line (110)

SETTINGSFILE="/etc/default/$(basename $0)"

On boot, this resolves to something like /etc/default/S85minecraft, not /etc/default/minecraft. Since this file doesn't exist, the server doesn't start.

When using multi-map backups, one "removeoldbackups" removes the backups for all maps.

When using multi-map backups, one "removeoldbackups" removes the backups for all maps.

For example, if the backup folder is being used for "creative" and "survival" maps, then one "removeoldbackups" removes the old files for both "createive" and "survival".

Ideally, "removeoldbackups" should just remove its own backups.

Look into how this affects removing old executables as well. We don't want to fill the hard drive with backups of craftbukkit.jar or whatever.

Use tmux instead of screen

It seems GNU Screen has issues starting during Ubuntu's broken init implementation. Maybe using tmux could work around that just cos it's different?

Plus, screen is old and tmux is new.

I do have a concern that upstream tmux has not stabilised on their command set yet, some config variables did change between v1.6 (EPEL6) and v1.9 (Fedora 20). I assume the supported Ubuntus have similar variety of versions, so I'd need to look into all of those.

Thanks to Jon Stephens for supplying changes for this.

Ubuntu 14.04 Issue

Get this when I do 'minecraft console'

"Cannot open your terminal '/dev/pts/0' - please check

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.