Discussion:
Timezone doesn't update when /etc/localtime symlink changes
(too old to reply)
Craig McQueen
2015-10-14 05:19:03 UTC
Permalink
I've noticed that on ConnMan 1.30, net.connman.Clock property Timezone isn't updating when /etc/localtime gets changed.

I found this old message which sounds similar -- "[PATCH] timezone: Fix timezone can't auto update, file localtime permission issue":
https://lists.connman.net/pipermail/connman/2011-July/005354.html

In my target system, /etc/localtime is a symlink into the appropriate file under /usr/share/zoneinfo.
--
Craig McQueen
Craig McQueen
2015-10-14 06:42:56 UTC
Permalink
Post by Craig McQueen
I've noticed that on ConnMan 1.30, net.connman.Clock property Timezone
isn't updating when /etc/localtime gets changed.
I found this old message which sounds similar -- "[PATCH] timezone: Fix
https://lists.connman.net/pipermail/connman/2011-July/005354.html
In my target system, /etc/localtime is a symlink into the appropriate file
under /usr/share/zoneinfo.
I've tried making /etc/localtime an ordinary file, rather than a symlink. But still ConnMan doesn't notice when it changes. Is Timezone update working for others?

My target system is an ARM embedded system built with Yocto. I've verified that inotify is enabled in my system's kernel.
--
Craig McQueen
Patrik Flykt
2015-10-14 07:49:39 UTC
Permalink
Hi,
Post by Craig McQueen
Post by Craig McQueen
In my target system, /etc/localtime is a symlink into the
appropriate file
Post by Craig McQueen
under /usr/share/zoneinfo.
I've tried making /etc/localtime an ordinary file, rather than a
symlink. But still ConnMan doesn't notice when it changes. Is Timezone
update working for others?
My target system is an ARM embedded system built with Yocto. I've
verified that inotify is enabled in my system's kernel.
Currently ConnMan only writes to /etc/localtime when the experimental
Clock API Timezone property is updated. Nothing in ConnMan watches this
file for changes. You are free to send a patch for this, see
include/inotify.h for support functions.

Cheers,

Patrik
Craig McQueen
2015-10-15 00:28:42 UTC
Permalink
Post by Patrik Flykt
Post by Craig McQueen
Post by Craig McQueen
I've noticed that on ConnMan 1.30, net.connman.Clock property Timezone
isn't updating when /etc/localtime gets changed.
https://lists.connman.net/pipermail/connman/2011-July/005354.html
In my target system, /etc/localtime is a symlink into the appropriate
file under /usr/share/zoneinfo.
I've tried making /etc/localtime an ordinary file, rather than a symlink. But still
ConnMan doesn't notice when it changes. Is Timezone update working for
others?
My target system is an ARM embedded system built with Yocto. I've verified
that inotify is enabled in my system's kernel.
Currently ConnMan only writes to /etc/localtime when the experimental
Clock API Timezone property is updated. Nothing in ConnMan watches this
file for changes. You are free to send a patch for this, see
include/inotify.h for support functions.
That doesn't sound right -- it looks as though there's code in timezone.c to watch the file for changes. __connman_timezone_init() sets up an inotify on /etc. When inotify triggers it calls inotify_data(). If the file that changed is localtime, then it calls __connman_clock_update_timezone().

Presumably something in that mechanism is broken.
--
Craig McQueen
Patrik Flykt
2015-10-19 09:56:04 UTC
Permalink
Hi,
Post by Craig McQueen
That doesn't sound right -- it looks as though there's code in
timezone.c to watch the file for changes. __connman_timezone_init()
sets up an inotify on /etc. When inotify triggers it calls
inotify_data(). If the file that changed is localtime, then it calls
__connman_clock_update_timezone().
I'm corrected, which means we can have this fixed with a decent amount
of effort, cool! Looking at other code IN_MODIFY | IN_MOVED_TO is
handled. Now some figuring out is needed to see whether /etc/localtime
is a symlink and if yes, what needs to be done to detect that the entity
it points to has changed. Or something even more simpler than that which
is just broken.

Cheers,

Patrik

Loading...