Skip to content
Snippets Groups Projects
Commit 34a231ce authored by Jörg Sachse's avatar Jörg Sachse
Browse files

fix: move_logs functionality (write permissions, service/timer names

parent 91dfec12
No related branches found
No related tags found
No related merge requests found
Pipeline #9639 passed
...@@ -4,7 +4,7 @@ Description=timer for move_old_logs_@.service ...@@ -4,7 +4,7 @@ Description=timer for move_old_logs_@.service
[Timer] [Timer]
# run once a year, on the 1st of January at 05:00:00am. # run once a year, on the 1st of January at 05:00:00am.
OnCalendar=*-1-1 05:00:00 OnCalendar=*-1-1 05:00:00
Unit=move_old_logs_@.service Unit=move_old_logs_@%i.service
[Install] [Install]
WantedBy=default.target WantedBy=default.target
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
owner: "{{ item.owner | default('root') }}" owner: "{{ item.owner | default('root') }}"
group: "{{ item.group | default('root') }}" group: "{{ item.group | default('root') }}"
loop: loop:
- path: "usr/local/lib/systemd/system/move_old_logs.timer" - path: "usr/local/lib/systemd/system/move_old_logs_@.timer"
mode: "0644" mode: "0644"
- path: "usr/local/bin/move_old_logs.sh" - path: "usr/local/bin/move_old_logs.sh"
mode: "0755" mode: "0755"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
notify: daemon-reload notify: daemon-reload
- name: enable move_old_logs services - name: enable move_old_logs services
ansible.builtin.systemd: ansible.builtin.systemd_service:
name: "move_old_logs_@{{ item }}.service" name: "move_old_logs_@{{ item }}.service"
daemon_reload: true daemon_reload: true
enabled: true enabled: true
...@@ -39,7 +39,11 @@ ...@@ -39,7 +39,11 @@
- "subapp_webservice" - "subapp_webservice"
- name: start timer for moving old logs to archive (the service is triggered by the timer and doesn't need to be started separately) - name: start timer for moving old logs to archive (the service is triggered by the timer and doesn't need to be started separately)
ansible.builtin.systemd: ansible.builtin.systemd_service:
name: "move_old_logs.timer" name: "move_old_logs_@{{ item }}.timer"
enabled: true enabled: true
state: started state: started
loop:
- "disapp"
- "subapp"
- "subapp_webservice"
...@@ -10,7 +10,8 @@ Group=root ...@@ -10,7 +10,8 @@ Group=root
### Security features ### Security features
# documented at https://www.freedesktop.org/software/systemd/man/systemd.exec.html # documented at https://www.freedesktop.org/software/systemd/man/systemd.exec.html
ProtectSystem=strict # Do NOT set "ProtectSystem=strict", or you won't be able to move logs, as the entire file system hierarchy will be mounted RO.
ProtectSystem=true
ProtectHome=read-only ProtectHome=read-only
ProtectHostname=true ProtectHostname=true
ProtectClock=true ProtectClock=true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment