19

I have a timer/service unit-set that should run once a day under --user conditions. It shows up with systemctl --user status and gets logged in journal but there is a part of the command that fails.

It seems that something in the command is not being interpreted correctly. I want to futz with the unit file and run the service, examine the log, etc to debug the issue; however editing the timer to trigger a minute in the future, waiting, and checking the log is... tedious.

Can do something like systemctl --user execute xxxxxx.service to just run the dang thing as if the timer triggered?

13

You can activate any unit manually, unless it contains a RefuseManualStart=yes and/or RefuseManualStop=yes directive (which do exactly what they say). Just issue systemctl --user start <whatever> (and systemctl --user stop <whatever> to do the opposite).

To quote systemctl(1):

start PATTERN...

Start (activate) one or more units specified on the command line.

<...>

stop PATTERN...

Stop (deactivate) one or more units specified on the command line.

  • Not working here: Failed to restart {foo}.service: Operation refused, unit {foo}.service may be requested by dependency only. – eMPee584 Jul 9 at 18:01
  • 1
    @eMPee584 Since this answer was written, systemd gained new directives RefuseManualStart= and RefuseManualStop= (which do exactly what they say). I've updated my answer to mention that. – intelfx Jul 29 at 3:13

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.