• Nightly Build

    From Mortifis@VERT/ALLEYCAT to Digital Man on Wednesday, October 10, 2018 20:29:35
    Do you have a script that you'd share for the nightly build on you Deb System.
    I threw together a quick script that I want to run as a Synchronet Timed even, but I am sure you have something better ... this runs on a Raspberry Pi with raspbian deb

    #!/bin/bash
    echo -e "\e[0;34mSynchronet BBS Auto-Update\n"
    echo -e "\e[1;33m;Updating CVS Repositories\e[1;34m"
    cd ~/sbbs/3rdp
    cvs update
    cd ~/sbbs/src
    cvs update
    cd ~/sbbs/src/sbbs3
    echo -e "\e[1;33mRebuilding Synchronet BBS\e[1;34m"
    make RELEASE=1 DOSEMU=1 2>&1 | tee ~/sbbs/sbbs-rebuild.log
    sed -i '1iLast Rebuild on '"`date`"' ' ~/sbbs/sbbs-rebuild.log
    cd ~/sbbs/src/sbbs3/gcc.linux.armv7l.exe.release
    echo -e "\033[1;33mKilling SBBS"
    sudo pkill sbbs
    sudo rm -f /var/run/sbbs.pid
    echo -e "Copying new executables to /sbbs/exec/"
    sleep 5s
    cp -p * /sbbs/exec
    export SBBSCTRL=/sbbs/ctrl
    echo "Re-Launching Synchronet SBBS"
    sleep 3s
    clear
    sudo systemctl start sbbs
    echo -e "\nDone!\e[1;34m\n"

    ---
    þ Synchronet þ Twisted Truckers BBS web asmf-etrucker.com:81 telnet asmf-etrucker.com
  • From Digital Man@VERT to Mortifis on Wednesday, October 10, 2018 20:00:58
    Re: Nightly Build
    By: Mortifis to Digital Man on Wed Oct 10 2018 08:29 pm

    Do you have a script that you'd share for the nightly build on you Deb System.

    Here's my nightly build script: http://cvs.synchro.net/cgi-bin/viewcvs.cgi/exec/testbuild.js

    I threw together a quick script that I want to run as a Synchronet Timed even, but I am sure you have something better ... this runs on a Raspberry Pi with raspbian deb

    #!/bin/bash
    echo -e "\e[0;34mSynchronet BBS Auto-Update\n"
    echo -e "\e[1;33m;Updating CVS Repositories\e[1;34m"
    cd ~/sbbs/3rdp
    cvs update
    cd ~/sbbs/src
    cvs update

    You can just run "cvs update 3rdp src" from the sbbs (one command).

    cd ~/sbbs/src/sbbs3
    echo -e "\e[1;33mRebuilding Synchronet BBS\e[1;34m"
    make RELEASE=1 DOSEMU=1 2>&1 | tee ~/sbbs/sbbs-rebuild.log
    sed -i '1iLast Rebuild on '"`date`"' ' ~/sbbs/sbbs-rebuild.log
    cd ~/sbbs/src/sbbs3/gcc.linux.armv7l.exe.release
    echo -e "\033[1;33mKilling SBBS"
    sudo pkill sbbs

    Well that seems like a bad idea. Does it perform a graceful shutdown (e.g. waiting for users to logoff)?

    sudo rm -f /var/run/sbbs.pid
    echo -e "Copying new executables to /sbbs/exec/"
    sleep 5s
    cp -p * /sbbs/exec

    Just add the 'install' target to your 'make' command-line(s) and it'll do that for you.

    export SBBSCTRL=/sbbs/ctrl
    echo "Re-Launching Synchronet SBBS"
    sleep 3s
    clear
    sudo systemctl start sbbs
    echo -e "\nDone!\e[1;34m\n"

    You shouldn't need to set the SBBSCTRL environment variable here in this script. Also, I don't think it's generally a good idea to be shutting down and restarting the BBS daily or in any automated-periodic way. You don't have to shutdown the BBS to rebuild the binaries. You could rebuild (any time) and then do an sbbs restart later, when it's convenient.

    digital man

    This Is Spinal Tap quote #10:
    Dozens of people spontaneously combust each year... just not widely reported. Norco, CA WX: 61.7øF, 76.0% humidity, 5 mph ESE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Mortifis@VERT/ALLEYCAT to Digital Man on Thursday, October 11, 2018 15:06:09
    I was hoping you'd comment on the pkill
    command. I was going to drop the shutdown
    semaphore file into /sbbs/data ... will that
    be a graceful shutdown? I was poking around
    a bit to see if there are any files that
    indicate a service is in use which would
    allow the script to wait until the board is
    idle.

    I have the build directory tree in a
    different location than where I run the board
    from so I used cp * instead of install.

    ---
    þ Synchronet þ Twisted Truckers BBS web asmf-etrucker.com:81 telnet asmf-etrucker.com
  • From Digital Man@VERT to Mortifis on Thursday, October 11, 2018 12:43:54
    Re: Re: Nightly Build
    By: Mortifis to Digital Man on Thu Oct 11 2018 03:06 pm

    I was hoping you'd comment on the pkill
    command. I was going to drop the shutdown
    semaphore file into /sbbs/data ... will that
    be a graceful shutdown?

    Yes:
    http://wiki.synchro.net/config:semfiles

    I was poking around
    a bit to see if there are any files that
    indicate a service is in use which would
    allow the script to wait until the board is
    idle.

    No, anything like that would have inherent race conditions.

    I have the build directory tree in a
    different location than where I run the board
    from so I used cp * instead of install.

    The "install" target copies to (and the "symlink" target creates symlinks) where your SBBSEXEC or SBBSCTRL environment variable indicate the BBS is running from. It doesn't assume your source code is in the same location as the board.
    http://wiki.synchro.net/config:env

    digital man

    Synchronet/BBS Terminology Definition #41:
    REP = QWK Reply
    Norco, CA WX: 69.9øF, 51.0% humidity, 0 mph SSW wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Mortifis@VERT/ALLEYCAT to Digital Man on Friday, October 12, 2018 15:37:15
    No, anything like that would have inherent race conditions.
    digital man

    such a simple statement with profound implications ... which explains why trying to chase spawning child preocesses is a never ending battle ... I should have stayed in system development 33 years ago instead of switching to truck driving LOL ... Thanks, DM, you saved me a ton of time, again :)

    ---
    þ Synchronet þ Twisted Truckers BBS web asmf-etrucker.com:81 telnet asmf-etrucker.com
  • From Mortifis@VERT/ALLEYCAT to Digital Man on Friday, October 12, 2018 16:46:11
    Re: Re: Nightly Build
    By: Mortifis to Digital Man on Thu Oct 11 2018 03:06 pm

    I was hoping you'd comment on the pkill
    command. I was going to drop the shutdown
    semaphore file into /sbbs/data ... will that
    be a graceful shutdown?

    Yes:
    http://wiki.synchro.net/config:semfiles

    I was poking around
    a bit to see if there are any files that
    indicate a service is in use which would
    allow the script to wait until the board is
    idle.

    No, anything like that would have inherent race conditions.


    So, I was experimenting and wondering about the shutdown semfile and how the internal workings of SBBS uses it. For instance, if I drop the shutdown sem while I am logged in via http or telnet, etc, it waits until the clients disconnects before shutting that that paticular service, so is there a race condition blocker (semantics) that stops another, say, telnet process from being spawning? I also notice that when someone logs in via telnet for example the 'time is reduced for an upcoming event' so if I were to run my weekly rebuild as a timed even that drops a shutdown semfile would this be considered a graceful shutdown and allow the rebuild/restart to be executed correctly?

    ---
    þ Synchronet þ Twisted Truckers BBS web asmf-etrucker.com:81 telnet asmf-etrucker.com
  • From Digital Man@VERT to Mortifis on Saturday, October 13, 2018 19:54:17
    Re: Re: Nightly Build
    By: Mortifis to Digital Man on Fri Oct 12 2018 04:46 pm

    Re: Re: Nightly Build
    By: Mortifis to Digital Man on Thu Oct 11 2018 03:06 pm

    I was hoping you'd comment on the pkill
    command. I was going to drop the shutdown
    semaphore file into /sbbs/data ... will that
    be a graceful shutdown?

    Yes:
    http://wiki.synchro.net/config:semfiles

    I was poking around
    a bit to see if there are any files that
    indicate a service is in use which would
    allow the script to wait until the board is
    idle.

    No, anything like that would have inherent race conditions.


    So, I was experimenting and wondering about the shutdown semfile and how the internal workings of SBBS uses it. For instance, if I drop the shutdown sem while I am logged in via http or telnet, etc, it waits until the clients disconnects before shutting that that paticular service, so is there a race condition blocker (semantics) that stops another, say, telnet process from being spawning?

    No (technically, they're threads no processes, but same idea). But you *could* lock the nodes (e.g. using the exec/node utility) to do that if you wanted - at least for the terminal server.

    I also notice that when someone logs in via telnet for
    example the 'time is reduced for an upcoming event' so if I were to run my weekly rebuild as a timed even that drops a shutdown semfile would this be considered a graceful shutdown and allow the rebuild/restart to be executed correctly?

    Yeah, that should work fine.

    digital man

    Synchronet/BBS Terminology Definition #41:
    REP = QWK Reply
    Norco, CA WX: 59.9øF, 91.0% humidity, 2 mph SE wind, 0.52 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net