github.com/rohankumardubey/proxyfs@v0.0.0-20210108201508-653efa9ab00e/sait/bin/unmount_and_stop_pfs (about)

     1  #!/bin/bash
     2  
     3  function await_proxyfsd_shutdown {
     4      while true
     5      do
     6          pidof proxyfsd > /dev/null
     7          if [ $? -ne 0 ]
     8          then
     9              break
    10          fi
    11          echo "Waiting for ProxyFS to be stopped..."
    12          sleep 1
    13      done
    14  }
    15  
    16  if [ -f /usr/bin/systemctl ]; then
    17      # Centos
    18      sudo /usr/bin/systemctl stop proxyfsd
    19      await_proxyfsd_shutdown
    20      sudo /usr/bin/swift-init main stop
    21      sudo /usr/bin/systemctl stop memcached
    22  else
    23      # Ubuntu (not tested!)
    24      # Here we should stop pfsagentd, but we don't support Ubuntu
    25      sudo /usr/sbin/service proxyfsd stop
    26      await_proxyfsd_shutdown
    27      sudo /usr/bin/swift-init main stop
    28      sudo /usr/sbin/service memcached stop
    29  fi