Link to home
Start Free TrialLog in
Avatar of n94magho
n94magho

asked on

Setting the system clock.

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
ASKER CERTIFIED SOLUTION
Avatar of bjacobs
bjacobs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of n94magho
n94magho

ASKER

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)


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!
Perfect. But I'm in sweden. The -u option seems to override my local time. (my timezone settings) Now it works perfect...