• finally :)

    From Janis Kracht@1:261/38 to All on Sun Apr 28 00:00:12 2019
    If your BBBS is being hit time after time with bots, this script may fix it for
    you... I've been running this script now for about 15 minutes, and everytime Yandex kills bbbsd this script runs my script that brings it back up.. :)

    =====Start script======
    #!/bin/bash
    cd /home/bbbs
    check_process() {
    echo "$ts: checking $1" >>check.log
    [ "$1" = "" ] && return 0
    [ `pgrep -n $1` ] && return 1 || return 0
    }

    while [ 1 ]; do
    # timestamp
    ts=`date +%T`

    echo "$ts: begin checking..." >>check.log
    check_process "bbbsd"
    [ $? -eq 0 ] && echo "$ts: not running, restarting..." && `./telnetnode.sh > /dev/null`
    sleep 5
    done
    =========End Script========

    Notes:
    The line that starts with "[ $? -eq 0 ] && echo "$ts: not running," wraps in this message, so make sure that is all on one line.

    If you can't copy this script for whatever reason, let me know and I'll send it
    to you via email or Fidonet.

    If you remove the references to "check.log", this script will write to your screen, like this:

    23:55:13: begin checking...
    23:55:13: checking bbbsd
    23:55:19: begin checking...
    23:55:19: checking bbbsd
    23:55:24: begin checking...
    23:55:24: checking bbbsd


    Take care,
    Janis

    --- BBBS/Li6 v4.10 Toy-4
    * Origin: Prism bbs (1:261/38)
  • From Jeff Smith@1:282/1031 to Janis Kracht on Sun Apr 28 00:00:06 2019
    Hello Janis,
    If your BBBS is being hit time after time with bots, this script may fix it fo
    you... I've been running this script now for about 15 minutes, and everytime Yandex kills bbbsd this script runs my script that brings it back up.. :)

    [...]

    check_process "bbbsd"
    [ $? -eq 0 ] && echo "$ts: not running, restarting..." && `./telnetnode.sh > /dev/null`

    I take it that telnetnode.sh (re)starts your bbbsd daemon? I don't recall, does
    BBBS create any bsy files that would prevent bbbsd from reloading until any such files were taken care of?

    I have tightened down iptables to limit the multiple telnet attempts. Which has
    helped but I still occasionally run out of available nodes. Even though the busy nodes are cleared more quickly now.


    Jeff




    --- BBBS/Li6 v4.10 Toy-4
    * Origin: Fidoneet: The Ouija Board - Anoka, MN -bbs.ouijabrd.net (1:282/1031)
  • From Janis Kracht@1:261/38 to Jeff Smith on Sun Apr 28 11:57:44 2019
    Hi Jeff,

    If your BBBS is being hit time after time with bots, this script may fix it f >> you... I've been running this script now for about 15 minutes, and everytime >> Yandex kills bbbsd this script runs my script that brings it back up.. :)

    [...]

    check_process "bbbsd"
    [ $? -eq 0 ] && echo "$ts: not running, restarting..." && `./telnetnode.sh > >> /dev/null`

    I take it that telnetnode.sh (re)starts your bbbsd daemon?

    Yes, it does. Here is telnetnode.sh:
    ===cut here===
    #/bin/sh
    cd /home/bbbs
    ./bbbsd 4 15 telnetd:2030 httpd:8090 ftpd:60721 rawd:24555:binkp "quiet" "fork"
    "uid:bbs" &
    ===cut here===

    The "./bbbsd 4 15" line wraps in this message.

    I don't recall, does
    BBBS create any bsy files that would prevent bbbsd from reloading until any such files were taken care of?

    It's not like BinkD, if that's what you mean, so it doesn't that I can remember.

    I have tightened down iptables to limit the multiple telnet attempts. Which ha
    helped but I still occasionally run out of available nodes. Even though the busy nodes are cleared more quickly now.

    I thought I had as well... but this darn bot from Yandex kept taking it down.. They did it three times yesterday, which is why I started searching for a good script to restart a daemon. The script I posted is just perfect IMO. :) Running out of available nodes was exactly the problem over here as well...

    Take care,
    Janis

    --- BBBS/Li6 v4.10 Toy-4
    * Origin: Prism bbs (1:261/38)
  • From Jeff Smith@1:282/1031 to Janis Kracht on Sun Apr 28 17:19:28 2019
    Hello Janis,

    I take it that telnetnode.sh (re)starts your bbbsd daemon?

    Yes, it does. Here is telnetnode.sh:
    ===cut here===
    #/bin/sh
    cd /home/bbbs
    ./bbbsd 4 15 telnetd:2030 httpd:8090 ftpd:60721 rawd:24555:binkp "quiet" "fork
    "uid:bbs" &
    ===cut here===

    That's almost exactly what I use here except that I use default ports since I at the moment don't use a web server front end. One other thing that I may change on the setup is to NOT use all available nodes for telnet purposes.

    I don't recall, does
    BBBS create any bsy files that would prevent bbbsd from reloading until any >> such files were taken care of?

    It's not like BinkD, if that's what you mean, so it doesn't that I can remember.

    I didn't think it did but couldn't recall for sure.

    I have tightened down iptables to limit the multiple telnet attempts. Which h >> helped but I still occasionally run out of available nodes. Even though the >> busy nodes are cleared more quickly now.

    I thought I had as well... but this darn bot from Yandex kept taking it down.. >They did it three times yesterday, which is why I started searching for a good
    script to restart a daemon. The script I posted is just perfect IMO. :) Running out of available nodes was exactly the problem over here as well...

    Thanks, I will give a try and evaluate the results.

    Jeff

    --- BBBS/Li6 v4.10 Toy-4
    * Origin: Fidoneet: The Ouija Board - Anoka, MN -bbs.ouijabrd.net (1:282/1031)