Gentoo Archives: gentoo-amd64

From: Sebastian Redl <sebastian.redl@×××××××××××.at>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Re: hardware clock often doesn't sync to system on shutdown
Date: Mon, 15 Sep 2008 15:00:21
Message-Id: 48CE77C9.7090605@getdesigned.at
In Reply to: Re: [gentoo-amd64] Re: hardware clock often doesn't sync to system on shutdown by Thanasis
1 Thanasis wrote:
2 > I attach the /etc/init.d/clock which shows a local "readonly" variable
3 > that controls a "--noadjfile" option.
4 > What does the following test do?
5 >
6 > if ! touch /etc/adjtime 2>/dev/null ; then
7 > readonly="yes"
8 > elif [[ ! -s /etc/adjtime ]] ; then
9 > echo "0.0 0 0.0" > /etc/adjtime
10 > fi
11 First it tests if a touch of /etc/adjtime succeeds. If not, the file is
12 not writeable, and it sets the readonly variable.
13
14 Then it tests if /etc/adjtime exists (it does, since the touch
15 succeeded) and has non-zero size. If not, it writes a zero adjust into
16 the file.
17
18 Sebastian

Replies

Subject Author
Re: [gentoo-amd64] Re: hardware clock often doesn't sync to system on shutdown Thanasis <thanasis@××××××××××.org>