Jump to content

perunio

Members
  • Posts

    7
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by perunio

  1. Lol! Corn Job... Anyway, I run parallel test and production realms. Multiplying the number of realms makes starting, stopping and restarting the realms a little more difficult and since a number of people here run Ubuntu, I'd strongly recommend using Upstart. It's bundled in Ubuntu and it understands whether a process disappeared and needs restarting. This obviates the need for various restart scripts as all maintenance can now be done with .server commands from within MaNGOS. Later versions also has a WaitAtStartupError configuration option, which is immensely helpful. No chewing up CPU for no reason no mo. But seriously, Upstart is a good thing. Read up on it.
  2. The biggest issue around is that the MaNGOS daemons aren't fork() and detach, but rather they stay in the foreground. This makes it less clever to put into init scripts and you have to play games with nohup(1) and detach them yourself from the controlling terminal. That said, it isn't necessary to rely on cron to restart the executable if it fails. One could do something akin to the while(1) loop described above, but perhaps with a little delay just in case you don't want to clobber your system in a tight loop fashion in case there's a problem. Something like inserting a sleep(1) at the end of the first nest. Ubuntu comes with an init-style restarter called Upstart and its actually good at understanding whether a process died. This is how I manage my servers and I find it more versatile. But its pretty implementation specific and not a great way to learn how to script and manage systems. Granted, this probably wasn't your goal anyway.
  3. Of course. cd /opt/mangos/bin while : do ./mangos-worldd done
  4. Oy vey... You have two approaches here. Mine is to start up mangos as it's brought up along with a boot of your OS. The other is to check periodically whether the server is running via cron(1) and to start it if it isn't. Both scripts are rather a simpleton in their own way, since the startup script doesn't handle taking the application down, nor does it care about it after it's attempted to start. Kind of a fire-and-forget approach, but it's well... Simple. The cron(1) based approach checks to see whether a process exists with its zeroeth argument matching 'mangos-worldd'. Neither are fool-proof, but good enough to get you started. Alas, I'd rewrite the cron(1) based approach slightly: pgrep 'mangos-worldd' if [ $? = 0 ] then echo "status : OK" else echo "status : DOWN" screen -d -m -S world /opt/mangos/bin/mangos-worldd fi This way you aren't dependent on string evaluations and you don't need to throw output in the bit bucket. Also you don't need to worry about unary operators screwing you over. Hope this works for you.
  5. Alright, I see where this needs to go. First, you'll need a script with which to start your daemons: #!/bin/bash cd /opt/mangos/bin nohup ./mangos-realmd > /dev/null 2>&1 nohup ./mangos-worldd > /dev/null 2>&1 Then you need to copy said script (assuming it's called `mangos') to /etc/init.d: sudo cp mangos /etc/init.d After which you need to ensure that it is indeed able to execute, so set the least-most bit on the owner: sudo chmod +x /etc/init.d/mangos When this is done, you can use a handy wrapper present in Ubuntu to create the requisite links: sudo update-rc.d mangos start 99 S . That should do it.
  6. I see. No you don't need to add anything to /etc/rc.local, you could just drop your script into /etc/init.d. Call it `mangos' or something. Then in /etc/rc2.d, /etc/rc3.d and /etc/rc5.d create a symbolic link to it called `S99mangos'. The capital 'S' is important because it implies that you want to start the service. The number is an integer which defines in which order you want to run the script. Probably safe to run it at the 99th iteration as you need the system up and running anyway.
  7. I take it you don't start up with screen(1)? If so, it's relatively easy: #!/bin/bash cd /opt/mangos/bin nohup ./mangos-worldd > /dev/null 2>&1
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use