Bug 1484317

Summary: What difference rhel7.2 && rhel7.3 systemd timer ,and rhel7.2 elapsed state never active xxx.service ?
Product: Red Hat Enterprise Linux 7 Reporter: ahao.mah <ahao.mah>
Component: systemdAssignee: systemd-maint
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: jsynacek, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-28 06:53:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ahao.mah 2017-08-23 08:54:00 UTC
Description of problem:

Hello, I am confused about rhel7.2 systemd timer. When I create a bar.timer if I do not use OnBootSec=15min , xxx.timer will goto elapsed state and never schedule xxx.service , But at rhel7.3 this problem dispear, What change and modify in rhe7.3 relate to this logical source code ?



Steps to Reproduce:


## rhel7.2
```
[root@izrj9bz2wge6lw6jeldnovz ~]# rpm -q systemd
systemd-219-30.el7_3.6.x86_64
```
Use OnBootSec=15min

```
[root@izrj9bz2wge6lw6jeldnovz ~]# systemctl cat  foo.timer
# /etc/systemd/system/foo.timer
[Unit]
Description=Run foo weekly and on boot

[Timer]
OnBootSec=15min
Unit=foo.service
OnUnitActiveSec=1min

[Install]
WantedBy=timers.target
```

Do not use OnBootSec=15min

```
[root@izrj9bz2wge6lw6jeldnovz ~]# systemctl cat  bar.timer
# /etc/systemd/system/bar.timer
[Unit]
Description=Run foo weekly and on boot

[Timer]
Unit=bar.service
OnUnitActiveSec=1min

[Install]
WantedBy=timers.target
```

systemctl reboot 


Check foo.timer

foo.service is normally scheduled

```
[root@izrj9bz2wge6lw6jeldnovz ~]# systemctl status  foo.timer
● foo.timer - Run foo weekly and on boot
   Loaded: loaded (/etc/systemd/system/foo.timer; enabled; vendor preset: disabled)
   Active: active (waiting) since 一 2017-08-21 15:01:03 CST; 6min ago

8月 21 15:01:03 izrj9bz2wge6lw6jeldnovz systemd[1]: Started Run foo weekly and on boot.
8月 21 15:01:03 izrj9bz2wge6lw6jeldnovz systemd[1]: Starting Run foo weekly and on boot.
```

Check bar.timer 

1. bar.service was not and never will be scheduled 
2. bar.timer goto elapsed status

```
[root@izrj9bz2wge6lw6jeldnovz ~]# systemctl status bar.timer
● bar.timer - Run foo weekly and on boot
   Loaded: loaded (/etc/systemd/system/bar.timer; enabled; vendor preset: disabled)
   Active: active (elapsed) since 一 2017-08-21 15:01:03 CST; 40s ago

8月 21 15:01:03 izrj9bz2wge6lw6jeldnovz systemd[1]: Started Run foo weekly and on boot.
8月 21 15:01:03 izrj9bz2wge6lw6jeldnovz systemd[1]: Starting Run foo weekly and on boot.
```

## rhel7.3 

```
[root@izrj9bz2wge6lw6dhi1hqqz ~]# rpm -q systemd
systemd-219-30.el7_3.9.x86_64
```

Do not use  OnBootSec=15min

```
[root@izrj9bz2wge6lw6dhi1hqqz ~]# systemctl cat  bar.timer
# /etc/systemd/system/bar.timer
[Unit]
Description=Run foo weekly and on boot

[Timer]
Unit=bar.service
OnUnitActiveSec=1min

[Install]
WantedBy=timers.target
```

The elapsed state is gone 

```
[root@izrj9bz2wge6lw6dhi1hqqz ~]# systemctl status bar.timer
● bar.timer - Run foo weekly and on boot
   Loaded: loaded (/etc/systemd/system/bar.timer; enabled; vendor preset: disabled)
   Active: active (waiting) since 一 2017-08-21 14:52:20 CST; 23s ago

8月 21 14:52:20 izrj9bz2wge6lw6dhi1hqqz systemd[1]: Started Run foo weekly and on boot.
8月 21 14:52:20 izrj9bz2wge6lw6dhi1hqqz systemd[1]: Starting Run foo weekly and on boot.
[root@izrj9bz2wge6lw6dhi1hqqz ~]# systemctl cat  bar.timer
```


Actual results:


Expected results:


Additional info:

Comment 2 Jan Synacek 2017-08-28 06:53:51 UTC
Hi, bugzilla is not a support tool. Please, contact Red Hat Support.