From 447caea95b6c7519d3cb145f1a36a859d2bfd1c9 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 5 Dec 2019 20:54:00 +0000 Subject: [PATCH] so many errors, systemd still not working -- which uwsgi as root does --- roles/captiveportal/tasks/main.yml | 2 ++ roles/nginx/tasks/install.yml | 9 ++++++++- roles/nginx/templates/uwsgi.service | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/roles/captiveportal/tasks/main.yml b/roles/captiveportal/tasks/main.yml index 9978f3624..2321347b4 100644 --- a/roles/captiveportal/tasks/main.yml +++ b/roles/captiveportal/tasks/main.yml @@ -52,12 +52,14 @@ systemd: name: uwsgi-captiveportal.service state: restarted + enabled: True when: captiveportal_enabled | bool - name: Stop uWSGI server if captive portal has been disabled systemd: name: uwsgi-captiveportal.service state: stopped + enabled: False when: not captiveportal_enabled | bool - name: Run divert to generate diversion lists for nginx diff --git a/roles/nginx/tasks/install.yml b/roles/nginx/tasks/install.yml index 8053d961e..7271ed86e 100644 --- a/roles/nginx/tasks/install.yml +++ b/roles/nginx/tasks/install.yml @@ -25,4 +25,11 @@ - { src: "roles/nginx/templates/server.conf", dest: "/etc/nginx/" } - { src: "roles/nginx/templates/nginx.conf", dest: "/etc/nginx/" } - { src: 'roles/nginx/templates/ports.conf', dest: '/etc/{{ apache_service }}/' , mode: '0644' } - - { src: 'roles/nginx/templates/uwsgi.unit', dest: '/etc/systemd/system/' , mode: '0644' } + - { src: 'roles/nginx/templates/uwsgi.service', dest: '/etc/systemd/system/' , mode: '0644' } + +- name: Let uwsgi running as {{ apache_user }} write log files + file: + path: /var/log/uwsgi/app + state: directory + owner: "{{ apache_user }}" + diff --git a/roles/nginx/templates/uwsgi.service b/roles/nginx/templates/uwsgi.service index 49436f2c6..f23a5f178 100644 --- a/roles/nginx/templates/uwsgi.service +++ b/roles/nginx/templates/uwsgi.service @@ -2,7 +2,7 @@ Description=uWSGI Service [Service] -ExecStart=/usr/bin/uwsgi --ini /etc/uwsgi/apps-enabled/admin-console.ini +ExecStart=/usr/local/bin/uwsgi --ini /etc/uwsgi/apps-enabled/admin-console.ini Restart=always RestartSec=5 KillSignal=SIGQUIT