-refactored pypo install and uninstall scripts into start/stop/install/uninstall scripts
This commit is contained in:
parent
f37d977356
commit
1c16f6f9e7
4 changed files with 54 additions and 12 deletions
|
@ -43,7 +43,7 @@ def copy_dir(src_dir, dest_dir):
|
|||
if not (os.path.exists(dest_dir)):
|
||||
print "Copying directory "+src_dir+" to "+dest_dir
|
||||
shutil.copytree(src_dir, dest_dir)
|
||||
|
||||
|
||||
try:
|
||||
# Create users
|
||||
create_user("pypo")
|
||||
|
@ -91,9 +91,7 @@ try:
|
|||
shutil.copy("pypo-daemontools-logger.sh", "/etc/service/pypo-fetch/log/run")
|
||||
os.system("chmod -R 755 /etc/service/pypo-fetch")
|
||||
os.system("chown -R pypo:pypo /etc/service/pypo-fetch")
|
||||
time.sleep(1)
|
||||
os.system("svc -t /etc/service/pypo-fetch")
|
||||
|
||||
|
||||
print "Installing daemontool script pypo-push"
|
||||
create_path("/etc/service/pypo-push")
|
||||
create_path("/etc/service/pypo-push/log")
|
||||
|
@ -101,8 +99,6 @@ try:
|
|||
shutil.copy("pypo-daemontools-logger.sh", "/etc/service/pypo-push/log/run")
|
||||
os.system("chmod -R 755 /etc/service/pypo-push")
|
||||
os.system("chown -R pypo:pypo /etc/service/pypo-push")
|
||||
time.sleep(1)
|
||||
os.system("svc -t /etc/service/pypo-push")
|
||||
|
||||
print "Installing daemontool script pypo-liquidsoap"
|
||||
os.system("svc -dk /etc/service/pypo-liquidsoap")
|
||||
|
@ -113,10 +109,10 @@ try:
|
|||
shutil.copy("pypo-daemontools-logger.sh", "/etc/service/pypo-liquidsoap/log/run")
|
||||
os.system("chmod -R 755 /etc/service/pypo-liquidsoap")
|
||||
os.system("chown -R pypo:pypo /etc/service/pypo-liquidsoap")
|
||||
time.sleep(1)
|
||||
os.system("svc -u /etc/service/pypo-liquidsoap")
|
||||
|
||||
print "Waiting for processes to start..."
|
||||
time.sleep(5)
|
||||
os.system("python ./pypo-start.py")
|
||||
time.sleep(2)
|
||||
|
||||
p = Popen('svstat /etc/service/pypo-fetch', shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue