Gentoo Archives: gentoo-amd64

From: Thanasis <thanasis@××××××××××.org>
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:27:27
Message-Id: 48CE7EAE.9080404@asyr.hopto.org
In Reply to: Re: [gentoo-amd64] Re: hardware clock often doesn't sync to system on shutdown by Sebastian Redl
1 on 09/15/2008 05:57 PM Sebastian Redl wrote the following:
2 > Thanasis wrote:
3 >> I attach the /etc/init.d/clock which shows a local "readonly"
4 >> variable that controls a "--noadjfile" option.
5 >> What does the following test do?
6 >>
7 >> if ! touch /etc/adjtime 2>/dev/null ; then
8 >> readonly="yes"
9 >> elif [[ ! -s /etc/adjtime ]] ; then
10 >> echo "0.0 0 0.0" > /etc/adjtime
11 >> fi
12 > First it tests if a touch of /etc/adjtime succeeds. If not, the file
13 > is not writeable, and it sets the readonly variable.
14 >
15 > Then it tests if /etc/adjtime exists (it does, since the touch
16 > succeeded) and has non-zero size. If not, it writes a zero adjust into
17 > the file.
18 >
19 > Sebastian
20 How can I make /etc/adjtime readonly? I tried "chmod a-w /etc/adjtime",
21 but root can always write to it :-) , unless the init script doesn't run
22 as root.

Replies

Subject Author
[gentoo-amd64] Re: hardware clock often doesn't sync to system on shutdown Duncan <1i5t5.duncan@×××.net>