From 4fd865efeb159b6f2468a236d53d55b9509393eb Mon Sep 17 00:00:00 2001 From: j Date: Tue, 8 Mar 2016 13:18:35 +0530 Subject: [PATCH] fix pid --- etc/systemd/pandora.service | 2 +- update.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/systemd/pandora.service b/etc/systemd/pandora.service index 6b7f77e0..ff671493 100644 --- a/etc/systemd/pandora.service +++ b/etc/systemd/pandora.service @@ -11,7 +11,7 @@ WorkingDirectory=/srv/pandora/pandora StandardOutput=syslog StandardError=syslog ExecStartPre=/srv/pandora/pandora/manage.py compile_pyc -p /srv/pandora/pandora -ExecStart=/srv/pandora/bin/gunicorn wsgi:application -c gunicorn_config.py -p $MAINPID +ExecStart=/srv/pandora/bin/gunicorn wsgi:application -c gunicorn_config.py -p /run/pandora/pandora.pid ExecReload=/bin/kill -HUP $MAINPID [Install] diff --git a/update.py b/update.py index f5b17b5d..0cbe3e1a 100755 --- a/update.py +++ b/update.py @@ -71,7 +71,7 @@ def check_services(base): p.wait() if p.returncode != 0: print('Please install init script for "%s" service:' % service) - if os.path.exists('/etc/init'): + if os.path.exists('/etc/init') and not os.path.exists('/bin/systemctl'): print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)) if os.path.exists('/lib/systemd/system'): print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service)) @@ -186,7 +186,7 @@ if __name__ == "__main__": run('./pandora/manage.py', 'migrate', '--fake-initial', '--noinput') service = 'pandora' print('Please install new init script for "%s" service:' % service) - if os.path.exists('/etc/init'): + if os.path.exists('/etc/init/%s.conf'%service): print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)) if os.path.exists('/lib/systemd/system'): print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service)) @@ -209,7 +209,7 @@ if __name__ == "__main__": if old > 5389: service = 'pandora' print('Please install new init script for "%s" service:' % service) - if os.path.exists('/etc/init'): + if os.path.exists('/etc/init/%s.conf'%service): print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)) if os.path.exists('/lib/systemd/system'): print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service))