Bug 1093460 - Fail to start systemd timer
Fail to start systemd timer
Status: RESOLVED INVALID
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kubic
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Kubic Bugs
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-16 07:22 UTC by Paul Gonin
Modified: 2018-05-16 09:02 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Gonin 2018-05-16 07:22:41 UTC
I created a systemd timer with the following file

/etc/systemd/system/hourly-timer.target
[Unit]
Description=Hourly Timer Target
StopWhenUnneeded=yes

systemd fails to start the timer:

# systemctl start /etc/systemd/system/hourly-timer.timer                                                                                                      
Failed to start etc-systemd-system-hourly\x2dtimer.timer.mount: Unit etc-systemd-system-hourly\x2dtimer.timer.mount not found.
Comment 1 Richard Brown 2018-05-16 09:02:29 UTC
(In reply to Paul Gonin from comment #0)
> I created a systemd timer with the following file
> 
> /etc/systemd/system/hourly-timer.target
> [Unit]
> Description=Hourly Timer Target
> StopWhenUnneeded=yes

This is not a valid timer. 

 - The filename does not end in .timer
 - The file does not contain a [Timer] nor an [Install] section

> systemd fails to start the timer:
> 
> # systemctl start /etc/systemd/system/hourly-timer.timer

This is not the valid syntax for enabling a timer

systemctl enable $foo.timer would be correct

By using the whole file path (and possibly an invalid one given this path ends in .timer where your above file does not) systemctl is going to think you are trying to reference a mount unit.
                    
> Failed to start etc-systemd-system-hourly\x2dtimer.timer.mount: Unit
> etc-systemd-system-hourly\x2dtimer.timer.mount not found.

This is expected when using invalid syntax - systemctrl thought the filepath was related to a mount point, so tried to find a systemd mount unit related to that mount point.