fix check_services

This commit is contained in:
j 2015-11-16 14:21:43 +01:00
commit 8c48f652ea
2 changed files with 3 additions and 24 deletions

View file

@ -66,7 +66,9 @@ def check_services(base):
services = "pandora pandora-tasks pandora-encoding pandora-cron pandora-websocketd".split()
for service in services:
cmd = ['service', service, 'status']
if subprocess.check_call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) != 0:
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait()
if p.returncode != 0:
print 'Please install init script for "%s" service:' % service
if os.path.exists('/etc/init'):
print '\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)