1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

split the pid files2

This commit is contained in:
Jerry Vonau 2021-12-10 19:14:26 -06:00
parent 46861cbfec
commit 0bfab81d35

View file

@ -80,7 +80,7 @@
dest: /etc/systemd/system/{{ systemd_unit_name }}.service
- name: shove {{ nginx_dir }}/nginx.conf into unit file
command: sed -i 's|/usr/sbin/nginx|/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf|' /etc/systemd/system/{{ systemd_unit_name }}.service
command: sed -i 's|/usr/sbin/nginx|/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf|g' /etc/systemd/system/{{ systemd_unit_name }}.service
# lineinfile:
# path: /etc/systemd/system/nginx.service
# state: present
@ -91,8 +91,8 @@
# - { regexp: '^ExecStart=/usr/sbin/nginx', line: 'ExecStart=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' }
# - { regexp: '^ExecReload=/usr/sbin/nginx', line: 'ExecReload=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' }
- name: Alter PIDFile= to match {{ systemd_unit_name }} in unit file.
command: sed -i 's|PIDFile=/run/nginx.pid|PIDFile=/run/{{ systemd_unit_name }}.pid|' /etc/systemd/system/{{ systemd_unit_name }}.service
- name: Alter /run/nginx.pid to be /run/{{ systemd_unit_name }}.pid in unit file.
command: sed -i 's|/run/nginx.pid|/run/{{ systemd_unit_name }}.pid|g' /etc/systemd/system/{{ systemd_unit_name }}.service
# end block
when: systemd_unit_name != "nginx" or nginx_dir != "/etc/nginx"