• Semaphores.

    From j b l@1:154/700 to All on Wed Mar 8 21:26:11 2017
    How would one create a semaphore for BinkP, and allow it to immediately toss/scan messages? Is this possible?

    Thanks,
    ignatius
    --- SBBSecho 3.00-Linux
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (1:154/700)
  • From mark lewis@1:3634/12.73 to j b l on Wed Mar 8 23:00:10 2017

    On 2017 Mar 08 21:26:10, you wrote to All:

    How would one create a semaphore for BinkP, and allow it to immediately toss/scan messages? Is this possible?

    binkd (not p which is the protocol) doesn't toss or scan messages... that's the
    job of your tosser...

    binkd, on the other hand, can create a "flag file" (aka semaphore) or it can execute your tosser directly...

    to create a "flag file" you would use the "flag" keyword similar to the following...

    flag x:\\foo\\semaphore\\mail-in.sem *.su? *.mo? *.tu? *.we? *.th? *.fr? *.sa? *.pkt *.tic


    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... The world is one big gob of perky happy fluffy bunny joy. Yay. Drugs.
    ---
    * Origin: (1:3634/12.73)
  • From Dan Richter@1:317/3 to j b l on Wed Mar 8 21:21:00 2017
    On 03/08/17, j b l said the following...

    How would one create a semaphore for BinkP, and allow it to immediately toss/scan messages? Is this possible?

    Well, BinkP is the protocol which is used by programs like BinkD. BinkD wouldn't be used to toss/scan your messages. This would need to be done with the mail tosser for your system.

    If you're looking to creating semaphore files to force polls of your uplinks, that is something that can be done. What I did, was create a batch file that went into each of the directories, and created the semaphore file. This is
    the line that I used:

    cd . >>03060000.ilo

    The filename is actually the hex difference between your net address, and
    your uplinks address.

    Hope this helps.


    ---

    Dan Richter
    aka Black Panther
    Sysop - Castle Rock BBS
    telnet://castlerockbbs.com
    The sparrows are flying again...

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: Castle Rock BBS - castlerockbbs.com (1:317/3)
  • From j b l@1:154/700 to mark lewis on Thu Mar 9 02:40:35 2017
    Re: Semaphores.
    By: mark lewis to j b l on Wed Mar 08 2017 11:00 pm

    to create a "flag file" you would use the "flag" keyword similar to the following...

    flag x:\\foo\\semaphore\\mail-in.sem *.su? *.mo? *.tu? *.we? *.th? *.fr? *.sa? *.pkt *.tic

    How would I pass the tosser/scanner to this line?

    Thanks,
    ignatius
    --- SBBSecho 3.00-Linux
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (1:154/700)
  • From j b l@1:154/700 to mark lewis on Thu Mar 9 03:01:07 2017
    Re: Semaphores.
    By: mark lewis to j b l on Wed Mar 08 2017 11:00 pm

    flag x:\\foo\\semaphore\\mail-in.sem *.su? *.mo? *.tu? *.we? *.th? *.fr? *.sa? *.pkt *.tic

    Also, which directory does the semaphore file have to be in?

    Thanks,
    ignatius
    --- SBBSecho 3.00-Linux
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (1:154/700)
  • From Jeff Smith@1:282/1031 to J B L on Thu Mar 9 04:45:08 2017
    Hello j b l,

    to create a "flag file" you would use the "flag" keyword similar to the
    following...

    flag x:\\foo\\semaphore\\mail-in.sem *.su? *.mo? *.tu? *.we? *.th? *.fr?
    *.sa? *.pkt *.tic

    How would I pass the tosser/scanner to this line?

    Your tosser would check for the existence or time stamp of the semaphore/flag file and then execute based on your tosser config.

    There is also the exec option when using BinkD as in:

    exec "<path>/<tosser>" *.su? *.mo? *.tu? *.we? *.th? *.fr? *.sa? *.tic *.pkt

    The "<path>/<tosser>" could either be the path and commandline of your tosser or path and bash/batch file to be executed.

    Jeff


    --- BBBS/Li6 v4.10 Toy-3
    * Origin: The OuijaBoard - Anoka, MN (1:282/1031)
  • From mark lewis@1:3634/12.73 to j b l on Thu Mar 9 10:12:56 2017

    On 2017 Mar 09 02:40:34, you wrote to me:

    to create a "flag file" you would use the "flag" keyword similar to
    the following...

    flag x:\\foo\\semaphore\\mail-in.sem *.su? *.mo? *.tu? *.we? *.th?
    *.fr? *.sa? *.pkt *.tic

    How would I pass the tosser/scanner to this line?

    after the session is over, binkd will create the file x:\foo\semaphore\mail-in.sem... you need another process to watch for that semaphore... when it appears, start your mail tossing routine... remember to set another semaphore to prevent mail tossing from running more than one at a time... you should also remove this mail-in.sem since it has done its business...

    eg:
    rem ** mail tossing script **
    rem first check if we are already running
    rem if so, just exit out the bottom
    if exist x:\foo\semaphore\tossing.sem goto end
    rem tell others that we're running
    echo.>x:\foo\semaphore\tossing.sem
    rem remove the semaphore that started us
    del x:\foo\semaphore\mail-in.sem
    rem do tossing stuff here
    rem do more tossing stuff here
    rem all done so now we can remove our semaphore
    del x:\foo\semaphore\tossing.sem
    :end
    rem that's all folks!


    i wrote that on the fly as a simple .bat file... i'm not sure which side you need this on... if you are working on the linux side of the fence, you might be
    able to get fancy and just monitor the datetime of the semaphore rather than having to delete it... it is possible to have a race condition but it isn't that bad for this process... the tosser generally has its own mechanism to prevent it from running more than once at a time... these semaphores are to start this process and prevent the script from running more than once...

    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... Kansas is just a giant concentration camp for cattle.
    ---
    * Origin: (1:3634/12.73)
  • From mark lewis@1:3634/12.73 to j b l on Thu Mar 9 10:22:50 2017

    On 2017 Mar 09 03:01:06, you wrote to me:

    flag x:\\foo\\semaphore\\mail-in.sem *.su? *.mo? *.tu? *.we? *.th?
    *.fr? *.sa? *.pkt *.tic

    Also, which directory does the semaphore file have to be in?

    looking above, you can put it where ever you want... any drive, any directory, any file name... if your binkd is on the linux side of the fence, use the linux
    path format...

    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... Livestock, usually, is a poor choice for a wedding gift.
    ---
    * Origin: (1:3634/12.73)
  • From j b l@1:154/700 to mark lewis on Thu Mar 9 20:57:50 2017
    Re: Semaphores.
    By: mark lewis to j b l on Thu Mar 09 2017 10:12 am

    x:\foo\semaphore\mail-in.sem... you need another process to watch for that semaphore... when it appears, start your mail tossing routine... remember

    And how would I start this other process?

    you need this on... if you are working on the linux side of the fence, you might be able to get fancy and just monitor the datetime of the semaphore

    Yes. This is on the linux side.

    Thanks,
    ignatius
    --- SBBSecho 3.00-Linux
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (1:154/700)
  • From Bill McGarrity@1:266/404 to j b l on Thu Mar 9 22:59:00 2017
    j b l wrote to mark lewis on 03-09-17 20:57 <=-

    Re: Semaphores.
    By: mark lewis to j b l on Thu Mar 09 2017 10:12 am

    x:\foo\semaphore\mail-in.sem... you need another process to watch for that semaphore... when it appears, start your mail tossing routine... remember

    And how would I start this other process?

    The other process is your tosser. What tosser are you using to import/export the mail?


    you need this on... if you are working on the linux side of the fence, you might be able to get fancy and just monitor the datetime of the semaphore

    Yes. This is on the linux side.

    Are you using sbbs as your bbs and sbbsecho as your tosser? If so, then point the semaphore file named 'FIDOIN.NOW' to your ../sbbs/data folder. sbbsecho will see that semaphore and do it's thing for you. You can create a bash script to run once it sees that semaphore and configure it under ./scfg. > External Programs > Timed Events > FIDOIN.

    You can use the following in the binkd.cfg file..

    flag ../sbbs/data/fidoin.now *.pkt *.PKT
    .[mMwWtTfFsS][oOeEhHrRaAuU][0-9a-zA-Z]

    If you're running sbbsecho as standalone as I am, you can use the binkd's EXEC. Mine entry is as follows:

    exec "/home/pi/sbbs/exec/./inmail.sh" *.pkt *.[mwtfs][oehrau][0-9a-zA-Z]

    If binkd sees a pkt or a bundle, it will call inmail.sh. This is what mine looks like.

    *****Start inmail.sh

    #!/bin/bash -e



    echo "*****Setting CTRL variable"



    SBBSCTRL=/home/pi/sbbs/ctrl/ && export SBBSCTRL



    cd /home/pi/sbbs/exec




    echo ?***** Process inbound mail?



    #I create a log everytime there's inbound mail so if there's a problem I can review it.

    ./sbbsecho -lesr > /home/pi/sbbs/events/inerror.log




    if [ -f /home/pi/sbbs/sportnet/secure/*.bad ]; then

    mv -f /home/pi/sbbs/sportnet/secure/*.bad /home/pi/sbbs/sportnet/bad/

    fi

    *****End inmail.sh

    BTW, that bash script has been sliced, diced, reviewed and given the ok by many who know better than I.

    Hope this helps


    --

    Bill

    Telnet: tequilamockingbirdonline.net
    Web: bbs.tequilamockingbirdonline.net:81
    FTP: ftp.tequilamockingbirdonline.net:2121
    IRC: irc.tequilamockingbirdonline.net Ports: 6661-6670 SSL: +6697
    Radio: radio.tequilamockingbirdonline.net:8010/live


    ... Look Twice... Save a Life!!! Motorcycles are Everywhere!!!
    === MultiMail/Win32 v0.50
    --- SBBSecho 3.00-Win32
    * Origin: TequilaMockingbird Online - Toms River, NJ (1:266/404)
  • From j b l@1:154/700 to Bill McGarrity on Fri Mar 10 00:25:43 2017
    Re: Semaphores.
    By: Bill McGarrity to j b l on Thu Mar 09 2017 10:59 pm

    The other process is your tosser. What tosser are you using to import/export the mail?

    I'm using HPT.

    Thanks,
    --- SBBSecho 3.00-Linux
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (1:154/700)
  • From mark lewis@1:3634/12.73 to j b l on Fri Mar 10 10:17:36 2017

    On 2017 Mar 09 20:57:50, you wrote to me:

    x:\foo\semaphore\mail-in.sem... you need another process to watch for
    that semaphore... when it appears, start your mail tossing routine...
    remember

    And how would I start this other process?

    you could have a looping process that starts at bootup, looks for the mail-in.sem semaphore to start processing and sleeps for some period of time between looks for the semaphore... this one could start other scripts for the actual processing or it could do all the processing itself...

    or

    you could have a single shot process that gets fired by cron every so often... when it starts it would look for its semaphores before doing any work which could be running other scripts for the actual processing or it could do all the
    processing itself...

    you need this on... if you are working on the linux side of the
    fence, you might be able to get fancy and just monitor the datetime
    of the semaphore

    Yes. This is on the linux side.

    let's get the basics of this working first before getting too fancy ;)

    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... I'm in here for being crazy, not stupid.
    ---
    * Origin: (1:3634/12.73)
  • From Bill McGarrity@1:266/404 to j b l on Fri Mar 10 11:30:00 2017
    j b l wrote to Bill McGarrity on 03-10-17 00:25 <=-

    Re: Semaphores.
    By: Bill McGarrity to j b l on Thu Mar 09 2017 10:59 pm

    The other process is your tosser. What tosser are you using to import/export the mail?

    I'm using HPT.

    Then use the EXEC option.

    EXEC "<path/to/husky>/htp toss" *.pkt *.[mtwrs][oehrau][0-9a-zA-Z]

    Now this will just let hpt toss incoming. If you have other processes that need to be run on incoming mail, then I'd advise putting together a bash script and putting that in place of 'hpt toss'.


    --

    Bill

    Telnet: tequilamockingbirdonline.net
    Web: bbs.tequilamockingbirdonline.net:81
    FTP: ftp.tequilamockingbirdonline.net:2121
    IRC: irc.tequilamockingbirdonline.net Ports: 6661-6670 SSL: +6697
    Radio: radio.tequilamockingbirdonline.net:8010/live


    ... Look Twice... Save a Life!!! Motorcycles are Everywhere!!!
    === MultiMail/Win32 v0.50
    --- SBBSecho 3.00-Win32
    * Origin: TequilaMockingbird Online - Toms River, NJ (1:266/404)