• MIS Shutdown Idea

    From Black Panther@21:1/186 to g00r00 on Sat Feb 23 17:47:38 2019
    Hi g00r00,

    I just had an idea that might be of some use to others as well.

    Would it be possible to add a semaphore that would cause MIS to shutdown gracefully after completing running events?

    The reason I'm asking, is I have a utility that utilizes the log files, and on Windows systems, MIS has a lock on those files. If there was a way to shut down MIS via an event of some type, so that I could run my utilities, and then start up MIS again, it would be great.

    I know I've been quiet in here lately, but I'm loving all of the enhancements that have been added lately. :)



    ---

    Black Panther
    A.K.A. - Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again...


    ... Oh, no! Not *ANOTHER* learning experience.

    ___ MultiMail/Linux v0.51

    --- Mystic BBS/QWK v1.12 A43 2019/02/17 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From g00r00@21:1/108 to Black Panther on Sat Feb 23 21:22:19 2019
    The reason I'm asking, is I have a utility that utilizes the log files, and on Windows systems, MIS has a lock on those files. If there was a
    way to shut down MIS via an event of some type, so that I could run my utilities, and then start up MIS again, it would be great.

    Are you talking about the mis.log? I am trying to replicate that issue and I am not able to with the latest A43.

    To answer you question I think it'd be nice to have a shutdown command for Windows as well, since there is one for Linux so I will put that on the list.
    I have some other ideas around that type of thing that I have wanted to try
    out too hopefully I can get to them soon.

    But I'd also like to focus on how we can get it so you can read mis.log too.

    --- Mystic BBS v1.12 A43 2019/02/17 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From Black Panther@21:1/186 to g00r00 on Sun Feb 24 04:07:28 2019
    On 23 Feb 2019, g00r00 said the following...

    Are you talking about the mis.log? I am trying to replicate that issue and I am not able to with the latest A43.

    Yes, the mis.log. Sorry, I should have mentioned that...

    To answer you question I think it'd be nice to have a shutdown command
    for Windows as well, since there is one for Linux so I will put that on the list. I have some other ideas around that type of thing that I have wanted to try out too hopefully I can get to them soon.

    That would be great. I was also wondering, as I haven't tried it yet under Linux, does the ./mis -shutdown do a graceful shutdown? I don't want to have any issues with events that may be in process...

    But I'd also like to focus on how we can get it so you can read mis.log too.

    Awesome. I've been trying to figure out a work-around, but have been running into roadblocks... The best I was able to do, is using a batch file, rename
    the log files, run the program, then delete the copies... There's got to be a better way. :)

    Thanks,


    ---

    Black Panther(RCS)
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A43 2019/02/17 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From g00r00@21:1/108 to Black Panther on Sun Feb 24 10:33:27 2019
    That would be great. I was also wondering, as I haven't tried it yet
    under Linux, does the ./mis -shutdown do a graceful shutdown? I don't
    want to have any issues with events that may be in process...

    In Linux it will disconnect connections and shutdown each server process, but if an event is running it should be waiting for up to 1 minute before shutting down anyway. Whether or not that kills the subprocess I'd have to test to be 100% certain but I would think it does.

    Awesome. I've been trying to figure out a work-around, but have been running into roadblocks... The best I was able to do, is using a batch file, rename the log files, run the program, then delete the copies... There's got to be a better way. :)

    Well like I said, I am not having any issues viewing mis.log when its running so I am wondering what is different between our setups.

    --- Mystic BBS v1.12 A43 2019/02/17 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From Bucko@21:4/131 to Black Panther on Sun Feb 24 13:40:03 2019
    On 23 Feb 2019, Black Panther said the following...


    Awesome. I've been trying to figure out a work-around, but have been running into roadblocks... The best I was able to do, is using a batch file, rename the log files, run the program, then delete the copies... There's got to be a better way. :)

    Thanks,

    You sound like you are doing something like I do. I run at 11:59 every night
    a bat file to copy that days logs to a folder adding the date to the files, then on Sunday morning zip them up with the date. (gotta write the bat file
    to zip the weekly and monthly files with dates).. Only file that is not included is mis, that 1 I do manually..

    --- Mystic BBS v1.12 A43 2019/02/23 (Windows/32)
    * Origin: The Wrong Number Family Of BBS' - Wrong Number ][ (21:4/131)
  • From Black Panther@21:1/186 to g00r00 on Sun Feb 24 15:31:03 2019
    On 24 Feb 2019, g00r00 said the following...

    In Linux it will disconnect connections and shutdown each server
    process, but if an event is running it should be waiting for up to 1 minute before shutting down anyway. Whether or not that kills the subprocess I'd have to test to be 100% certain but I would think it does.

    I'll have to test that as soon as I get everything running correctly under
    the new OS here...

    Well like I said, I am not having any issues viewing mis.log when its running so I am wondering what is different between our setups.

    It wasn't just viewing the file. I have a program that is trying to read the file, and I'm unable to even open it with the program. It's written in FP,
    and I'm using:
    try
    AssignFile(fmislog,MysticLogs+'mis.log');
    reset(fmislog);
    except
    on E: EInOutError do begin
    writeln('File handling error occurred. Details: ',E.Message);
    ProgramHalt(1);

    I keep getting an error saying it was unable to open file, as it was locked.


    ---

    Black Panther(RCS)
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A43 2019/02/17 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From Black Panther@21:1/186 to Bucko on Sun Feb 24 15:34:28 2019
    On 24 Feb 2019, Bucko said the following...

    You sound like you are doing something like I do. I run at 11:59 every night a bat file to copy that days logs to a folder adding the date to
    the files, then on Sunday morning zip them up with the date. (gotta
    write the bat file to zip the weekly and monthly files with dates)..
    Only file that is not included is mis, that 1 I do manually..

    Very close. :)

    I wrote a program that backs up the log files nightly into a directory structure such as:

    mystic/logs/2019/02/23/

    The program also has other functions that will be able to read the log files back to see when a node last connected, for example. :)


    ---

    Black Panther(RCS)
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A43 2019/02/17 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From Bucko@21:4/131 to Black Panther on Sun Feb 24 18:33:49 2019
    On 24 Feb 2019, Black Panther said the following...


    Very close. :)

    I wrote a program that backs up the log files nightly into a directory structure such as:

    mystic/logs/2019/02/23/

    NICE!! I like that.. I'm using a bat file.. LOL Yours sounds really nice...

    --- Mystic BBS v1.12 A43 2019/02/23 (Windows/32)
    * Origin: The Wrong Number Family Of BBS' - Wrong Number ][ (21:4/131)
  • From g00r00@21:1/108 to Black Panther on Sun Feb 24 22:08:47 2019
    I keep getting an error saying it was unable to open file, as it was locked.

    I am able to copy mine when its running in Windows. Do you have anything else running against it? Have you tried it recently? When I have log caching on it will likely be locked but its no longer on at the moment, and it will be configurable in the future.

    --- Mystic BBS v1.12 A43 2019/02/17 (Linux/64)
    * Origin: Sector 7 (21:1/108)
  • From Black Panther@21:1/186 to g00r00 on Mon Feb 25 17:43:09 2019
    On 24 Feb 2019, g00r00 said the following...

    I am able to copy mine when its running in Windows. Do you have
    anything else running against it? Have you tried it recently? When I have log caching on it will likely be locked but its no longer on at the moment, and it will be configurable in the future.

    The only things running on that system, are MIS and Synchronet at the moment.

    I did just try using this copy function:

    Procedure LogFileCopy(filein,fileout:string);
    var
    s,t:TFileStream
    begin
    s:=TFileStream.Create(filein,fmOpenRead);
    try
    t:=TFileStream.Create(fileout,fmCreate);
    try
    T.CopyFrom(s,S.Size);
    finally
    T.Free;
    end;
    finally
    S.Free;
    end;
    end;

    The error I'm getting is:

    An unhandled exception occurred at $041C147:
    EFOpenError: Unable to open file "c:\mystfsx-net4\logs\mis.log"
    $0041C147
    $0041BFF0
    $00401AF2 LOGFILECOPY, line 170 of rcsnodepoll.pas
    $00401CEA PROGRAMINIT line 194 of rcsnodepoll.pas
    $00403843 main, line 486 of rcsnodepoll.pas

    Line 170 is listed above as 's:=TFileStream.Create(filein,fmOpenRead);'

    Not sure if I have an error in the code, or perhaps something else is amiss...


    ---

    Black Panther(RCS)
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A43 2019/02/17 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)