aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j24
-rw-r--r--ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j28
2 files changed, 5 insertions, 7 deletions
diff --git a/ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j2 b/ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j2
index 5122e84..b185bb2 100644
--- a/ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j2
+++ b/ansible/roles/rrdstats/templates/generate-rrdtool-stats.service.j2
@@ -7,7 +7,7 @@ Requires = postgresql.service
[Service]
ExecStart = {{ rrdstats_script_path }}
DynamicUser = true
-Statedirectory = rrdstats
+StateDirectory = pydis-rrdstats
User = pydis-rrdstats
EnvironmentFile = {{ rrdstats_env_path }}
@@ -18,8 +18,6 @@ NoNewPrivileges = true
# Most of the resource expenditure of this unit will be dished out in the psql connection.
# The rest here is just to ensure it doesn't impede the server's stability.
Nice = 10
-# Default of 6
-IOSchedulingClass = 5
CPUQuota = 10%
MemoryMax = 100M
TasksMax = 20
diff --git a/ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j2 b/ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j2
index d2b9b82..072f612 100644
--- a/ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j2
+++ b/ansible/roles/rrdstats/templates/generate-rrdtool-stats.sh.j2
@@ -113,11 +113,11 @@ psql --tuples-only --csv "$DB_DSN" -c "
# Threads
psql --tuples-only --csv "$DB_DSN" -c "
WITH threads_by_archived AS (
- SELECT CASE WHEN archived THEN 'archived'
- ELSE 'unarchived'
- END AS archived
+ SELECT CASE WHEN archived THEN 'archived'
+ ELSE 'unarchived'
+ END AS archived
FROM threads
- )
+ )
SELECT COUNT(*), archived FROM threads_by_archived GROUP BY archived
" | awk -F, '
BEGIN {