This commit is contained in:
j 2016-03-08 13:18:35 +05:30
parent 29204b6fb5
commit 4fd865efeb
2 changed files with 4 additions and 4 deletions

View file

@ -11,7 +11,7 @@ WorkingDirectory=/srv/pandora/pandora
StandardOutput=syslog StandardOutput=syslog
StandardError=syslog StandardError=syslog
ExecStartPre=/srv/pandora/pandora/manage.py compile_pyc -p /srv/pandora/pandora 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 ExecReload=/bin/kill -HUP $MAINPID
[Install] [Install]

View file

@ -71,7 +71,7 @@ def check_services(base):
p.wait() p.wait()
if p.returncode != 0: 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') and not os.path.exists('/bin/systemctl'):
print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)) print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service))
if os.path.exists('/lib/systemd/system'): if os.path.exists('/lib/systemd/system'):
print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service)) 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') run('./pandora/manage.py', 'migrate', '--fake-initial', '--noinput')
service = 'pandora' service = 'pandora'
print('Please install new init script for "%s" service:' % service) 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)) print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service))
if os.path.exists('/lib/systemd/system'): if os.path.exists('/lib/systemd/system'):
print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service)) print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service))
@ -209,7 +209,7 @@ if __name__ == "__main__":
if old > 5389: if old > 5389:
service = 'pandora' service = 'pandora'
print('Please install new init script for "%s" service:' % service) 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)) print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service))
if os.path.exists('/lib/systemd/system'): if os.path.exists('/lib/systemd/system'):
print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service)) print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service))