Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!

Author Topic: bash script to start/stop/restart b3  (Read 29896 times)

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
bash script to start/stop/restart b3
« on: July 29, 2008, 08:59:14 PM »
« Last Edit: September 12, 2008, 10:25:40 AM by xlr8or »

Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: bash script to start/stop/restart b3
« Reply #1 on: July 30, 2008, 09:52:24 AM »
I'm using a very small restarter script from within screen. It automatically restarts the server/bot when it crashes (not when it hangs tho).

http://www.snt.utwente.nl/wiki/Howto_Server_Restarter

When you have multiple accounts that should be able to access the running processes for the gameserver and/or bot we have a more comprehensive set of scripts available, but it is quite a hassle to set it up. Interested how it looks? Take a look here: http://www.snt.utwente.nl/wiki/Howto_StartStopScripts

Offline Deemer

  • Jr. Member
  • **
  • Posts: 17
Re: bash script to start/stop/restart b3
« Reply #2 on: July 30, 2008, 08:02:00 PM »
Hi

This the script I use to start my b3 bot from linux.
It makes sure b3 is not already running before starting and does not kill the bot when you leave the console.



Tomdesinto,

I just wanted to thank you for your script.  You have completely solved my b3 issues of having to manually restart it once a day.  Thank you again!
« Last Edit: July 31, 2008, 12:50:36 AM by ThorN »

Offline Deemer

  • Jr. Member
  • **
  • Posts: 17
Re: bash script to start/stop/restart b3
« Reply #3 on: July 30, 2008, 08:02:37 PM »
Can we sticky this???

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: bash script to start/stop/restart b3
« Reply #4 on: July 30, 2008, 08:05:21 PM »
:D glad it help you ...
« Last Edit: July 30, 2008, 09:32:24 PM by Courgette »

Offline Huddex

  • Newbie
  • *
  • Posts: 1
Re: bash script to start/stop/restart b3
« Reply #5 on: December 04, 2008, 08:55:27 AM »
Is there anything similar for windows?

Offline Bakes

  • B3 Contrib/Support
  • Hero Member
  • *
  • Posts: 1226
Re: bash script to start/stop/restart b3
« Reply #6 on: December 04, 2008, 06:36:35 PM »
not that I know of, but a quick autorestart script:
Code: [Select]
:TOP
path-to-b3_run eg C:\b3\b3_run.py
GOTO TOP
that will restart it
otherwise you could use firedaemon to do that for you.

Offline Platanos

  • Sr. Member
  • ****
  • Posts: 296
    • The Last Unit
Re: bash script to start/stop/restart b3
« Reply #7 on: November 28, 2010, 11:54:27 PM »
Nice Script, but the Ingame Command !restart kills BB is there an Option do put --restart in the script?

LG

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: bash script to start/stop/restart b3
« Reply #8 on: November 29, 2010, 12:23:19 AM »
just set
Code: [Select]
B3_OPTS="--config $B3_CONFIGFILE --restart"

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: bash script to start/stop/restart b3
« Reply #9 on: December 26, 2010, 10:45:30 AM »
Trying to implement this but small issue: error: cannot execute b3_run.py
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline epiacum

  • Jr. Member
  • **
  • Posts: 42
Re: bash script to start/stop/restart b3
« Reply #10 on: January 23, 2011, 06:42:35 AM »
Trying to implement this but small issue: error: cannot execute b3_run.py

Same here, path is definately correct.
« Last Edit: January 23, 2011, 06:45:48 AM by epiacum »

Offline v1ad

  • Jr. Member
  • **
  • Posts: 29
Re: bash script to start/stop/restart b3
« Reply #11 on: February 16, 2011, 09:04:29 PM »
@ mordy chmod u+x b3_run.py 

the chmod should be imported into the script. at least check 4 it.

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: bash script to start/stop/restart b3
« Reply #12 on: February 16, 2011, 09:43:33 PM »
@ mordy chmod u+x b3_run.py 

the chmod should be imported into the script. at least check 4 it.
Will try and let you know. Thanks for the help!
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline epiacum

  • Jr. Member
  • **
  • Posts: 42
Re: bash script to start/stop/restart b3
« Reply #13 on: February 16, 2011, 10:09:06 PM »
Thanks, Im getting this :

ERROR: you have to run that script as b3

Offline TmR

  • Full Member
  • ***
  • Posts: 94
Re: bash script to start/stop/restart b3
« Reply #14 on: March 04, 2011, 12:42:36 PM »
Thanks, Im getting this :

ERROR: you have to run that script as b3
you should make a user called b3 i think, or change
Code: [Select]
## the user that must be used to run the bot
USER=b3
to your unix username (not really safe to use root imho)
-edit-
hm i couldnt change it to my user, so  i did use root.
Gonna reboot now
-edit2-
works like a charm (using 3 b3 bots so far)
« Last Edit: March 04, 2011, 02:54:53 PM by TmR »

 


Rate this page +1 at Google Search

anything