util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Bruce Dubbs <bruce.dubbs@gmail.com>
Cc: Util-Linux <util-linux@vger.kernel.org>,
	J William Piggott <elseifthen@gmx.com>
Subject: Re: Suggested changes to util-linux for FHS compliance.
Date: Mon, 8 Mar 2021 12:21:59 +0100	[thread overview]
Message-ID: <20210308112159.yblk5ucy6uxahlho@ws.net.home> (raw)
In-Reply-To: <20210219113009.mav3dis3qzofru4c@ws.net.home>

On Fri, Feb 19, 2021 at 12:30:12PM +0100, Karel Zak wrote:
> On Mon, Feb 15, 2021 at 10:16:30AM +0100, Karel Zak wrote:
> > On Fri, Feb 12, 2021 at 11:04:59AM -0600, Bruce Dubbs wrote:
> > > I don't recall if this has come up before, but I suggest a couple of changes
> > > to the default util-linux build configuuration:
> > > 
> > > 1. Change the default ADJTIME_PATH to be /var/lib/hwclock/adjtime
> > 
> > Good idea. I'll do that.
> 
> Hmm... I remembered now that we have in our TODO:
> 
>  hwclock
>  ------
>  - use /var/lib/hwclock/drift to store hw-clock drift numbers.
>  - use /etc/adjtime as read-only for UTC/LOCAL information only
>  - the /var/lib/hwclock/drift should be implemented backwardly compatible,
>    it means use the file only if exists, otherwise follow /etc/adjtime
> 
> so maybe the best would be to keep ADJTIME_PATH=/etc/adjtime and use
> it as read-only and use ${localstatedir}/lib/hwclock/drift for the
> rest.
> 
> Note that ADJTIME_PATH is used by more utils, like rtcwake or systemd,
> so move it is not so easy.

OK, I have implemented it, but frankly, I'm not sure about it ;-) 
I have added William to CC:, maybe he will come with comments.  
       
See https://github.com/karelzak/util-linux/tree/topic/hwclock-drift-file
branch.                                                    
       
The idea is to keep /etc/adjtime as a source for UTC/LOCAL flag, but   
hwclock drift info (which we need to update occasionally) move to    
/var/lib/hwclock/drift. The /etc/adjtime is de-facto standard and
move it means that 3rd party utils will have no way how to determine 
hwclock UTC/LOCAL mode.
       
Both files use "adjtime" file format to make it simple to convert
from one to another.                                         
       
The change should be backwardly compatible. If you do not have /var/lib/hwclock/drift 
then it falls back to /etc/adjtime.                                  
       
I'm not sure if this is not over-engineering. Maybe the current
solution is good enough, and all we need is to make it more
use-friendly to set ADJTIME_PATH for users like Bruce (although
maintain any status information in /etc (in the year 2021) is not
nice.


The another possibility is to make a real change. Introduce completely
new file in /etc (/etc/clockmode) with only UTC/LOCAL(, force all
applications to use it (I know about rtcwake and systemd), and keep
/var/lib/hwclock/drift as private hwclock(1) file in a private format.

    Karel

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


      reply	other threads:[~2021-03-08 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12 17:04 Suggested changes to util-linux for FHS compliance Bruce Dubbs
2021-02-15  9:16 ` Karel Zak
2021-02-18 15:37   ` Bruce Dubbs
2021-02-19 11:14     ` Karel Zak
2021-02-19 17:12       ` Bruce Dubbs
2021-02-19 11:30   ` Karel Zak
2021-03-08 11:21     ` 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=20210308112159.yblk5ucy6uxahlho@ws.net.home \
    --to=kzak@redhat.com \
    --cc=bruce.dubbs@gmail.com \
    --cc=elseifthen@gmx.com \
    --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;
as well as URLs for NNTP newsgroup(s).