The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Server time problem

Discussion in 'General Discussion' started by dxer, May 12, 2008.

  1. dxer

    dxer Well-Known Member

    Joined:
    Sep 9, 2002
    Messages:
    295
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Europe
    I just learned that time on my server is like 15 minutes behind actual time. I tried to update ....sync with time server but nothing is changed.
    What should I do ?
     
  2. shammi1234

    shammi1234 Member

    Joined:
    Jul 26, 2006
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Please set the correct time zone in localtime and use ntpdate or rade to synchorine the time with current time and use

    hwclock to update the hardware clock.

    Regards,
    Sham
     
  3. dxer

    dxer Well-Known Member

    Joined:
    Sep 9, 2002
    Messages:
    295
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Europe
    I am not sure I understand you. Can you be more specific about that....are these commands I need to run in shell or what ?
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    If your time zone is correct simply keep it in sync by adding this to crontab. You can ask your DC for their time server address or use any public server on the net. Of course just replace "time.nist.gov" with an server of your choice.

    00 00,06,12,18 * * * rdate -s tme.nist.gov; /sbin/hwclock --systohc > /dev/null 2>&1

    To update your time now, just run:
    rdate -s time.nist.gov

    forgot to add in the hwclock which updates the hardware.
     
    #4 jayh38, May 13, 2008
    Last edited: May 13, 2008
  5. dxer

    dxer Well-Known Member

    Joined:
    Sep 9, 2002
    Messages:
    295
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Europe

    I tried to run that command but result was:
    rdate: time.nist.gov: Servname not supported for ai_socktype


    What now ?
     
  6. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    As I mentioned earlier, ask your data center for their time server address or perhaps use the cpanel time server. rdate.cpanel.net

    00 00,06,12,18 * * * rdate -s rdate.cpanel.net; /sbin/hwclock --systohc > /dev/null 2>&1

    rdate -s rdate.cpanel.net
     
  7. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi, I'm also stuck with this issue. See the following:

    Code:
    # rdate -s rdate.cpanel.net
    rdate: rdate: could not set system time: Operation not permitted
    
    # rdate -s time.sinectis.com.ar
    rdate: couldn't connect to host time.sinectis.com.ar: Connection refused
    Here in Argentina, time.sinectis.com.ar is a reliable time sync source. In fact, I use it to sync my Windows time.

    When in WHM I tried to sync the server time, it is always set to be Africa :eek: (it's the first option element in the dropdown), then I select my timezone (America/Buenos_Aires) and after submitting, the resultin page shows the correct message (Local TimeZone has been set to America/Buenos_Aires). Although, when you return to the Server time page, the timezone is once again stuck in Africa. The Current time shown in the same page is almost exact (Exactly 5 minutes behind the real time). In despite of this, my Current time is shown with the correct "ART" timezone format.
    I don't know if all this is a cPanel bug: the timezones dropdown isn't selecting the timezone I choose because it lacks of a "selected" statement inside the correct option list, or if my vps is really refusing to change.
    Any clues?


    UPDATE: I've learnt reading past posts that time cannot be modified cause I'm on a VPS. Although, why is the timezone at whm screen been reset to Africa?
     
    #7 Kent Brockman, Jun 30, 2008
    Last edited: Jun 30, 2008
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator

    That is a long standing bug in WHM. Thanks for the nudge, I forgot about it.
     
  9. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    ok, added to the TODO list? Great! ;)

    BTW, I was talking with the DC guys and told me that being part of a VPS shouldn't be a problem to set the server time. I really don't think so, since it has sense to be blocked to avoid any vps user to create time conflicts if set an incorrect date. What I really don't know is... if the VPS may keep a different time from what is set in the hardware clock (and that may sustain the DC guys theory).
     
  10. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    I just checked the time under WHM. It is very accurate. I have not changed the time-sync server before.
     
  11. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yep, it's very accurate. In fact, and just for being fan of cpanel I started using rdate.cpanel.net to update my Windows clock :D

    Although I cannot upgrade the server time cause I'm on a VPS, the DC staff ran the rdate on the server and the entire server is still 2 minutes behind the real time. May this be a Linux bug?
     
Loading...

Share This Page