github.com/swiftstack/ProxyFS@v0.0.0-20210203235616-4017c267d62f/sait/bin/unmount_and_stop_pfs (about) 1 #!/bin/bash 2 3 # Copyright (c) 2015-2021, NVIDIA CORPORATION. 4 # SPDX-License-Identifier: Apache-2.0 5 6 function await_proxyfsd_shutdown { 7 while true 8 do 9 pidof proxyfsd > /dev/null 10 if [ $? -ne 0 ] 11 then 12 break 13 fi 14 echo "Waiting for ProxyFS to be stopped..." 15 sleep 1 16 done 17 } 18 19 if [ -f /usr/bin/systemctl ]; then 20 # Centos 21 sudo /usr/bin/systemctl stop proxyfsd 22 await_proxyfsd_shutdown 23 sudo /usr/bin/swift-init main stop 24 sudo /usr/bin/systemctl stop memcached 25 else 26 # Ubuntu (not tested!) 27 # Here we should stop pfsagentd, but we don't support Ubuntu 28 sudo /usr/sbin/service proxyfsd stop 29 await_proxyfsd_shutdown 30 sudo /usr/bin/swift-init main stop 31 sudo /usr/sbin/service memcached stop 32 fi