After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 658352 - Use timedated dbus api (initial daemon in systemd)
Use timedated dbus api (initial daemon in systemd)
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Date and Time
git master
Other Linux
: Normal normal
: ---
Assigned To: Tomas Bzatek
Control-Center Maintainers
Depends on:
Blocks: 622878 systemd
 
 
Reported: 2011-09-06 12:54 UTC by Bastien Nocera
Modified: 2012-01-23 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
preliminary patch (149.70 KB, patch)
2011-09-13 15:32 UTC, Tomas Bzatek
needs-work Details | Review
proposed patch (155.65 KB, patch)
2011-10-07 14:51 UTC, Tomas Bzatek
none Details | Review
proposed patch (156.12 KB, patch)
2012-01-04 11:07 UTC, Tomas Bzatek
needs-work Details | Review
proposed patch (156.70 KB, patch)
2012-01-19 13:18 UTC, Tomas Bzatek
committed Details | Review

Description Bastien Nocera 2011-09-06 12:54:13 UTC
To replace the one in gnome-settings-daemon.

The API is here:
http://www.freedesktop.org/wiki/Software/systemd/timedated

It's missing the SetDate and AdjustTime methods, but they weren't being used anyway.
Comment 1 Tomas Bzatek 2011-09-13 15:32:06 UTC
Created attachment 196393 [details] [review]
preliminary patch

This is preliminary version of the patch, still few things to solve.

I made it to use gdbus-codegen to always re-generate C sources from the attached d-bus interface xml file. That one was created using `gdbus introspect` from the running systemd 35 version. Since we often build in a limited chroot, introspection is not done automatically, sticking to a distributed interface version should be sufficient.

The patch requires systemd 36 version (not yet released) in order to get the https://bugs.freedesktop.org/show_bug.cgi?id=40583 fix.

Standing issues:
 - the Unlock button can hold a single polkit action only, while timedated provides four, each for the particular call. Filed https://bugs.freedesktop.org/show_bug.cgi?id=40839. While we can remove the button after all, it's not convenient to enter root password four times to get the settings done. Another thing is the simplicity of not handling errors or auth cancellation - we would simply expect the timedated calls to succeed, given that we've already gained authorization.

 - right now we don't touch the LocalRTC/UTC settings, do we want to bother the user? A good argument for leaving this untouched is maintaining compatibility with other OSes.

 - I've also removed set-timezone.{c,h} as it seems to be a test program for the old gnome-settings-daemon DateTimeMechanism service
Comment 2 Bastien Nocera 2011-09-13 15:48:02 UTC
Review of attachment 196393 [details] [review]:

We could probably also monitor the properties changing remotely, if them changing wasn't our work? (eg. automatic timezone switching based on location for example, would need to change the timezone even if things are disabled).

::: panels/datetime/Makefile.am
@@ +110,3 @@
+#		 > timedated1-interface.xml
+
+#		--xml						\

Those 2 should be added to CLEANFILES.

@@ +115,3 @@
+		--interface-prefix org.freedesktop.		\
+		--generate-c-code timedated			\
+#		--dest org.freedesktop.timedate1		\

That file is missing from EXTRA_DIST.
Comment 3 Tomas Bzatek 2011-10-07 14:51:18 UTC
Created attachment 198540 [details] [review]
proposed patch

(In reply to comment #2)
> We could probably also monitor the properties changing remotely, if them
> changing wasn't our work? (eg. automatic timezone switching based on location
> for example, would need to change the timezone even if things are disabled).

Agree, good idea. This updated patch monitors remote property changes and updates the UI to reflect timedated actual settings. Again with the property value workaround (https://bugs.freedesktop.org/show_bug.cgi?id=37632). I also had to shuffle UI update bits a little.

> ::: panels/datetime/Makefile.am
> @@ +110,3 @@
> +#         > timedated1-interface.xml
> +
> +#        --xml                        \
> 
> Those 2 should be added to CLEANFILES.
> 
> @@ +115,3 @@
> +        --interface-prefix org.freedesktop.        \
> +        --generate-c-code timedated            \
> +#        --dest org.freedesktop.timedate1        \
> 
> That file is missing from EXTRA_DIST.

Fixed.

(In reply to comment #1)
> Standing issues:
>  - the Unlock button can hold a single polkit action only, while timedated
> provides four, each for the particular call. Filed
> https://bugs.freedesktop.org/show_bug.cgi?id=40839. While we can remove the
> button after all, it's not convenient to enter root password four times to get
> the settings done. Another thing is the simplicity of not handling errors or
> auth cancellation - we would simply expect the timedated calls to succeed,
> given that we've already gained authorization.

Also fixed thanks to David's recent PolicyKit work. There's no new PK tarball yet, we will need to bump version requirements once it's out. This patch installs new policy file.

A recent enough glib version is required for the bug 659070 fix, 2.30.0 should be fine.
Comment 4 Bastien Nocera 2011-11-18 14:54:36 UTC
Tomas, could you please rebase the patch and include the necessary build requirements updates, and I'll review it.
Comment 5 Tomas Bzatek 2012-01-04 11:07:13 UTC
Created attachment 204557 [details] [review]
proposed patch

Attaching rebased patch, no changes were necessary. I've also included deps version bumps.

I did not include systemd requirement on purpose since distros are using various init systems and AFAIK there's no alternative package providing org.freedesktop.timedate1 dbus service yet. Also there's no separate pkg-config file for it.
Comment 6 Bastien Nocera 2012-01-06 12:21:35 UTC
Which version of systemd would I need for testing? I have -36, would it work?

FYI, your patch is missing updates to po/POTFILES.in.
Comment 7 Javier Jardón (IRC: jjardon) 2012-01-18 19:44:55 UTC
@Bastien: Seems that timedated was added in systemd 30: http://www.freedesktop.org/wiki/Software/systemd/timedated
Comment 8 Tomas Bzatek 2012-01-19 13:18:07 UTC
Created attachment 205619 [details] [review]
proposed patch

(In reply to comment #6)
> Which version of systemd would I need for testing? I have -36, would it work?
Yes, version -36 is needed since there were fixes in the dbus interface.
 
> FYI, your patch is missing updates to po/POTFILES.in.
Thanks, attaching rebased and fixed patch.
Comment 9 Bastien Nocera 2012-01-19 22:30:12 UTC
Works for me! Thanks for the patch, much appreciated.