diff --git a/5.MediaServer/2.Startup_check_script_for_NFS/check_services.py b/5.MediaServer/2.Startup_check_script_for_NFS/check_services.py index 7c888874298b1e33afc917fef7a4e0c824a76d92..5a4596f5923c2aa5c1d494adaef642b70010a46a 100755 --- a/5.MediaServer/2.Startup_check_script_for_NFS/check_services.py +++ b/5.MediaServer/2.Startup_check_script_for_NFS/check_services.py @@ -10,6 +10,7 @@ import imp import os import socket import sys +import time if __name__ == '__main__': @@ -19,9 +20,16 @@ if __name__ == '__main__': print('/home is not a mount point.') sys.exit(0) ec = os.system('mount | grep /home') + if ec == 0: + # /home is correctly mounted + sys.exit(0) + time.sleep(10) + os.system('mount -a') + ec = os.system('mount | grep /home') if ec != 0: + time.sleep(60) os.system('mount -a') - ec = os.system('mount | grep /home') + ec = os.system('mount | grep /home') if ec != 0: # Mounting has failed, send a email to warn admins if os.path.exists('/etc/mediaserver/msconf.py'): @@ -37,6 +45,6 @@ if __name__ == '__main__': fail_silently=True ) else: - os.system('mscontroller.py start') - os.system('msmonitor-website.sh start') - os.system('/etc/init.d/campus-manager start') + os.system('service mediaserver restart') + os.system('service msmonitor restart') + os.system('service campus-manager restart')