for future reference in case it helps anybody stumbling into this thread, I
found the problem altho I'm not sure of what a clean solution is and that
it's worth investing into since it will only really cause a problem if your
home is on NFS or a slow drive (this is going to be true for raspberry pis
tho, so maybe worthwhile there).
This is basically where the problem is *on_update_string_set*():
https://github.com/lxde/lxsession/blob/master/lxsession/settings.vala#L960
this is what happens:
- main creates a config object *LxsessionConfigKeyFile*
- in the constructor *LxsessionConfigKeyFile* calls *read_keyfile*(), which
is reading the global and user desktop.conf to merge them and set defaults
- for each allowed setting,which is listed in *read_keyfile*, this calls
*read_key_value* which populates the in memory structure for the config
file *kf*.
- Populating the in memory structure is done by *set_config_item_value* and
this is where *on_update_generic* is called.
- in *on_update_generic* the specific type function is called, our culprit,
*on_update_string_set*.
- here *save_keyfile* is called which uses *FileUtils.set_contents*
- looking at the manual, FileUtils.set_contents does "atomic" saves which
means a temp file is created and then moved.
*This means that for every single setting in desktop.conf a temp file is
created and then renamed to desktop.conf.*
Obviously this is not a desirable behavior and the file should be written
only once after the in-memory structure has been populated.
I don't know enough vala/lxde to understand where the right place is, but
hopefully this can help somebody put together a patch.
best,
Spike
On Mon, Sep 19, 2016 at 7:31 AM Spike <sp...@drba.org> wrote:
Hi,
I've been running lubuntu 16.04 with lxde for quite some time on a bunch of
desktops and been very happy with it. Yesterday we finally moved the
desktops to centralized homes/accounts and users began noticing a weird
behavior: logins would take up to 10 seconds during which the screen would
be completely black.
Eventually I put a strace on lxsession and confirmed that regardless of the
account being local or remote, lxsession makes some crazy number of
copy/renames of desktop.conf. I tried to look at the code, but couldn't
figure out where that was happening or why. On a local home that's not
really noticeable, but on NFS that amounts to almost 10 secs.
Here's a strace output sample tracking file syscalls:
07:05:20.000893
access("/home/administrator/.config/lxsession/Lubuntu/desktop.conf", F_OK)
= 0
07:05:20.000993
open("/home/administrator/.config/lxsession/Lubuntu/desktop.conf",
O_RDONLY) = 8
07:05:20.001355
open("/home/administrator/.config/lxsession/Lubuntu/desktop.conf.NSJ1NY",
O_RDWR|O_CREAT|O_EXCL, 0666) = 8
07:05:20.001494
lstat("/home/administrator/.config/lxsession/Lubuntu/desktop.conf",
{st_mode=S_IFREG|0664, st_size=2302, ...}) = 0
07:05:20.002867
rename("/home/administrator/.config/lxsession/Lubuntu/desktop.conf.NSJ1NY",
"/home/administrator/.config/lxsession/Lubuntu/desktop.conf") = 0
07:05:20.003075
open("/home/administrator/.config/lxsession/Lubuntu/desktop.conf.JVK1NY",
O_RDWR|O_CREAT|O_EXCL, 0666) = 8
07:05:20.003191
lstat("/home/administrator/.config/lxsession/Lubuntu/desktop.conf",
{st_mode=S_IFREG|0664, st_size=2302, ...}) = 0
07:05:20.003997
rename("/home/administrator/.config/lxsession/Lubuntu/desktop.conf.JVK1NY",
"/home/administrator/.config/lxsession/Lubuntu/desktop.conf") = 0
grep desktop.conf lxsession.trace.6624 | wc -l
260
Yes, 260. That's how crazy it is. The pattern is always the same, there's
an lstat for .config/lxsession/Lubuntu/desktop.conf followed by a rename to
finish with an open.
I can't imagine this being the desired behavior and would appreciate some
help resolving it. I've tried to remove and prepopulate the file myself and
it makes no difference, it goes through that dance regardless.
any thoughts?
thank you in advance,
Spike
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Lxde-list mailing list
Lxde-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxde-list