Bug 1484317 - What difference rhel7.2 && rhel7.3 systemd timer ,and rhel7.2 elapsed state never active xxx.service ?
Summary: What difference rhel7.2 && rhel7.3 systemd timer ,and rhel7.2 elapsed state n...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-23 08:54 UTC by ahao.mah
Modified: 2017-08-28 06:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-28 06:53:51 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.