mack
07-23-2003, 04:56 PM
:!: I encountered a race bug in the xsession-knoppix package, in /etc/X11/Xsession.d/45xsession.
At first, I thought something was wrong with my remastering. See discussion in http://www.knoppix.net/forum/viewtopic.php?t=3558.
After failing to find a change I made which caused KDE configuration to reset to default while loading, I created a new remaster, starting from knoppix 3.2, and made sure I'm not making any changes other than running some daemon I need from some rc file which is totally unrelated to KDE or X11. The bug was still there but was not persistent. Sometimes the environment was ok and sometimes it wasn't. :?
After a lot of digging and adding debug messages all over the place (which made the problem worse), I realized that when 45xsession copies the kde config files in this line:
\cp -ua /etc/skel/{.kde*,Desktop} $HOME/
it fails to copy some important files from /etc/skel/.kde/share/config/, claiming that the directory already exists in the ramdisk homedir and has no write permission. I added
rm -rf /ramdisk/home/knoppix/.kde right before the above line, and still, sometimes these config files were created before the cp had a chance to put the real files there. Some other process was racing with 45xsession on the creation of some files in .kde. :shock:
Looking a bit up in 45xsession reveals a
sleep 2 right before the cp takes place, after ksplash is executed. Playing with the sleep time solves the problem here, but on slower hardware or with mode processes using the CPU during init, the problem can reappear.
:arrow: To sum it up, ksplash, at a certain point, creates .kde/share/config if its not there yet, and prevents cp from putting the real files there.
I don't know why ksplash has to be loaded so early instead of after the non-persistent homedir is created, but in the meantime, here's a real work-around which isn't time-based (so the sleep 2 can be eliminated):
:idea: Right before ksplash is executed, I do
mkdir -p $HOME/.kde/share/config.
This is ugly but solves it for now. As a real solution, ksplash has to be executed AFTER the creation of the non-persistent homedir, or be patched to create these dirs with proper permissions.
Who maintains this package ?
Mack
At first, I thought something was wrong with my remastering. See discussion in http://www.knoppix.net/forum/viewtopic.php?t=3558.
After failing to find a change I made which caused KDE configuration to reset to default while loading, I created a new remaster, starting from knoppix 3.2, and made sure I'm not making any changes other than running some daemon I need from some rc file which is totally unrelated to KDE or X11. The bug was still there but was not persistent. Sometimes the environment was ok and sometimes it wasn't. :?
After a lot of digging and adding debug messages all over the place (which made the problem worse), I realized that when 45xsession copies the kde config files in this line:
\cp -ua /etc/skel/{.kde*,Desktop} $HOME/
it fails to copy some important files from /etc/skel/.kde/share/config/, claiming that the directory already exists in the ramdisk homedir and has no write permission. I added
rm -rf /ramdisk/home/knoppix/.kde right before the above line, and still, sometimes these config files were created before the cp had a chance to put the real files there. Some other process was racing with 45xsession on the creation of some files in .kde. :shock:
Looking a bit up in 45xsession reveals a
sleep 2 right before the cp takes place, after ksplash is executed. Playing with the sleep time solves the problem here, but on slower hardware or with mode processes using the CPU during init, the problem can reappear.
:arrow: To sum it up, ksplash, at a certain point, creates .kde/share/config if its not there yet, and prevents cp from putting the real files there.
I don't know why ksplash has to be loaded so early instead of after the non-persistent homedir is created, but in the meantime, here's a real work-around which isn't time-based (so the sleep 2 can be eliminated):
:idea: Right before ksplash is executed, I do
mkdir -p $HOME/.kde/share/config.
This is ugly but solves it for now. As a real solution, ksplash has to be executed AFTER the creation of the non-persistent homedir, or be patched to create these dirs with proper permissions.
Who maintains this package ?
Mack