Skip to main content

All Questions

Tagged with
0 votes
3 answers
160 views

Is it possible to start a systemd service a fixed time after 'start' is requested?

Bit of a funny question: I have a systemd service where it is important that it actually executes (or fails) a fixed time after it is started. My understanding is that once Linux calls start on the ...
user12066's user avatar
  • 101
2 votes
1 answer
58 views

Systemd timer with OnStartupSec and OnUnitActiveSec runs immediately at boot

I have this timer: $ systemctl cat ansible-pull.timer # /etc/systemd/system/ansible-pull.timer [Unit] Description=Starts ansible-pull Requires=ansible-pull.service [Timer] OnStartupSec=10min ...
al.'s user avatar
  • 331
0 votes
1 answer
48 views

Systemd timer only starts when service is stopped

I have a service that runs a python script: [Unit] Description="Daily python service" [Service] WorkingDirectory=/home/ubuntu/python_project/ ExecStartPre=/bin/bash -c 'truncate -s 0 /var/...
RudyGoburt's user avatar
0 votes
1 answer
82 views

Is there a way to schedule a lazy timer relative to another timer?

(x-mas.service) [Unit] Description=Celebrate X-Mas [Service] Type=simple ExecStart=/usr/sbin/x-mas-day [Install] WantedBy=multi-user.target (x-mas.timer) [Unit] Description=Add "X-Mas" to ...
Noob Saibot's user avatar
3 votes
1 answer
204 views

Managing ordering dependencies between systemd template instances

Abstracted example: I have two recurring tasks A and B that I want to setup as systemd services. As the tasks are quite similar to each other, I am using a template [email protected]; A and B will be ...
bluesheep's user avatar
2 votes
0 answers
120 views

Systemd - run bash script after user login on specific days

I use the i3 window manager and every day of remote work I would like to run a script that is responsible for setting up my monitors. On Tuesdays, I work onsite, then I'll want to run another script. ...
A.J.'s user avatar
  • 21
1 vote
1 answer
150 views

Ubuntu systemd service with timer is slow

I've set up a systemd timer to trigger a service every minute on Ubuntu 22.04, but I'm encountering an issue where the execution time of the service significantly increases after the first run. The ...
Tihomir Dimov's user avatar
0 votes
1 answer
189 views

Systemd executable failed to read file from CacheDirectory with Permission Denied

I have a Golang binary that runs every 5 mins. It is supposed to create & update a text file which needs to be write restricted. To run this binary I created a systemd service and a systemd timer ...
Korba's user avatar
  • 103
1 vote
1 answer
169 views

How to indicate hour range in Timer using OnCalendar?

systemd 219 version Ubuntu 22.04.2 LTS [Unit] Description=Run myscript.service every 5 minutes [Timer] OnCalendar= *-*-* 10-23:10/5:00 Persistent=true [Install] WantedBy=timers.target I need to run ...
Aigerim's user avatar
  • 11
3 votes
1 answer
673 views

Why systemctl status shows a time in the future and the amount of time left?

When we issue "systemctl status", we usually get in the output, a line showing the status and for how long it has been in that status. Like: (I issued that few minutes ago) Active: active (...
Travelling_Bird's user avatar
2 votes
2 answers
407 views

How to avoid systemd periodic realtime timer running at boot

I have a realtime timer with Persistent=false running immediately after boot although my objective is to run it periodically! I saw it is a rather common question but none of the answers I found in ...
Pa Dalton's user avatar
0 votes
2 answers
3k views

Unit templates and non-template destination units

I like to keep my custom unit files in their own directory away from /etc. In 247 this worked well, using something like the following: systemctl enable /path/to/unit.service This also worked with ...
Spammy's user avatar
  • 31
2 votes
2 answers
4k views

How can I specify a maximum service duration in systemd service?

I have a problem where on rare occasions my Type=simple systemd service hangs or gets caught in a loop. This causes its timer to stop scheduling the service because, as confirmed with sudo systemctl ...
user avatar
0 votes
1 answer
1k views

Run systemd timer even if process is still running

It has been confirmed that systemd timers won't start the .service if previous run hasn't finished. However, for unknown reason this blocks some Type=oneshot backup processes on my machine (they seem ...
Daniel Krajnik's user avatar
2 votes
1 answer
261 views

Ensure that systemd timer instances of same template are not running in parallel

I have a systemd timer template [email protected] and a corresponding service [email protected]. The job runs daily and has a generous RandomizedDelaySec of 2 hours. The job has many instances. Can I tell systemd ...
sedrubal's user avatar
  • 326

15 30 50 per page
1
2 3 4 5
9