mirror of
https://github.com/chatmail/relay.git
synced 2026-05-13 09:24:43 +00:00
WIP systemd-metrics
This commit is contained in:
@@ -97,6 +97,20 @@ def _install_remote_venv_with_chatmaild(config) -> None:
|
||||
},
|
||||
)
|
||||
|
||||
# create metrics every 5 minutes via systemd
|
||||
|
||||
systemd.service(
|
||||
name=f"Setup metrics service",
|
||||
service="metrics.service",
|
||||
running=True,
|
||||
enabled=True,
|
||||
restarted=True,
|
||||
daemon_reload=True,
|
||||
)
|
||||
|
||||
# TODO Put a systemd service at the right place
|
||||
# TODO Put a systemd timer at the right place
|
||||
|
||||
# install systemd units
|
||||
for fn in (
|
||||
"doveauth",
|
||||
|
||||
6
cmdeploy/src/cmdeploy/service/metrics.service.j2
Normal file
6
cmdeploy/src/cmdeploy/service/metrics.service.j2
Normal file
@@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=Generate metrics in /var/www/html/metrics every 5 minutes
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/var/www/magento-website/current
|
||||
ExecStart=/usr/bin/php bin/magento indexer:reindex
|
||||
9
cmdeploy/src/cmdeploy/service/metrics.timer
Normal file
9
cmdeploy/src/cmdeploy/service/metrics.timer
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Generate metrics in /var/www/html/metrics every 5 minutes
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=5min
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user