• MIS Shutdowns

    From Avon@21:1/101 to g00r00 on Tue Jan 21 21:38:34 2020
    A request I've seen voted upwards by others several times that I wanted to
    pass along to you:

    Being able to shutdown MIS (windows or linux) and MIS -D (linux) gracefully from a command line. So if I wanted to run a backup script and not have MIS running it can be shutdown gracefully without a human being needing to press the ESC key and press enter on YES

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Argos@21:1/203 to Avon on Tue Jan 21 09:18:12 2020

    A request I've seen voted upwards by others several times that I wanted
    to pass along to you:

    Being able to shutdown MIS (windows or linux) and MIS -D (linux) gracefully from a command line. So if I wanted to run a backup script
    and not have MIS running it can be shutdown gracefully without a human being needing to press the ESC key and press enter on YES


    If this is a motion on the floor, I'd like to 2nd it. to execute a Mutil
    type command at the prompt before a batch backup run .. then a Mutil type command to launch MIS back normally.

    ---

    Rocket Town BBS - Telnet: rtbbs.ddns.net
    fsxNET: 21:1/203 FidoNET:1:135/383 - Titusville, FL. NASA SPACE Coast

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: Rocket Town BBS (21:1/203)
  • From ryan@21:1/168 to Argos on Tue Jan 21 09:31:50 2020
    If this is a motion on the floor, I'd like to 2nd it. to execute a
    Mutil type command at the prompt before a batch backup run .. then a
    Mutil type command to launch MIS back normally.

    I'd even be inclined to vote /more/ strongly for keeping mis running, but
    when connection attempts are made, it throws some kind of "the bbs is undergoing nightly maintenance, please call back" type message.

    The benefit here is that we'd potentially be able to put a backup job in mystic's own events. I, a linux user, would otherwise have to disable the automatic systemd job to launch mystic, shut the board down, do the backup, re-enable the systemd job, and start the BBS once again. Simply pausing any activity to/from data files with a "board is temporarily down" message seems like a home run in this case :)

    --- Mystic BBS v1.12 A44 2020/01/16 (Linux/64)
    * Origin: monterey bbs (21:1/168)
  • From Alterego@21:2/116 to Avon on Wed Jan 22 09:35:32 2020
    Re: MIS Shutdowns
    By: Avon to g00r00 on Tue Jan 21 2020 09:38 pm

    Being able to shutdown MIS (windows or linux) and MIS -D (linux) gracefully from a command line. So if I wanted to run a backup script and not have MIS running it can be shutdown gracefully without a human being needing to press the ESC key and press enter on YES

    A better cross platform approach may be the use of semaphores - which is how Taurus does it.

    There is a semaphore to indicate it is up, and if you touch another semaphore, it will shutdown, and touch yet a different one it will start back up again.

    So between touching the "shutdown" semaphore, you test that the "im running" semaphore gets deleted. And after touching the "start" sempahore, you check that the "im running" semaphore is created (and that way you know its working at an application level). (The "shutdown" and "start" semaphores also get deleted when actioned...)
    ...deon


    ... Bend the facts to fit the conclusion. It's easier that way.
    --- SBBSecho 3.10-Linux
    * Origin: I'm playing with ANSI+videotex - wanna play too? (21:2/116)
  • From Avon@21:1/101 to Alterego on Wed Jan 22 12:06:18 2020
    On 22 Jan 2020 at 09:35a, Alterego pondered and said...

    A better cross platform approach may be the use of semaphores - which is how Taurus does it.

    Interesting idea... personally I'd love a switch that I could just pass in a batch file to MIS but that's just me :)

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)
  • From Alterego@21:2/116 to Avon on Wed Jan 22 10:45:22 2020
    Re: Re: MIS Shutdowns
    By: Avon to Alterego on Wed Jan 22 2020 12:06 pm

    Interesting idea... personally I'd love a switch that I could just pass in a batch file to MIS but that's just me :)

    So folks who run mysic on linux, could do this with systemd or init/rc start stop scripts. (Although IIRC, mystic shows a WFC type screen when started?)

    (When I ran Mystic in docker, I could did this - "docker attach" let me jump onto the console for the WFC screen, but otherwise, my "docker stop" gracefully
    shutdown - since mystic intercepts kill signals.)
    ...deon


    ... I either want less corruption, or more chance to participate in it.
    --- SBBSecho 3.10-Linux
    * Origin: I'm playing with ANSI+videotex - wanna play too? (21:2/116)
  • From Vk3jed@21:1/109 to Avon on Wed Jan 22 13:43:00 2020
    On 01-21-20 21:38, Avon wrote to g00r00 <=-

    A request I've seen voted upwards by others several times that I wanted
    to pass along to you:

    Being able to shutdown MIS (windows or linux) and MIS -D (linux) gracefully from a command line. So if I wanted to run a backup script
    and not have MIS running it can be shutdown gracefully without a human being needing to press the ESC key and press enter on YES

    On Linux:

    killall mis

    should do the trick, because by default, kill and killsll send SIGTERM, which tells the process to shutdown in an orderly manner.


    ... 66 percent of Americans can't do basic math.... that's almost half!
    === MultiMail/Win v0.51
    --- SBBSecho 3.10-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (21:1/109)
  • From Vk3jed@21:1/109 to ryan on Wed Jan 22 13:47:00 2020
    On 01-21-20 09:31, ryan wrote to Argos <=-

    If this is a motion on the floor, I'd like to 2nd it. to execute a
    Mutil type command at the prompt before a batch backup run .. then a
    Mutil type command to launch MIS back normally.

    I'd even be inclined to vote /more/ strongly for keeping mis running,
    but when connection attempts are made, it throws some kind of "the bbs
    is undergoing nightly maintenance, please call back" type message.

    The benefit here is that we'd potentially be able to put a backup job
    in mystic's own events. I, a linux user, would otherwise have to
    disable the automatic systemd job to launch mystic, shut the board
    down, do the backup, re-enable the systemd job, and start the BBS once again. Simply pausing any activity to/from data files with a "board is temporarily down" message seems like a home run in this case :)

    I use a cron job to both monitor and start mis if it's not already running. The backup problem is easy for me to handle. Any script that manages MIS can tell it not to restart by dropping a file called /tmp/upgrade". The file doesn't have to contain anything. If this file exists, the script that attempts to restart MIS will abort. That way, backups and upgrades can be done easily. To restart the BBS, I can simply remove that file or run the script that restarts MIS directly, because that script also removes /tmp/upgrade.


    ... Click...click...click...Damn, out of taglines again!
    === MultiMail/Win v0.51
    --- SBBSecho 3.10-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (21:1/109)
  • From Vk3jed@21:1/109 to Alterego on Wed Jan 22 13:48:00 2020
    On 01-22-20 09:35, Alterego wrote to Avon <=-

    So between touching the "shutdown" semaphore, you test that the "im running" semaphore gets deleted. And after touching the "start"
    sempahore, you check that the "im running" semaphore is created (and
    that way you know its working at an application level). (The "shutdown" and "start" semaphores also get deleted when actioned...)
    ...deon

    While Mystic doesn't use semaphores like this, my systems for upgrading and backing up Mystic do use them.


    ... It's innocence when it charms us, ignorance when it doesn't.
    === MultiMail/Win v0.51
    --- SBBSecho 3.10-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (21:1/109)
  • From ryan@21:1/168 to Vk3jed on Tue Jan 21 19:10:54 2020
    On Linux:

    killall mis

    should do the trick, because by default, kill and killsll send SIGTERM, which tells the process to shutdown in an orderly manner.

    I'm not really a fan of this method. It's pretty brute force...there's no communicating to a user that there will be maintenance, it's just a
    terminated connection, no matter what the users may be doing at the time.

    Furthermore I use a systemd service to start mystic on boot and monitor it being up. killall mis would, in my case, just cause the daemon to restart due to the systemd service. I'd prefer to keep the service since that's a real
    true modern linux way of managing services :)

    --- Mystic BBS v1.12 A44 2020/01/16 (Linux/64)
    * Origin: monterey bbs (21:1/168)
  • From ryan@21:1/168 to Vk3jed on Tue Jan 21 19:14:34 2020
    I use a cron job to both monitor and start mis if it's not already running. The backup problem is easy for me to handle. Any script that manages MIS can tell it not to restart by dropping a file called /tmp/upgrade". The file doesn't have to contain anything. If this file exists, the script that attempts to restart MIS will abort. That way, backups and upgrades can be done easily. To restart the BBS, I can
    simply remove that file or run the script that restarts MIS directly, because that script also removes /tmp/upgrade.

    I know we're just splitting hairs here but fully killing the mis process
    seems unnecessary to me if we just want to pause writing to any of its files while we do a backup.

    I also prefer using an init script (systemd, init.d, for example) to launch
    and monitor the BBS daemon. I know cronjobs can work, I just don't think
    that's the most graceful approach and it's one I'd rather avoid :)

    The major reason I'd prefer not killing and restarting mis is the user facing portion. Why not have mis continue to run and respond to incoming connections with a message that the bbs is undergoing maintenance? Couple that with pre=emptive alerting to users that the board will go down at a certain time...hell, perhaps even stop allowing incoming connections at a certain
    time but let your already connected users disconnect as normal, then conduct the maintenance once none of the nodes are tied up. No user facing negativity there at all.

    --- Mystic BBS v1.12 A44 2020/01/16 (Linux/64)
    * Origin: monterey bbs (21:1/168)
  • From Vk3jed@21:1/109 to ryan on Wed Jan 22 17:56:00 2020
    On 01-21-20 19:10, ryan wrote to Vk3jed <=-

    I'm not really a fan of this method. It's pretty brute force...there's
    no communicating to a user that there will be maintenance, it's just a terminated connection, no matter what the users may be doing at the
    time.

    Good point, though if scheduled, you could have an event that boots users off beforehand. Unscheduled is a bit trickier. I'm not sure if you can broadcast a message to users.

    Furthermore I use a systemd service to start mystic on boot and monitor
    it being up. killall mis would, in my case, just cause the daemon to restart due to the systemd service. I'd prefer to keep the service
    since that's a real true modern linux way of managing services :)

    One could argue the toss either way. With Linux, there's always more than one way to skin a cat. :)


    ... Nougalicity - Degree to which a Snickers will stretch before breaking.
    === MultiMail/Win v0.51
    --- SBBSecho 3.10-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (21:1/109)
  • From Vk3jed@21:1/109 to ryan on Wed Jan 22 18:02:00 2020
    On 01-21-20 19:14, ryan wrote to Vk3jed <=-

    I know we're just splitting hairs here but fully killing the mis
    process seems unnecessary to me if we just want to pause writing to any
    of its files while we do a backup.

    True, that is a fair point.

    I also prefer using an init script (systemd, init.d, for example) to launch and monitor the BBS daemon. I know cronjobs can work, I just
    don't think that's the most graceful approach and it's one I'd rather avoid :)

    This one I think is possibly a bit pedantic. One uses the method that works best for their situation. I don't want something happening during a backup, or worse, during a software upgrade!

    The major reason I'd prefer not killing and restarting mis is the user facing portion. Why not have mis continue to run and respond to
    incoming connections with a message that the bbs is undergoing maintenance? Couple that with pre=emptive alerting to users that the
    board will go down at a certain time...hell, perhaps even stop allowing incoming connections at a certain time but let your already connected users disconnect as normal, then conduct the maintenance once none of
    the nodes are tied up. No user facing negativity there at all.

    Good points on the user facing side. Scheduled backups should be pretty straightforward. There would be a mechanism to run an event that requires all users to be logged out. That's been a staple of BBSs for decades, and users are typically warned upon login that their session has been shortened by the upcoming event. I haven't looked into how to do it, but it should be possible.


    ... MS-DOS: MR-DOS's sister; DR DOS: MS-DOS's Gynecologist.
    === MultiMail/Win v0.51
    --- SBBSecho 3.10-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (21:1/109)
  • From Static@21:2/140 to Avon on Wed Jan 22 05:45:46 2020
    On 21 Jan 2020, Avon said the following...
    Being able to shutdown MIS (windows or linux) and MIS -D (linux) gracefully from a command line.

    You can do this already with the Linux server. If you execute "mis shutdown"
    it will cleanly close itself down. Presumably it also traps SIGTERM and will
    do the same if you kill the process from the CLI or a script.

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Subcarrier BBS (21:2/140)
  • From g00r00@21:1/163 to Avon on Fri Jan 24 11:16:14 2020
    Being able to shutdown MIS (windows or linux) and MIS -D (linux) gracefully from a command line. So if I wanted to run a backup script
    and not have MIS running it can be shutdown gracefully without a human being needing to press the ESC key and press enter on YES

    In Linux running "mis shutdown" should do it for you to shutdown the service from the command line. You might need to use sudo to do it.

    There isn't a service in Windows so it doesn't work, but maybe I can expand on it so that it can do a shutdown of the UI. I'll look into maybe having a semaphore file that will force the UI or daemon to shutdown.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: |08--[|15!|07dreamland BBS bbs.dreamlandbbs.org (21:1/163)
  • From g00r00@21:1/163 to ryan on Fri Jan 24 11:36:26 2020
    I'd even be inclined to vote /more/ strongly for keeping mis running, but when connection attempts are made, it throws some kind of "the bbs is undergoing nightly maintenance, please call back" type message.

    I think this might be ideal if we can get it to work. One issue is that all
    of MIS servers are likely to touch data files in some way or another, so its really a window that would have to be maintained for every single server type.

    It might be tricky to get all of that working in a clean way, but I agree it'd be ideal.

    Or maybe even an "offline" event type that will take all servers down, execute a batch file/shell script, and automatically put everything back up once that process completes.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: |08--[|15!|07dreamland BBS bbs.dreamlandbbs.org (21:1/163)
  • From g00r00@21:1/163 to Alterego on Fri Jan 24 11:39:06 2020
    Being able to shutdown MIS (windows or linux) and MIS -D (linux) gracefully from a command line. So if I wanted to run a backup script not have MIS running it can be shutdown gracefully without a human be needing to press the ESC key and press enter on YES

    A better cross platform approach may be the use of semaphores - which is how Taurus does it.

    I think this is the way I will go. Linux currently uses OS-level stuff to SIGTERM MIS using a shutdown command. But I can change it to a semaphore so it cross platform. The only thing issue is that the way MIS event hooks are currently implemented it might take up to a minute to shutdown, so I'll have
    to look into what I can do to make that more responsive.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: |08--[|15!|07dreamland BBS bbs.dreamlandbbs.org (21:1/163)
  • From g00r00@21:1/163 to Avon on Fri Jan 24 11:39:42 2020
    A better cross platform approach may be the use of semaphores - which how Taurus does it.

    Interesting idea... personally I'd love a switch that I could just pass in a batch file to MIS but that's just me :)

    Why not both? :)

    I'll just make it work off a semaphore, but when you type "mis shutdown" it will create the semaphore!

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: |08--[|15!|07dreamland BBS bbs.dreamlandbbs.org (21:1/163)
  • From g00r00@21:1/163 to Alterego on Fri Jan 24 11:42:46 2020
    So folks who run mysic on linux, could do this with systemd or init/rc start stop scripts. (Although IIRC, mystic shows a WFC type screen when started?)

    (When I ran Mystic in docker, I could did this - "docker attach" let me jump onto the console for the WFC screen, but otherwise, my "docker
    stop" gracefully shutdown - since mystic intercepts kill signals.)

    In Linux this is the right way - MIS is already coded to gracefully shutdown with term signals (which is why I always warn people to stop using forced kill commands because it could corrupt data and there is a graceful way to do it already in place). And I think even the UI knows if it received an automated signal and will not ask the "Quit?" confirmation.

    Windows people have no alternative though

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: |08--[|15!|07dreamland BBS bbs.dreamlandbbs.org (21:1/163)
  • From g00r00@21:1/163 to Vk3jed on Fri Jan 24 11:48:38 2020
    I use a cron job to both monitor and start mis if it's not already running. The backup problem is easy for me to handle. Any script that manages MIS can tell it not to restart by dropping a file called /tmp/upgrade". The file doesn't have to contain anything. If this file exists, the script that attempts to restart MIS will abort. That way,

    I had something like this on my Linux laptop BBS install. I was able to do
    all of my upgrading via Mystic-DOS from a remote system via telnet, SSH or whatever.

    Making a way to make this a little easier for people would be nice though and
    I am trying to move in the direction of automatic upgrades and stuff too.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: |08--[|15!|07dreamland BBS bbs.dreamlandbbs.org (21:1/163)
  • From g00r00@21:1/163 to ryan on Fri Jan 24 11:50:08 2020
    I'm not really a fan of this method. It's pretty brute force...there's no communicating to a user that there will be maintenance, it's just a terminated connection, no matter what the users may be doing at the time.

    This is true. But there is a BBS event type which you can configure to force users to log out at a certain time, and that will give them a warning. That
    is the reason why I made that event type - so you can sort of coordinate it with any other processes you might have that force the BBS offline.

    Of course that isn't the best way to handle it because someone could easily log in right as all of that is shutting down, but it was sort of a quick bandaid
    at the time.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: |08--[|15!|07dreamland BBS bbs.dreamlandbbs.org (21:1/163)
  • From Avon@21:1/101 to g00r00 on Sat Jan 25 10:34:16 2020
    On 24 Jan 2020 at 11:16a, g00r00 pondered and said...

    In Linux running "mis shutdown" should do it for you to shutdown the service from the command line. You might need to use sudo to do it.

    There isn't a service in Windows so it doesn't work, but maybe I can expand on it so that it can do a shutdown of the UI. I'll look into
    maybe having a semaphore file that will force the UI or daemon to shutdown.

    Thank you. It's really for me about the MIS logs being file locked when you want to run some backup processing while MIS is running...

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101)