• MIS Shutdown Event?

    From Gryvon@21:2/107 to All on Sat Sep 28 10:58:54 2019
    This really feels like something that should be easy to do, but I can't
    figure it out for the life of me.

    Is there a way to have an Event that shuts down MIS? I need part of my
    nightly maintenance to include a reboot, and I don't like the idea of just
    task killing it.

    Any help or thoughts would be appreciated.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: The Northern Borderlands (21:2/107)
  • From Zip@21:1/202 to Gryvon on Sat Sep 28 21:56:36 2019
    Hello Gryvon!

    On 28 Sep 2019, Gryvon said the following...
    Is there a way to have an Event that shuts down MIS? I need part of my nightly maintenance to include a reboot, and I don't like the idea of
    just task killing it.

    I would want that too (actually for restarts) -- I ended up creating a cron
    job for detecting a semaphore and restarting MIS instead...

    If you can assign the BBS (Mystic) user rights to stop the service (you're on Windows? Perhaps some NET STOP <service name> command or nowadays probably PowerShell stuff to the same effect), i.e. itself, then that could work.

    But it would still require a scheduled job outside of Mystic I think...

    Best regards
    Zip

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Star Collision BBS, Uppsala, Sweden (21:1/202)
  • From Gryvon@21:2/107 to Zip on Sat Sep 28 20:19:51 2019
    Is there a way to have an Event that shuts down MIS? I need part of m nightly maintenance to include a reboot, and I don't like the idea of just task killing it.

    I would want that too (actually for restarts) -- I ended up creating a cron job for detecting a semaphore and restarting MIS instead...

    If you can assign the BBS (Mystic) user rights to stop the service
    (you're on Windows? Perhaps some NET STOP <service name> command or nowadays probably PowerShell stuff to the same effect), i.e. itself,
    then that could work.

    But it would still require a scheduled job outside of Mystic I think...

    Yes, it's Windows. I'm okay if I need to do it through the Task Scheduler.
    And it's easy enough to write a batch file with "taskkill /f mis.exe"
    followed by "shutdown /r". That'd ultimately do the trick, but I don't like
    the idea of force-quiting the server every night. Something will get
    corrupted, eventually. That's how my luck goes.

    If there were some way for MIS to just shut down programatically and I can
    have an appropriately timed scheduled task to reboot. That'd do the trick. I just can't see how I can do that.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: The Northern Borderlands (21:2/107)
  • From tallship@21:2/104 to Gryvon on Sat Sep 28 21:10:41 2019
    On 28 Sep 2019, Gryvon said the following...

    Is there a way to have an Event that shuts down MIS? I need part nightly maintenance to include a reboot, and I don't like the id just task killing it.

    I would want that too (actually for restarts) -- I ended up creating cron job for detecting a semaphore and restarting MIS instead...

    If you can assign the BBS (Mystic) user rights to stop the service (you're on Windows? Perhaps some NET STOP <service name> command or nowadays probably PowerShell stuff to the same effect), i.e. itself, then that could work.

    But it would still require a scheduled job outside of Mystic I think.

    Yes, it's Windows. I'm okay if I need to do it through the Task
    Scheduler. And it's easy enough to write a batch file with "taskkill /f mis.exe" followed by "shutdown /r". That'd ultimately do the trick, but


    A couple of things I'm noting here, first, I said to myself, "Well sure
    that's easy! just set up an event in Mystic's Event editor to perform a 'systemctl restart mis.service' (Debian, ewboontew, CentOS, etc).
    Slackware would be '/etc/rc.d/rc.mis restart'.Folks using OpenRC would use those facilities instead of SystemD or SysV-ish.This is a perfectly doable thing.

    Alternatively, a cronjob or anacron. Both scenarios would work flawlessly I think, and the second scenario would allow one to actually stop mis and then start it a few minutes later. Or, the Event Editor could run the job to stop mis on a pre-determined schedule followed by cron starting it back up later.

    And then, I saw the Origin line... Windows. Okay so I didn't comment, but
    there are plenty of facilities with scheduling tasks there too.

    On the Windows front, I wanted to mention something that I used to use when I set up Windows domains with SAMBA for organizations. Some people have
    enntioned problems with roaming profiles and yes, it's always been a biotch
    in Windows, but Netlogon is your friend ;)

    What I would do is use Kixtart scripts to do everything during a login
    process - even the very first time someone logs into a new work station. here's how:

    There's a couple of features with Kixtart where you can place part of what Kixtart needs into Netlogon, something anyone logging into the domain has access to during that logon process, A .sys and a .bat IIRC. The .sys enabled Kixtart to function, and the .bat (the only real executable you could put
    into Netlogon would grab the Kixtart logon script from a public share, pull
    it onto the user's machine, and then it would execute every time the user
    logs in.

    Then it maps out persistent or non-peristent netork shares P:\ for public and H:\ for home, where each person's roaming profiles are located, fetches their profile, and loads that on the new workstation. All of their files are in
    their H:\ drive and a logon server keeps track of which machie that is (You
    may be coming to work for a week in Los Angeles from New York or London).

    Anyway, there was, and still is, so much that can be done with Kixtart, which is still maintained, although Powershell has supplanted much over the past
    few years. The reason for using Kixtart was to work around limitations in NT, and of course, with the proviso that the enterprise has standardized on a particular version of Windows.

    Kixtart would draw a really pretty DOS looking style colorized logon screen
    and at it's very basic level is identical to DOS batch files, but with conditional branching and the availability of variables like %username%,
    etc., at your disposal you can do pretty much anything you can imagine - including a logout script that will copy back anything you need, or
    installing software without the aid of something like an SMS server or WinInstall or any other tools that were once prominent for Windows Enterprise environments, but kixtart would scale all the way down to a 4 user company
    too in a portable way :)

    http://www.kixtart.org/

    Obviously, I don't really do Windows stuff much anymore so I'm kinda out of
    the loop, but that is still a viable solution, and can run on a Windows machine to be used for things like starting and stopping mis at particular times with sleep functions, whatev. You can get creative, as its utility is more than just using it for logon scripting.


    Just thought I'd throw that out there, and anyone who's familiar with DOS
    batch programming will excel immediately with Kixtart because on the basic level it is identical :)

    Not just for this thread, but I wanted to throw this out there for others who may find such a batch programming language useful. Think Bash functionality
    for DOS batch files :)

    I hope that helps :)

    Kindest regards,

    Bradley

    .

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Vger.Cloud - NOMAD Internetwork (21:2/104)
  • From Gryvon@21:2/107 to tallship on Sat Sep 28 22:07:45 2019
    A couple of things I'm noting here, first, I said to myself, "Well sure that's easy! just set up an event in Mystic's Event editor to perform a 'systemctl restart mis.service' (Debian, ewboontew, CentOS, etc). Slackware would be '/etc/rc.d/rc.mis restart'.Folks using OpenRC would
    use those facilities instead of SystemD or SysV-ish.This is a perfectly doable thing.

    It's funny. I'm ... okay... with Linux OS's but I'm much more comfortable
    with Windows & DOS. It did actually occur to me to think "Gee, Jack. If you
    did this in Ubuntu or something, his would be really easy." But the fact is that so many other things would be much less easy for me. So, I'm sticking
    with Windows. And delibertly with Win/32 so I don't have to fiddle around
    with emulation for 16-bit DOS doors. Not because I can't - because I don't
    want to.

    Anyway, there was, and still is, so much that can be done with Kixtart, which is still maintained, although Powershell has supplanted much over the past few years. The reason for using Kixtart was to work around limitations in NT, and of course, with the proviso that the enterprise
    has standardized on a particular version of Windows.

    I had completely forgotten about Kixtart. There's another trip down memory
    lane for me. But I don't know that it would have a solution to my problem of *not* force-quiting MIS. Unless I'm missing something about what you're
    trying to tell me, here, it seems easier to just stick with Task Scheduler
    and have it run a batch file at a set time every night.

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: The Northern Borderlands (21:2/107)
  • From Zip@21:1/202 to Gryvon on Sun Sep 29 11:48:24 2019
    Hello Gryvon!

    On 28 Sep 2019, Gryvon said the following...
    Scheduler. And it's easy enough to write a batch file with "taskkill /f mis.exe" followed by "shutdown /r". That'd ultimately do the trick, but
    I don't like the idea of force-quiting the server every night. Something will get corrupted, eventually. That's how my luck goes.

    Try the following in your batch file instead of the TASKKILL command:

    NET STOP "service name"

    Check the exact service name under Services --> right-click on the service and choose Properties --> check the Service Name listed, and use that one.
    Usually the service name listed does not have any spaces in it, so you
    probably don't need the double quotes.

    When MIS shuts down, any users logged on will be kicked out and things should be fine.

    (Actually, the SHUTDOWN command should stop all services, so chances are that you might not need any of NET or TASKKILL...)

    Hope this helps!

    Best regards
    Zip

    --- Mystic BBS v1.12 A43 2019/03/02 (Linux/64)
    * Origin: Star Collision BBS, Uppsala, Sweden (21:1/202)
  • From Gryvon@21:2/107 to Zip on Sun Sep 29 11:48:51 2019
    Try the following in your batch file instead of the TASKKILL command:

    NET STOP "service name"

    Check the exact service name under Services --> right-click on the
    service and choose Properties --> check the Service Name listed, and use that one. Usually the service name listed does not have any spaces in
    it, so you probably don't need the double quotes.

    When MIS shuts down, any users logged on will be kicked out and things should be fine.

    (Actually, the SHUTDOWN command should stop all services, so chances are that you might not need any of NET or TASKKILL...)

    Hope this helps!

    I appreciate it. I don't believe MIS operates as a service in Windows, so Net Stop won't help me, unfortunately. I did find out, however, that taskkill and shutdown will both send a VM_CLOSE to the services, so hopefully MIS is smart enough to shut down gracefully.

    I've settled on just relying on a batch file with shutdown /r at the end.
    We'll see if I making a mistake, perhaps.

    On that note, time to start working on automated backups...

    --- Mystic BBS v1.12 A43 2019/03/03 (Windows/32)
    * Origin: The Northern Borderlands (21:2/107)