superjamie / minecraft-init-script

An initscript to start Minecraft or CraftBukkit on CentOS, Fedora, and Ubuntu
GNU General Public License v3.0
65 stars 31 forks source link

Not Starting with Ubuntu. #26

Closed ghost closed 10 years ago

ghost commented 10 years ago

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 ?

superjamie commented 10 years ago

If you check your /var/log/boot.log does it say:

* CraftBukkit was not already running. Starting...
 * Using map named "world"...
Cannot make directory '/var/run/screen': Permission denied

If so, this is a long-standing bug in Ubuntu's init:

I had asked someone else via email to try adding the following sleep 1 to the script to work around it.

Change this:

echo " * Using map named \"$WORLDNAME\"..."
as_user "cd \"$MCPATH\" && screen -c /dev/null -dmS $SCRNAME $INVOCATION"
sleep 10

To this:

echo " * Using map named \"$WORLDNAME\"..."
sleep 1    ## this is the addition
as_user "cd \"$MCPATH\" && screen -c /dev/null -dmS $SCRNAME $INVOCATION"
sleep 10

But I received no reply from that person.

If you see that Permission denied in boot.log, could you please try adding the sleep 1 as above?

ghost commented 10 years ago

Thank you, but I haven't : Cannot make directory '/var/run/screen': Permission denied But :

And the Script don't start with Ubuntu with "sleep 1"

superjamie commented 10 years ago

I am not sure. Try adding the sleep 1 as described above.

ghost commented 10 years ago

Nope, it doesn't work if I add "sleep 1".

sighops commented 10 years ago

I spent the day figuring out a work around for this on my own Ubuntu 14.04 server. What I ended up doing was essentially removing and replicating the screen-cleanup init script in the minecraft init script, right before screen is called in mc_start. The problem seems to be that /var/run/screen isn't being created before the minecraft init script tries to use screen. It may not be the best solution but it works as it should now. Here's what I did:

  1. mv /etc/init.d/screen-cleaup ~/screen-cleanup.bak
  2. update-rc.d screen-cleanup remove
  3. Added the following into mc_start() right before the line containing as_user "cd \"$MCPATH\"... if ! test -d /var/run/screen; then mkdir /var/run/screen chown root:utmp /var/run/screen chmod 775 /var/run/screen fi
superjamie commented 10 years ago

Interesting, thanks for reporting that. I'm really hesitant to start messing with other initscripts but I will look into this more when I get a chance.

ubuntuaddicted commented 10 years ago

i'm also affected by this ubuntu screen bug. I did what juhbobbleton above suggests but there's a typo in his command for moving the screen-cleanup init script, it should read (missing the 'n') mv /etc/init.d/screen-cleanup ~/screen-cleanup.bak