fix check_services

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

View file

@ -1,23 +0,0 @@
secret.txt
local_settings.py
./lib
./include
./src
./bin
./static/json/pandora.json
./static/js/pandora.min.js
config.jsonc
./local
./static/js/pandora.min.js.gz
./static/json/*.json.gz
./static/json/locale.??.json
./static/oxjs
./static/admin
./data
./scripts/poster.py
./scripts/list_icon.py
./scripts/item_icon.py
./static/png/icon.png
./static/png/logo.png
._*
static/django_extensions

View file

@ -66,7 +66,9 @@ def check_services(base):
services = "pandora pandora-tasks pandora-encoding pandora-cron pandora-websocketd".split() services = "pandora pandora-tasks pandora-encoding pandora-cron pandora-websocketd".split()
for service in services: for service in services:
cmd = ['service', service, 'status'] 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 print 'Please install init script for "%s" service:' % service
if os.path.exists('/etc/init'): if os.path.exists('/etc/init'):
print '\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service) print '\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)