Comment exécuter un service exactement toutes les secondes ? Chevauchement autorisé.
Voici mon unité de temporisation pour systemd :
[Unit]
Description=Send jobs every second
[Timer]
OnBootSec=1min
OnUnitActiveSec=1s
Unit=app.jobs-send.service
[Install]
WantedBy=multi-user.target
Mais app.jobs-send.service
Le service ne s'exécute pas chaque seconde :
May 07 17:57:38 app.deployer.org systemd[1]: Started Send jobs to queue.
May 07 17:57:48 app.deployer.org systemd[1]: Starting Send jobs to queue...
May 07 17:57:48 app.deployer.org systemd[1]: Started Send jobs to queue.
May 07 17:57:58 app.deployer.org systemd[1]: Starting Send jobs to queue...
May 07 17:57:58 app.deployer.org systemd[1]: Started Send jobs to queue.
May 07 17:58:08 app.deployer.org systemd[1]: Starting Send jobs to queue...
May 07 17:58:08 app.deployer.org systemd[1]: Started Send jobs to queue.
Il y a un écart d'environ 17:57:58 - 17:57:48 = 10 secondes.
Comment exécuter une tâche chaque seconde ?