Add your driver and addr_server to monit: How-To [Beta]

Add your driver and addr_server to monit: How-To [Beta]

This how-to is still in testing. I got it to work, however, the how-to may not be totally complete or correct. Please let me know how it works for you.

  1. Set up monit Monitoring Service on your Linux box
  2. Add the following to your /etc/monit/monitrc: (The “as uid” line is optional, use it only if you want to run your mud as a different user)

    check process driver with pidfile /home/mud/bin/driver.pid
    start program "/home/mud/bin/startdriver"
    as uid mud and gid mud

  3. Optional: If you want addr_server, add this to /etc/monit/monitrc too: (The “as uid” line is optional, use it only if you want to run your addr_server as a different user)

    check process addr_server with pidfile /home/mud/bin/addr_server.pid
    start program "/home/mud/bin/startaddr_server"
    as uid mud and gid mud

  4. Create a file called startdriver in your MUD’s “bin” directory: (change /home/mud to the location of your mud’s directory (the one containing ‘bin’ and ‘lib’)):

    #!/bin/bash

    export MUDHOME="/home/mud"

    umask 007
    ulimit -n 120
    $MUDHOME/bin/driver $MUDHOME/lib/secure/cfg/mudos.cfg &

    rm driver.pid
    ps -ef | grep /bin/[d]river | awk '{print $2}' > driver.pid

  5. Optional: If you want to set up addr_server, create a file called startaddr_server in your MUD’s “bin” directory (again, change /home/mud to the location of your mud directory):

    #!/bin/bash

    /home/mud/bin/addr_server 9999 &

    rm addr_server.pid
    ps -ef | grep /bin/[a]ddr_server | awk '{print $2}' > addr_server.pid

  6. Restart the monit service:
    /etc/init.d/monit restart

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: