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 697292 - simple-slave: Be smarter about launching initial-setup
simple-slave: Be smarter about launching initial-setup
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
3.8.1
Depends on:
Blocks:
 
 
Reported: 2013-04-04 18:32 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-04-09 22:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simple-slave: Be smarter about launching initial-setup (3.78 KB, patch)
2013-04-04 18:32 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
simple-slave: Be smarter about launching initial-setup (4.50 KB, patch)
2013-04-05 20:33 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
simple-slave: Be smarter about launching initial-setup (4.71 KB, patch)
2013-04-08 18:55 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
simple-slave: Be smarter about launching initial-setup (4.74 KB, patch)
2013-04-08 19:25 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-04-04 18:32:24 UTC
Instead of using a trigger file, detect when the system has
0 users.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-04-04 18:32:25 UTC
Created attachment 240647 [details] [review]
simple-slave: Be smarter about launching initial-setup
Comment 2 Ray Strode [halfline] 2013-04-05 20:04:43 UTC
Review of attachment 240647 [details] [review]:

::: daemon/gdm-simple-slave.c
@@ +1170,3 @@
+        ActUserManager *user_manager = act_user_manager_get_default ();
+        gboolean enabled = FALSE;
+        GSList *users;

need to initialize this to NULL

@@ +1180,3 @@
         }
 
+        users = act_user_manager_list_users (user_manager);

can't call list_users until the manager is loaded, do you know that's true at this point?

@@ +1181,3 @@
 
+        users = act_user_manager_list_users (user_manager);
+        if (g_slist_length (users) > 0) {

users != NULL is going to be cheaper if there are a list of users.

@@ +1220,3 @@
+        } else {
+                g_signal_connect_swapped (user_manager, "notify::is-loaded",
+                                          G_CALLBACK (setup_session), slave);

there may be a weird race here where the slave goes down before the manager object is loaded, leading to crash on exit.

@@ +1234,3 @@
         if (res) {
                 setup_server (slave);
+                wait_until_user_manager_loaded (slave);

ah okay you're good.
Comment 3 Colin Walters 2013-04-05 20:04:46 UTC
Review of attachment 240647 [details] [review]:

This looks right to me, but I'd like if Ray reviewed too.
Comment 4 Matthias Clasen 2013-04-05 20:06:55 UTC
Review of attachment 240647 [details] [review]:

::: daemon/gdm-simple-slave.c
@@ +1180,2 @@
         }
 

Might be nice to avoid getting the user manager if we're going out anyway?
Ie defer the act_ser_manager_get_default call until here

@@ +1207,3 @@
+
+static void
+wait_until_user_manager_loaded (GdmSimpleSlave *slave)

Confusing name - this function does not wait
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-04-05 20:33:21 UTC
Created attachment 240793 [details] [review]
simple-slave: Be smarter about launching initial-setup

Instead of using a trigger file, detect when the system has
0 users.
Comment 6 Ray Strode [halfline] 2013-04-05 21:25:25 UTC
Review of attachment 240793 [details] [review]:

::: daemon/gdm-simple-slave.c
@@ +1212,3 @@
+        g_signal_handlers_disconnect_by_func (user_manager,
+                                              user_manager_loaded,
+                                              slave);

Should probably check that it's actually loaded and not just getting called with a spurious is-loaded == FALSE notification.

@@ +1501,3 @@
         }
 
+        g_signal_handlers_disconnect_by_func (user_manager,

You're missing a

ActUserManager *user_manager = act_user_manager_get_default ();

somewhere i think.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-04-08 18:55:59 UTC
Created attachment 240973 [details] [review]
simple-slave: Be smarter about launching initial-setup

Instead of using a trigger file, detect when the system has
0 users.
Comment 8 Jasper St. Pierre (not reading bugmail) 2013-04-08 19:25:29 UTC
Created attachment 240978 [details] [review]
simple-slave: Be smarter about launching initial-setup

Instead of using a trigger file, detect when the system has
0 users.
Comment 9 Ray Strode [halfline] 2013-04-08 19:27:07 UTC
Review of attachment 240978 [details] [review]:

seems to work okay in brief testing.
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-04-08 20:53:13 UTC
Attachment 240978 [details] pushed as fdc017e - simple-slave: Be smarter about launching initial-setup
Comment 11 Ray Strode [halfline] 2013-04-09 00:24:24 UTC
Hmm, I'm getting initial-setup when I shouldn't be.
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-04-09 01:04:30 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=697594
Comment 13 Matthias Clasen 2013-04-09 22:36:58 UTC
so, this should be re-closed then, I assume ?