# How can I gracefully shut down FileMaker Server on Mac Mini running MacOS14

**URL:** <https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090>\
**Category:** Questions\
**Tags:** filemaker-server\
**Created:** [April 12, 2024, 1:55pm UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090 "2024-04-12T13:55:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![barefoot](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/barefoot/32/2553_2.png) [@barefoot](https://the.fmsoup.org/u/barefoot)\
**Post date:** [April 12, 2024, 1:55pm UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090/1 "2024-04-12T13:55:15Z")

</div>

On Windows I follow these steps:

1. in admin console: closing all hosted files
2. stopping FMServer in admin console
3. in Windows Services stopping FileMaker Server

On MacOS first 2 steps same but 3. I am using the Terminal to run: sudo service fmshelper stop  
is this the way to do it or am I missing something?

Thank you!

---

<div class="post-metadata">

**Author:** ![stevegleason](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@stevegleason](https://the.fmsoup.org/u/stevegleason)\
**Post date:** [April 12, 2024, 3:20pm UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090/2 "2024-04-12T15:20:09Z")

</div>

sudo launchctl stop com.filemaker.fms

Also check your Activity Monitor before shutting down. Search for "fm" to limit to fms related services.

If you need to restart from the terminal, use the same sudo command as above, with start instead of stop.

---

<div class="post-metadata">

**Author:** ![barefoot](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/barefoot/32/2553_2.png) [@barefoot](https://the.fmsoup.org/u/barefoot)\
**Post date:** [April 12, 2024, 6:14pm UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090/3 "2024-04-12T18:14:20Z")

</div>

Great thanks! So all could be done via Terminal. Will see if I can figure out how to use a Terminal script to automize this or would that be not graceful for shutting down? I thought of a sequence closing all files then testing if all closed then proceeding with terminating all involved?

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [April 12, 2024, 7:48pm UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090/4 "2024-04-12T19:48:29Z")

</div>

if you find a reliable way of determining when FMS has completed shutdown, so that it can be issued the start command, I'd be interested. I've been failing to get a shell script to do this accurately for a long time. I've resorted to a long pause which gets the job done but it annoys me that I don't have a better way.

---

<div class="post-metadata">

**Author:** ![daleallyn](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/daleallyn/32/819_2.png) [@daleallyn](https://the.fmsoup.org/u/daleallyn)\
**Post date:** [April 17, 2024, 8:56am UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090/5 "2024-04-17T08:56:00Z")

</div>

In case it's of use to someone, here's a PDF file with the FMSAdmin Command Line commands. It can be gathered from within Terminal as well, of course (fmsadmin HELP [OPTIONS]), but I like having it as a document. This is from FMS v16, but it's basically the same.

[fms16\_cli\_help.pdf](https://the.fmsoup.org/uploads/short-url/vggbEWNJv3OhWcywTPfzRvzdfWR.pdf) (210.6 KB)

---

<div class="post-metadata">

**Author:** ![barefoot](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/barefoot/32/2553_2.png) [@barefoot](https://the.fmsoup.org/u/barefoot)\
**Post date:** [April 17, 2024, 11:18am UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090/6 "2024-04-17T11:18:09Z")

</div>

This is very helpful indeed @daleallyn. I wish the FileMaker documentation would be as it was years before. Now it misses out IMHO. THANK YOU!

---

<div class="post-metadata">

**Author:** ![csmu](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/csmu/32/295_2.png) [@csmu](https://the.fmsoup.org/u/csmu)\
**Post date:** [July 19, 2024, 5:14am UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090/7 "2024-07-19T05:14:07Z")

</div>

> [@Malcolm](#):
>
> reliable way of determining when FMS has completed shutdown

I normally just set a long time out - say four seconds before starting the service again.

We use web direct which is run under apache tomcat so the following works well.

`ps aux | grep apache`

and wait until there is no results.

The best way to do it would be to open the plist file as see what process it starts up - there might also be a default pid path - and then use `ps aux | grep {{processName}}

if nothing is returned then I start the process again.

I now however just use loop until the bash script can't find apache

```auto
#!/usr/bin/env bash

# Shutdown down FileMaker background services.
echo "/usr/bin/sudo /bin/launchctl unload /Library/LaunchDaemons/com.filemaker.fms.plist"
/usr/bin/sudo /bin/launchctl unload /Library/LaunchDaemons/com.filemaker.fms.plist

# Time to sleep between checks (in seconds)
SLEEP_DURATION=5

# We've noticed tomcat is running on our servers until 
# the FileMaker background services are shutdown.
# Loop to continuously check for the Apache process
while true; do
    # Check for the Apache process
    if ! ps aux | grep -v grep | grep apache > /dev/null; then
        echo "Apache process not found. Exiting."
        exit 0
    fi
    
    # Sleep for the specified duration
    sleep $SLEEP_DURATION
done

# Restart FileMaker background services.
echo "/usr/bin/sudo /bin/launchctl load -w /Library/LaunchDaemons/com.filemaker.fms.plist"
/usr/bin/sudo /bin/launchctl load -w /Library/LaunchDaemons/com.filemaker.fms.plist

```

The echo commands are there because I don't like `magic` scripts - I like to see what commands are actually being issued.

```auto

```

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [July 19, 2024, 8:00am UTC](https://the.fmsoup.org/t/how-can-i-gracefully-shut-down-filemaker-server-on-mac-mini-running-macos14/4090/8 "2024-07-19T08:00:40Z")

</div>

You've chosen Apache as the process to watch. I had been watching fms, perhaps that was my mistake.

I'm pleased to see that the current versions of FMS for Mac and Ubuntu, support Let's Encrypt and include shell scripts.

Malcolm
