12 Replies Latest reply on Mar 28, 2017 8:35 AM by wimdecorte

    Invalid Account for System-Level Script

    tamalellama

      When I attempt to run a system-level script, I get an error "Invalid account" and the error log is:

      Schedule "Restart FMSE" run now by "Administrator"

      Schedule "Restart FMSE" scheduled for 3?23/2017 08:30 AM.

      Schedule "Restart FMSE" aborted; invalid account name or password.

      Schedule "Restart FMSE" has started system script "restartFMSE.sh" with process ID 2677.

       

      I am attempting to run this script on FMS 15 running on MacOS Sierra 10.12.3. I'm completely unfamiliar with MacOS.

       

      I have created a bash script (restartFMSE.sh) in /Library/Filemaker Server/Data/Scripts and run chmod u+x restartFMSE.sh so that the file attributes are -rwxr--r--+ 1

       

      I have changed the permissions on restartFMSE.sh so that the fmserver user has Read & Write.

       

      The contents of restartFMSE.sh are:

      #!/bin/bash

      fmsadmin restart fmse -y

       

      What do I need to do in order to enable this script to run?

        • 1. Re: Invalid Account for System-Level Script
          mikebeargie

          You essentially are trying to force a restart on the service that is executing the script to begin with. I'm not sure this mobius strip style of function is even possible.

           

          What are you running that command?

           

          If FMSE is stuck, you should be trying to figure out how that is happening, not casually scheduling a regular reboot of that service.

           

          What happens when you double click to run the script straight out of the folder, does it work?

          • 2. Re: Invalid Account for System-Level Script
            tamalellama

            Well, we've been trying to find out what is happening for four years. FileMaker doesn't seem to be interested. I'm simply tired of restarting the script engine every morning.

             

            Funny thing is, you are one of the people who recommended this solution:FMS13 fmsased Memory Leak - fmsased grows until restart when using scheduled scripts FMS13 fmsased Memory Leak - fmsased grows until restart when using scheduled scripts

             

            I think because this is a system-level script run at the end of a script sequence, it should work.

            • 3. Re: Invalid Account for System-Level Script
              mikebeargie

              My recommendation now would be to use a current version of filemaker.

               

              As for scheduling system scripts like this, I don’t use filemaker server.

               

              On windows I use the task scheduler to run a .bat file separate from filemaker completely.

               

              On OSX, I use launchd or cron to setup a job. There are a number of GUI tools out there for managing those jobs (cronnix for cron, an app called LaunchControl for launchd)

               

               

              I use filemaker system level scripts only for file-specific actions, like moving files from the server documents folder to a shared drive after an export script is run.

              1 of 2 people found this helpful
              • 4. Re: Invalid Account for System-Level Script
                tamalellama

                Thanks Mike, but I'm running FMS 15 and because these scripts run sequentially and for varying amounts of time, it's impossible to schedule the system script to occur at the correct time without having it follow the FM script.

                 

                Perhaps there is someone else out there who can tell me how to use FMS as it was designed to be used?

                • 5. Re: Invalid Account for System-Level Script
                  mikebeargie

                  ouch, passive aggression... Your link to the old article was referring to FMS13, so when responding out of my email I didn't have the memory of your earlier post. Apologies for not having a recollection of that.

                   

                  FMS scheduled scripts all support hard stop time limits. So you could place time limits on your scripts so that any system level tasks would run without collision.

                   

                  IMHO (for what it's worth), windows servers are much better suited for server work than OSX at this point. If I were in your shoes, I would be hounding filemaker support daily, since obviously your server is not working as "it was designed to be used."

                  1 of 1 people found this helpful
                  • 6. Re: Invalid Account for System-Level Script
                    wimdecorte

                    tamalellama wrote:

                     

                    Perhaps there is someone else out there who can tell me how to use FMS as it was designed to be used?

                     

                    Don't do that, it's not nice.  People here are trying to help you.  For free.

                     

                    I use script sequence schedules all the time with OS-level scripts before and after FM scripts.  But like mikebeargie is saying I wouldn't use an FMS schedule to start/stop/restart any component of FMS; I would do that with the OS schedulers.

                    Like Mike; I have found Windows servers to be more robust in this than OSX, so if that is an option for you, try it on a Windows server for a while, if it is more stable then at least you can move on.   You can do this for a low cost and risk free by setting up a Windows instance in AWS or Azure or Google Cloud.  If you don't like it, abandon it.

                    2 of 2 people found this helpful
                    • 7. Re: Invalid Account for System-Level Script
                      tamalellama

                      I'm not sure why, what I wrote would be viewed as not nice or passive aggressive. I didn't intend it to be. Unfortunately, abbreviated text rarely communicates tone well. I'm sorry for sure.

                       

                      I do appreciate any help, but I wanted to broaden the possibilities that others might offer a comment and not think, "Mike's got this covered." My question is simple enough for someone familiar with Mac OSX I'm sure. wimdecorte, you apparently know how to get a system-level script to run!

                       

                      Let's start over:

                       

                      When I attempt to run a system-level script, I get an error "Invalid account" and the error log is:

                       

                      Schedule "Run a Script" scheduled for 03/28/2017 08:30 AM.

                      Schedule "Run a Script" has started system script "myScript.sh" with process ID 71463.

                      Schedule "Run a Script" aborted; invalid account name or password.

                      Schedule "Run a Script" run now by "Administrator"

                      Schedule "Run a Script" created by "Administrator"

                      Schedule "Run a Script" scheduled for 03/28/2017 01:00 AM.

                       

                      I am attempting to run this script on FMS 15 running on MacOS Sierra 10.12.3. I'm completely unfamiliar with MacOS.

                       

                      I have created a bash script (myScript.sh) in /Library/Filemaker Server/Data/Scripts and run chmod u+x myScript.sh so that the file attributes are -rwxr--r--+ 1

                       

                      I have changed the permissions on myScript.sh so that the fmserver user has Read & Write.

                       

                      The contents of myScript.sh are:

                      #!/bin/bash

                      echo "tada!" >> result.txt

                       

                      What do I need to do in order to enable this script to run?

                      • 8. Re: Invalid Account for System-Level Script
                        user19752

                        If you run the script using fmserver account, it should have not only R&W, X also. The .sh file may not be owned by fmserver.

                        chmod o+x myScript.sh

                         

                        You'd need full path for write file result.txt

                        • 9. Re: Invalid Account for System-Level Script
                          twelvetens

                          The command your trying to run requires super user level access to run, so the fmserver user process will not be able to execute it properly.

                          you'll need to add the fmserver (or whatever user name your trying to run the script under) to the sudoers group:

                           

                          Specifying a User Account to Run System-level Scripts with FileMaker Server | FileMaker

                          • 10. Re: Invalid Account for System-Level Script
                            tamalellama

                            Thanks, I've done this so that the attributes now read:
                            -rwxr--r-x@  1 administrator  fmsadmin    43 Mar 27 12:42 myScript.sh

                             

                            Still no joy.

                            • 11. Re: Invalid Account for System-Level Script
                              tamalellama

                              Thank, this was helpful and odd that it doesn't apply to FMS 15, but apparently does?

                               

                              The note: "To use a user account to run a script in Mac OS, you must add the following entries to the  /etc/sudoers file" seems fairly important and less vague than what is mentioned here: Adding system-level script sequence options | FileMaker

                               

                              For those, like me, who are OSX, vi, sudoers ignorant, this article may help with the nuances of editing this file: How to Add a User to the Sudoers File in Mac OS X

                               

                              All of that said, I added the following lines to sudoers:

                               

                              Host_Alias FMSHOST = myserver.local

                              Defaults:fmserver targetpw, timestamp_timeout=0, passwd_tries=1

                              fmserver FMSHOST = (ALL) /Library/FileMaker\ Server/Data/Scripts/*, /bin/kill

                               

                              No joy.

                               

                              So for good measure, I added:

                               

                              fmserver     ALL = (ALL) ALL

                               

                              Still no joy. The server log returns the same errors.

                               

                              Any more ideas?

                              • 12. Re: Invalid Account for System-Level Script
                                wimdecorte

                                tamalellama wrote:

                                 

                                Thanks, I've done this so that the attributes now read:
                                -rwxr--r-x@ 1 administrator fmsadmin 43 Mar 27 12:42 myScript.sh

                                 

                                 

                                 

                                For FMS to run a script, it has to be owner.  In your output above, 'administrator' is the owner.