12 Replies Latest reply on Aug 21, 2014 3:05 AM by johnbuckingham

    FileMaker Server; Uninterruptible Power Supply advice sought

    johnbuckingham

      Could anyone point me to any discussion or 'how to' in respect of configuring a UPS with FileMaker Server - Specifically Mac OS X 10.9; FMS12?

       

      I would be particularly interested to hear how it is advised to script for a quick but graceful shutdown. And how to invoke it...

       

      Thanks in adance

      John Buckingham

        • 1. Re: FileMaker Server; Uninterruptible Power Supply advice sought
          wimdecorte

          Most decent UPSes have monitoring software that allow you to run an OS-level script (applescript or shell script in this case).

          That OS script will then use the FMS command line interface to close the files.

           

          Configure the monitoring software to start that process after say 2 minutes of power-out (that will prevent it from triggering it on simple power spikes)

          Note that FMS will take up to 5 minutes to close the files because it will desperataly try to communicate with the disconnected clients.

          Also evaluate what kind of server-side schedules you have running (how frequently and how long they take).

           

           

          That means that your UPS meeds to be able to keep the machine alive for at least 15-20 minutes (to be on the safe side).

          2 of 2 people found this helpful
          • 2. Re: FileMaker Server; Uninterruptible Power Supply advice sought
            johnbuckingham

            Thanks, Wim.

             

            I have been using APS Power Supplies, and while they have a good interface to the Mac System Preferences, it seems that this has only offers a variety of options to tell it when to start hardware shut down. Rather than the monitoring system you mention...

             

            I guess that's better than nothing, but I was hoping to invoke fmsadmin calls to forcibly disconnect all clients and then forcibly close all open files before closing the server. Then shut down the hardware. Hence my asking about scripting. But I guess I has what I has!

             

            Thanks again

            JB

             


            • 3. Re: FileMaker Server; Uninterruptible Power Supply advice sought
              johnnyb

              By default, FileMaker Server on the Mac will shut down cleanly (or at least try) if the OS is shutting down. When the OS it told to shut down, launchd will stop the FileMaker service as part of the shutdown sequence, using a fmsadmin stop command. So, if nothing else, have your UPS software simply shut down the server, and it should do just what you want automatically.

               

              Note also that OS X comes with built-in UPS software that recognizes most APC UPSes. You can use pmset to control the thresholds and timers, and you can modify the /etc/libexec/upsshutdown script to control what happens when the UPS says it's time for an emergency shutdown. The provided script can shutdown the computer cleanly, but trick the Mac into thinking it was unclean so that it will start itself back up when power is restored. To make this work, be sure you have "Power on automatically after a power failure" checked in Energy Saver, then add "WaitForUPS=-yes-" to the /etc/hostconfig file.

               

              If you require more granular control, or if you want to perform other steps while shutting down the server, you might find the open-source apcupsd offers both the greatest flexibility and the greatest complexity:

               

              http://www.apcupsd.org/manual/manual.html

               

              You can use apcupsd to set up a shutdown sequence in which you script commands like launchctl stop com.filemaker.fms, or you can do any specific things with fmsadmin that you might want to do.

               

              But I'd just stick with the built-in software. apcupsd is overkill, and the Powerchute control panel is kind of weak. Check the man pages for pmset and upsshutdown for a little more info about the Mac's built-in support for UPSes.

              1 of 1 people found this helpful
              • 4. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                wimdecorte

                johnnyb wrote:

                 

                By default, FileMaker Server on the Mac will shut down cleanly (or at least try) if the OS is shutting down. When the OS it told to shut down, launchd will stop the FileMaker service as part of the shutdown sequence, using a fmsadmin stop command. So, if nothing else, have your UPS software simply shut down the server, and it should do just what you want automatically.

                 

                Same on Windows.  But "should" is a big word here.  Hope is a bad strategy when it comes to integrity of the data...

                • 5. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                  johnnyb

                  I suppose an especially concerned administrator would want to investigate and model a number of cases to determine when launchd might fail to issue fmsadmin stop and when some other tool would succeed, and whether one case or another is more or less likely to risk damaging the integrity of the data by virtue of the tool being used to issue the command.

                  • 6. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                    wimdecorte

                    There have been documented case of machine shutdowns that did not cleanly close the files, so it is not an unknown.

                    • 7. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                      Mike_Mitchell

                      Definitely not. We have that issue frequently during patching of servers, when admins issue the command to shut down the server without explicitly stopping the files first. Wim is absolutely correct.

                      • 8. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                        JFWX5

                        Hi All,

                         

                        FYI,

                         

                        Found this on the FileMaker Fourm posted by

                         

                        TSFalcon

                        FileMaker, Inc.

                         

                         

                        Which one is right?

                        •  

                           

                          • John Niebler:Thank you for the post. If a shut down signal is sent to the operating system, then FileMaker Server will slow the shutdown process to properly close the hosted files and stop the processes. This process can be observed in the FileMaker Server event.log. Below I have attached a screenshot of my event.log showing the process that took place the last time I clicked  > Shut Down… to power off my computer. TSFalconFileMaker, Inc.

                             

                        • 9. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                          wimdecorte

                          It's not a question of being right.  There are many documented cases of a machine shutdown NOT properly closing the files.  I do believe that FMS does its best to allow a graceful shutdown to happen but it is not an exact science.

                           

                          The only prudent way out is to explicitly take control and not let another process implicitly rule your files.

                          • 10. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                            johnnyb

                            If you do elect to take control with a custom script, just be sure to do it carefully and thoroughly. Make sure your script checks the results of its actions and responds appropriately before proceeding. Understand the various conditions that might prevent your files from closing cleanly, and make sure your script knows what to do in those cases. The shutdown process implemented by FileMaker stops things in the correct order and waits as best it can for the actions to finish successfully, so if yours is not at least as careful as theirs, you will be assuming greater risk.

                             

                            And in any case, be sure your batteries and backups are healthy and regularly tested. You can think both are fine, but only by testing can you discover real problems before it's too late.

                            • 11. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                              wimdecorte

                              johnnyb wrote:

                               

                              If you do elect to take control with a custom script, just be sure to do it carefully and thoroughly. Make sure your script checks the results of its actions and responds appropriately before proceeding.

                               

                              That's crucial.  I've demoed OS-scripts that do this at various devcon through the years.

                               

                              One big benefit of doing this yourself is that you have the opportunity to email someone if a step fails so that (hopefully) a manual intervention can be done.

                              That's not possible when relying on the system shutdown.

                              • 12. Re: FileMaker Server; Uninterruptible Power Supply advice sought
                                johnbuckingham

                                Thank you for these considered and useful replies. It seems that probably the best option for me is as you describe, Wim; i.e. set the APC to initiate shutdown after two minutes of down time and hope that a graceful exit will complete before the power runs out. I use the word 'best' in this context because I have no experience in writing OS scripts and I am sure the standard FileMaker script is way more resilient (and tested) than anything I could put together...

                                 

                                JB