Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Tom Gundersen <teg@jklm.no>
Cc: util-linux <util-linux@vger.kernel.org>
Subject: Re: hwclock's ADJPATH
Date: Tue, 26 Jul 2011 12:46:48 +0200	[thread overview]
Message-ID: <20110726104648.GA14764@nb.net.home> (raw)
In-Reply-To: <CAG-2HqUu6BduqDkja7-T67CJNYRKZWBbOQA29O3HaR=092bKaA@mail.gmail.com>

On Tue, Jul 26, 2011 at 02:06:20AM +0200, Tom Gundersen wrote:
> These are the constraints we have:
> 
> /etc could possibly be mounted read-only.
> /var might not be mounted at early boot.
> 
> This is the usage we have (in the cases where a machine does not use ntp):
> 
> 1) At early boot we call "hwclock --systz", which require us to read
> ADJPATH to determine if RTC is in UTC/LOCAL (so ADJTIME can not be in
> /var).
>
> 2) From time to time (typically at shutdown), we call "hwclock
> --adjust", which require us to write to ADJPATH (so ADJPATH can not be
> in /etc).
> 3) The administrator should manually call "hwclock --set" and make
> sure ADJPATH is writeable when this is done (for this, ADJPATH could
> be either in /etc or /var).
> 
> 
> 
> Are these reasonable constraints and a reasonable usecase? If so, it
> seems to me that the only way to make this work is to split ADJPATH
> into two files, /etc/adjtime containing UTC/LOCAL and
> /var/lib/hwclock/adjtime containing everything else. Or am I missing
> something?

 You're probably right. Note that you can use:

    hwclock --systz $(CLOCK_ZONE_OPTION)

 where the CLOCK_ZONE_OPTION will be --utc or --local from some extra
 file (e.g. /etc/sysconfig/hwclock), then /etc/adjtime will be
 unnecessary for --systz.

 And for hwclock --set or --adjust you can use
 --adjfile=/var/lib/hwclock/adjtime or so.


 Note that systemd will probably not call hwclock at all, it will read
 only /etc/adjtime to get UTC/LOCAL setting and call settimeofday().
 The --adjust is somehow unexpected on systems with systemd.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

      reply	other threads:[~2011-07-26 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26  0:06 hwclock's ADJPATH Tom Gundersen
2011-07-26 10:46 ` Karel Zak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110726104648.GA14764@nb.net.home \
    --to=kzak@redhat.com \
    --cc=teg@jklm.no \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox