Solved

Setting the system clock.

Posted on 1997-11-17
4
291 Views
Last Modified: 2013-12-15
My systemclock is always one hour more than it shall be.
It doesn't matter that I change it in control-panel (rh 4,3)
Here is a bit of my rc.sysinit. I think that I shall change something in it, but how ???
(I think that the -u is wrong.)

# Set the system clock.
echo -n "Setting clock"

ARC=0
UTC=0
if [ -f /etc/sysconfig/clock ]; then
    . /etc/sysconfig/clock

    # convert old style clock config to new values
    if [ "${CLOCKMODE}" = "GMT" ]; then
          UTC=true
    elif [ "${CLOCKMODE}" = "ARC" ]; then
          ARC=true
    fi
fi

CLOCKFLAGS="-a"
if [ $UTC = "true" ]; then
    CLOCKFLAGS="$CLOCKFLAGS -u";
    echo -n " (utc)"
fi
if [ $ARC = "true" ]; then
    CLOCKFLAGS="$CLOCKFLAGS -A";
    echo -n " (arc)"
fi
echo -n ": "
clock $CLOCKFLAGS

date# Set the system clock.
echo -n "Setting clock"

ARC=0
UTC=0
if [ -f /etc/sysconfig/clock ]; then
    . /etc/sysconfig/clock

    # convert old style clock config to new values
    if [ "${CLOCKMODE}" = "GMT" ]; then
          UTC=true
    elif [ "${CLOCKMODE}" = "ARC" ]; then
          ARC=true
    fi
fi

CLOCKFLAGS="-a"
if [ $UTC = "true" ]; then
    CLOCKFLAGS="$CLOCKFLAGS -u";
    echo -n " (utc)"
fi
if [ $ARC = "true" ]; then
    CLOCKFLAGS="$CLOCKFLAGS -A";
    echo -n " (arc)"
fi
echo -n ": "
clock $CLOCKFLAGS

date
0
Comment
Question by:n94magho
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
bjacobs earned 30 total points
Comment Utility
Set the time in your bios setup and remove the clock part fron rc.sysinit. Keep it simple.
0
 

Author Comment

by:n94magho
Comment Utility
Mabe it's a good answer. Could you tell me what's good and whats bad with that???
(And I like to know how change in rc.sysinit anyway)


0
 
LVL 2

Expert Comment

by:bjacobs
Comment Utility
Hello,
I run Slackware and don't have a rc.sysinit. Here is what is in rc.S which I think is the equivalent file:

if [ -x /sbin/clock ]; then
  /sbin/clock -s
fi

You would have to change to suit your clock program path or move clock to /sbin.
If you are in the U.S have you always had this problem of did it start when Daylight Savings time ended?

Hope this helps!
0
 

Author Comment

by:n94magho
Comment Utility
Perfect. But I'm in sweden. The -u option seems to override my local time. (my timezone settings) Now it works perfect...
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now