| Summary: | ntpdate systemd service scripts just calls the old sysv initscript | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Jóhann B. Guðmundsson <johannbg> |
| Component: | ntp | Assignee: | Miroslav Lichvar <mlichvar> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | mlichvar, pertusus |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-07-20 11:57:13 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Jóhann B. Guðmundsson
2011-04-18 14:24:31 UTC
There is a purpose, the systemd service does more than the init script, it specifies Type=oneshot, etc. Is it possible to include a shell script in the service file or is a wrapping needed? something like this.. [Unit] Description=Set time via NTP After=syslog.target network.target Before=time-sync.target Wants=time-sync.target [Service] Type=oneshot EnvironmentFile=/etc/sysconfig/ntpdate ExecStartPre=/path/to/scripts/that/sets/tickers-variable ExecStart=/usr/sbin/ntpdate -U ntp -s -b $OPTIONS $tickers ExecStartPost=/sbin/hwclock "$SYNC_HWCLOCK" ( set variable to "-w" or "" not yes ) RemainAfterExit=yes [Install] WantedBy=multi-user.target This omits the loop around ntpdate which is needed to wait for network connection. If After=network.target is not sufficiant try Requires= as in .. ( see man systemd.unit ) [Unit] Description=Set time via NTP Requires=network.target After=syslog.target network.target Before=time-sync.target Wants=time-sync.target [Service] Type=oneshot EnvironmentFile=/etc/sysconfig/ntpdate ExecStartPre=/path/to/scripts/that/sets/tickers-variable ExecStart=/usr/sbin/ntpdate -U ntp -s -b $OPTIONS $tickers ExecStartPost=/sbin/hwclock "$SYNC_HWCLOCK" ( set variable to "-w" or "" not yes ) RemainAfterExit=yes [Install] WantedBy=multi-user.target btw ntp(date) causes delay at startup and should only be enabled via anaconda/firstboot/*de-app or end user via cmd not by default IIRC network.target is only that NetworkManager is running, not that a network is available. It would be really nice if a network-online existed. ntpdate is disabled by default. Even if it is enabled it shouldn't block delay, but apparently does, see bug #679537. Fixed in ntp-4.2.6p3-5.fc16. The SysV init script code has been moved to /usr/libexec/ntpdate-wrapper. |