Bug 1266824

Summary: ntpd service does not start automatically on RHEL7
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Neha <nerawat>
Component: redhat-storage-serverAssignee: Milind Changire <mchangir>
Status: CLOSED NOTABUG QA Contact: Neha <nerawat>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: annair, asriram, byarlaga, dpati, nlevinki, pprakash, rcyriac, rhs-bugs, sashinde, sasundar, vagarwal
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
With this fix, the ntpd sevice will get started automatically with RHEL7 istallation.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-28 06:46:24 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:
Bug Depends On:    
Bug Blocks: 1255689    

Description Neha 2015-09-28 06:26:38 UTC
Description of problem:

ISO installation- ntpd service doesn't start automatically on RHEL7. 

Have to start it manually after installation.

Version-Release number of selected component (if applicable):
RHGSS-3.1.1-RHEL-7-20150921.0-RHGSS-x86_64-dvd1.iso

How reproducible:
Always

Steps to Reproduce:
Install RHS using iso 

Actual results:
ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
   Active: inactive (dead)

ntp-4.2.6p5-19.el7_1.1.x86_64
ntpdate-4.2.6p5-19.el7_1.1.x86_64

ntpd.service                                  enabled 


Expected results:
should start ntpd automatically


Additional info:

Comment 2 Rejy M Cyriac 2015-09-30 05:00:17 UTC
The settings to have the ntpd service started by default on boot is done through the redhat-storage-server package. So changing the component of this bug appropriately

Comment 3 Anjana Suparna Sriram 2015-09-30 07:06:51 UTC
Bala,

I have added the doc text for this bug. Please review and sign off so that this can be added to Known Issues chapter.

Regards,
Anjana

Comment 5 Bala.FA 2015-09-30 07:25:41 UTC
Looks good to me

Comment 7 Anand Nekkunti 2015-10-16 06:36:19 UTC
This bug is not related to glusterd , so removing ateam from devel board and my name from assignee

Comment 9 Neha 2015-12-16 05:12:34 UTC
Depends on ISO BZ https://bugzilla.redhat.com/show_bug.cgi?id=1285678. 

Will update after above fix.

Comment 10 Neha 2015-12-24 16:29:16 UTC
ntpd service is enabled on boot but still doesn't start by default.

In RHEL 6 its default: https://bugzilla.redhat.com/show_bug.cgi?id=920450

Comment 11 Milind Changire 2016-01-04 07:41:01 UTC
(In reply to Neha from comment #10)
> ntpd service is enabled on boot but still doesn't start by default.
> 
> In RHEL 6 its default: https://bugzilla.redhat.com/show_bug.cgi?id=920450

Has the system been rebooted after the ISO installation?

Comment 12 Neha 2016-01-04 10:50:48 UTC
# systemctl status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: inactive (dead)

systemctl list-unit-files | grep ntpd
ntpd.service                                  enabled 

After reboot:

# systemctl status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: inactive (dead)


redhat-storage-server-3.1.2.0-1.el7rhgs.noarch

There is no issue in manual start.

Comment 13 Milind Changire 2016-01-05 06:09:45 UTC
I could see the following on dhcp42-115.lab.eng.blr.redhat.com:

[root@dhcp42-115 ~]# systemctl status chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2016-01-04 21:47:24 IST; 19h ago
  Process: 708 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
  Process: 684 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 694 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─694 /usr/sbin/chronyd

Since chronyd is another daemon which provides NTP services, ntpd wasn't being started which probably requires the same network port to bind to.

I'll need to update redhat-storage-server RPM for rhel-7 to use the command:
timedatectl set-ntp yes

which causes either of chronyd.service or ntpd.service to be enabled and started, whichever is installed on the system.

This should resolve the issue.

References:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/chap-Configuring_the_Date_and_Time.html#sect-Configuring_the_Date_and_Time-timedatectl-NTP

Read section 2.1.5. Synchronizing the System Clock with a Remote Server

Comment 17 Milind Changire 2016-01-05 10:31:08 UTC
To add to my earlier comments:

In essence, since chronyd.service was already up and running providing NTP services, the system already was running with the prerequisite services.

To specifically verify if ntpd.service runs after reboot, you can disable chronyd.service and reinstall redhat-storage-server RPM and reboot system to verify that ntpd.service indeed goes to active running state.

Since chronyd.service and ntpd.service both provide the Network Time Protocol services, having either of the services in active running state is good enough for Red Hat Gluster Storage nodes to be time synchronized.

Also note that by default chronyd.service is enabled after RPM install and ntpd.service is disabled after RPM install. This means that if chronyd.service is installed then it will automatically start up after system reboot. If ntpd.service is installed, then redhat-storage-server RPM install will enable it and ntpd.service will start up after reboot, provided chronyd.service is not enabled.

In such a case there need not be any changes made to redhat-storage-server RPM.

We probably need to change the release notes to make either chronyd.service or ntpd.service installation as a prerequisite to redhat-storage-server RPM installation.

Comment 19 Milind Changire 2016-01-28 06:46:24 UTC
See comment #17