| 2015-10-14 11:40:30 |
Laércio de Sousa |
bug |
|
|
added bug |
| 2015-10-14 12:07:31 |
Laércio de Sousa |
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 on 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) |
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) |
|
| 2015-10-14 12:12:23 |
Laércio de Sousa |
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) |
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. |
|
| 2015-10-14 15:42:27 |
Laércio de Sousa |
branch linked |
|
lp:~lbssousa/lightdm/guest-account-union-mount-optimizations |
|
| 2015-10-16 10:43:55 |
Robert Ancell |
lightdm: status |
New |
Fix Committed |
|
| 2015-10-16 10:43:57 |
Robert Ancell |
lightdm: importance |
Undecided |
Low |
|
| 2015-10-16 10:43:59 |
Robert Ancell |
lightdm: milestone |
|
1.17.0 |
|
| 2015-10-16 10:44:03 |
Robert Ancell |
lightdm: importance |
Low |
Medium |
|
| 2015-10-16 10:47:23 |
Robert Ancell |
summary |
Union-mounting approach for guest-account: further optimizations |
Speed up guest account creation by reducing chown usage etc |
|
| 2015-10-28 02:34:14 |
Robert Ancell |
lightdm: status |
Fix Committed |
Fix Released |
|