Bug 1093460

Summary: Fail to start systemd timer
Product: [openSUSE] openSUSE Tumbleweed Reporter: Paul Gonin <paul.gonin>
Component: KubicAssignee: Kubic Bugs <kubic-bugs>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: rbrown
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

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.