Created
March 14, 2017 16:33
-
-
Save ktechmidas/a71142affb96c3a0a113078499fc55f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
def is_process_running(process_id): | |
try: | |
os.kill(5475, 0) | |
return True | |
except OSError: | |
return False | |
while is_process_running(5475): | |
print "still running" | |
time.sleep(10) | |
else: | |
ps = subprocess.Popen("/home/seafile/seafile-server-latest/seafile.sh start && /home/seafile/seafile-server-latest/seahub.sh start-fastcgi", shell=True, stdout=subprocess.PIPE) | |
output = ps.stdout.read() | |
ps.stdout.close() | |
ps.wait() | |
print "Stopped" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment