diff --git a/pypo/install/pypo-install.py b/pypo/install/pypo-install.py index 23eb8bf14..9c42ab011 100644 --- a/pypo/install/pypo-install.py +++ b/pypo/install/pypo-install.py @@ -36,14 +36,14 @@ def create_user(username): os.system("adduser --system --quiet --group --shell /bin/bash "+username) #set pypo password - p = os.popen('/usr/bin/passwd pypo 2>&1 1>/dev/null', 'w') + p = os.popen('/usr/bin/passwd pypo 1>/dev/null 2>&1', 'w') p.write('pypo\n') p.write('pypo\n') p.close() else: print "User already exists." #add pypo to audio group - os.system("adduser " + username + " audio 2>&1 1>/dev/null") + os.system("adduser " + username + " audio 1>/dev/null 2>&1") def copy_dir(src_dir, dest_dir): if (os.path.exists(dest_dir)) and (dest_dir != "/"): @@ -63,7 +63,7 @@ def get_current_script_dir(): try: current_script_dir = get_current_script_dir() print "Checking and removing any existing pypo processes" - os.system("python %s/pypo-uninstall.py 2>&1 1>/dev/null"% current_script_dir) + os.system("python %s/pypo-uninstall.py 1>/dev/null 2>&1"% current_script_dir) time.sleep(5) # Create users diff --git a/pypo/install/pypo-stop.py b/pypo/install/pypo-stop.py index bcfe47e3d..388c0bc4b 100644 --- a/pypo/install/pypo-stop.py +++ b/pypo/install/pypo-stop.py @@ -10,10 +10,15 @@ if os.geteuid() != 0: try: print "Stopping daemontool script pypo" - os.system("svc -dx /etc/service/pypo 2>/dev/null") + os.system("svc -dx /etc/service/pypo 1>/dev/null 2>&1") + + if os.path.exists("/etc/service/pypo-fetch"): + os.system("svc -dx /etc/service/pypo-fetch 1>/dev/null 2>&1") + if os.path.exists("/etc/service/pypo-push"): + os.system("svc -dx /etc/service/pypo-push 1>/dev/null 2>&1") print "Stopping daemontool script pypo-liquidsoap" - os.system("svc -dx /etc/service/pypo-liquidsoap 2>/dev/null") + os.system("svc -dx /etc/service/pypo-liquidsoap 1>/dev/null 2>&1") os.system("killall liquidsoap") except Exception, e: diff --git a/pypo/install/pypo-uninstall.py b/pypo/install/pypo-uninstall.py index 6388b0779..a9f339be0 100644 --- a/pypo/install/pypo-uninstall.py +++ b/pypo/install/pypo-uninstall.py @@ -15,13 +15,13 @@ def remove_path(path): os.system("rm -rf " + path) def remove_user(username): - os.system("killall -u %s 2>&1 1>/dev/null" % username) + os.system("killall -u %s 1>/dev/null 2>&1" % username) #allow all process to be completely closed before we attempt to delete user print "Waiting for processes to close..." time.sleep(5) - os.system("deluser --remove-home " + username + " 1>/dev/null") + os.system("deluser --remove-home " + username + " 1>/dev/null 2>&1") def get_current_script_dir(): current_script_dir = os.path.realpath(__file__) @@ -39,6 +39,12 @@ try: print "Removing daemontool script pypo" remove_path("rm -rf /etc/service/pypo") + + if os.path.exists("/etc/service/pypo-fetch"): + remove_path("rm -rf /etc/service/pypo-fetch") + + if os.path.exists("/etc/service/pypo-push"): + remove_path("rm -rf /etc/service/pypo-push") print "Removing daemontool script pypo-liquidsoap" remove_path("rm -rf /etc/service/pypo-liquidsoap")