I'm writing a service with a timer and got wrong WorkingDirectory in the .service file. Timer runs as expected. How I can force run for the service's timer now that I've revisited the .service file?

I've tried:

$ systemctl --user enable $(pwd)/mycollector.service
$ systemctl --user start mycollector.timer
$ systemctl --user reload mycollector.timer


$ systemd-run --user mycollector.timer

But it's still waiting:

$ systemctl --user list-timers
NEXT                         LEFT       LAST PASSED UNIT              ACTIVATES
Thu 2019-06-20 23:53:28 UTC  43min left n/a  n/a    mycollector.timer mycollector.service

I don’t think you can force the timer to stop waiting and fire immediately, short of changing its calendar definition; but you can force the corresponding service to run:

systemctl --user start mycollector.service

The timer will fire as scheduled, later on.

  • Not working here: Failed to restart {foo}.service: Operation refused, unit {foo}.service may be requested by dependency only. – eMPee584 Jul 9 at 18:22
  • @eMPee584 that’s presumably because your service is configured to refuse manual stops/starts (RefuseManualStart). Please ask a new question is you want more help. – Stephen Kitt Jul 10 at 11:31
  • thanks for the hint; actually it's RefuseManualStart=no RefuseManualStop=yes.. and for whatever reason, manual invocation is working now.. ah well : ) – eMPee584 Jul 18 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.