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

Discussion in 'General Discussion' started by cyanide, Feb 8, 2005.

  1. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    I have a new Fedora machine online and for the life of me, I cannot set the time under Server Time
    I'm in the EST and the server is 2 hours behind.
    No matter what I choose, it never changes.

    Is there a manual way to do this via SSH, perhaps ?
     
  2. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Run this command at the prompt:

    date -s 'Wed Feb 8 12:02 EST 2005'
     
  3. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    Thanks Andy,

    Although, I think it should be date -s 'Tue Feb 8 11:02 EST 2005' ;)

    Anyway, the message I received is : date: cannot set date: Operation not permitted
     
  4. amal

    amal Well-Known Member

    Joined:
    Nov 22, 2003
    Messages:
    155
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Fc3


    R u using Fedora Core 3? If so, then it could be an issue with SELinux. Try turning off SELinux using the command -

    setenforce 0

    and try changing the date again....
    :)
     
  5. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    Thanks for the reply,

    I'm using Fedora Core 1
    I tried your suggestion anyway, and it didn't work.
     
  6. Blasted_Heath

    Blasted_Heath Member

    Joined:
    Dec 19, 2004
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Try
    Code:
    hwclock --systohc
    This should synchronise the hardware and software clocks, allowing the whm time settings to function.
     
  7. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    Thanks for your response,
    It didn't work, though - got this response
    Wonder if it has anything to do with syslog failing
     
  8. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    I ended up entering right/Etc/GMT+3
    which fixed it ... :rolleyes:

    I'm in the Eastern Time Zone
     
  9. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    The /right/ is meant to take into account leap seconds and isn't recommend for use
    as it may cause problems with date computations/comparisons ... that's what it was sometime back as it lead to Mysql ending up doing incorrect Date comparisons.

    Unless it has been recommended by RH as fine (and not experimental), avoid using the /right/ timezones. My info could be a lil out of date, but kindly doublecheck on that /right/ usage

    [EDIT]
    Also, it isn't known to me as to why cPanel copies over to /etc/localtime instead of symlinking /etc/localtime to the proper file. At least this would lead to a simpler debugging/tracking. If it's copied over like in present it is then to trackback one would have to do:

    ls -al /etc/localtime

    -rw-r--r-- 1 root root nnn Mar 24 2004 /etc/localtime

    where nnn is size then

    find /usr/share/zoneinfo -size nnnc

    to find which timezone is being used

    [/EDIT]
    Anup
     
    #9 anup123, Feb 11, 2005
    Last edited: Feb 11, 2005
  10. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    To let you explore whether /right/ timezones cause a problem or not, (i never used /right/ timezone), just do the following exercise:

    create a table i mysql say test_table with two columns:

    ID
    TIMESTAMP

    Then insert following record:

    ID =1
    Timestmp = 20040226121328

    Then run a query:

    mysql> SELECT ID, Timestmp, Timestmp > 20040226121328 FROM test_table WHERE ID = 1;

    and see what you get. If the output is something like following you could be in for trouble any day with some scripts:

    +----+----------------+---------------------------+
    | ID | Timestmp | Timestmp > 20040226121328 |
    +----+----------------+---------------------------+
    | 33 | 20040226121328 | 1 |
    +----+----------------+---------------------------+
    1 row in set (0.01 sec)


    If the above is true then at least the /right/ could be eliminated by cPanel from WHM drop down menu altogether to avoid unpleasant moments.

    :)

    Anup
     
Loading...

Share This Page