Skip to content

Commit

Permalink
Add systemd configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
roveil committed Mar 24, 2021
1 parent 7a15930 commit 94f6b9e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@
mode: 0640
notify:
- restart pganalyze-collector

- name: configure | create systemd config for service
template:
src: systemd/pganalyze-collector.service.j2
dest: /lib/systemd/system/pganalyze-collector.service
owner: "{{ pganalyze_user }}"
group: "{{ pganalyze_group }}"
mode: 0640
notify:
- restart pganalyze-collector
17 changes: 17 additions & 0 deletions templates/systemd/pganalyze-collector.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=Statistics collector for the pganalyze database monitoring service
After=network.target

[Service]
ExecStart=/usr/bin/pganalyze-collector --config=/etc/pganalyze-collector.conf --statefile=/var/lib/pganalyze-collector/state --no-log-timestamps
ExecReload=/bin/kill -HUP $MAINPID
User={{ pganalyze_user }}
ProtectSystem=full
ProtectHome=true
CapabilityBoundingSet=CAP_SYS_PTRACE CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE
MemoryMax=1024M
TasksMax=24
Restart=always

[Install]
WantedBy=multi-user.target

0 comments on commit 94f6b9e

Please sign in to comment.