Speed up guest account creation by reducing chown usage etc

Bug #1506020 reported by Laércio de Sousa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Light Display Manager
Fix Released
Medium
Unassigned

Bug Description

Now that bug #1497311 has already "fix commit", I'm investigating some optimizations for guest-account creation in this new scenario. To the moment, I've listed the following itens:

1. Minimize the number of "chown -R" calls: if one has a large number of files in the union's bottom layer, such a call can take a long time.

2. Minimize the number of files created on-the-fly by guest-account script: some of them are always the same and could be created only once, prior to any guest-account call. I have two alternatives for such files:

a) Ship them with lightdm package: they could be installed in /usr/share/lightdm/guest-session/skel or any other suitable location.

b) Create them in the first time guest-account script is executed, and save them in /var/cache/lightdm/guest-session/skel or any other suitable location.

In both cases, we can rely on multi-layer mounting (supported by both OverlayFS and AuFS). The only change needed here is moving the bindfs mount to the last step (obviously, we need to drop read-only option), so we can get the right UID/GID translation of the entire union. We can mount the union with the following stack:

/tmp/.pre-guest-XXXXXX/upper (RW)
/etc/guest-session/skel (RO)
/usr/share/lightdm/guest-session/skel or /var/cache/lightdm/guest-session/skel (RO)

3. Get rid of PRE_HOME directories: we could just mount the union /tmp/guest-XXXXXX/lower:/tmp/guest-XXXXXX/upper directly to /tmp/guest-XXXXXX, minimizing the risk of someone to modify underlying directories (/tmp/.pre-guest-XXXXXX) while the union is mounted. I've asked about its safety in http://unix.stackexchange.com/questions/235869/overlayfs-is-mounting-foo-lower-foo-upper-to-foo-safe and got a positive answer.

Related branches

description: updated
description: updated
Changed in lightdm:
status: New → Fix Committed
importance: Undecided → Low
milestone: none → 1.17.0
importance: Low → Medium
summary: - Union-mounting approach for guest-account: further optimizations
+ Speed up guest account creation by reducing chown usage etc
Changed in lightdm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.