Bug 146426 - kdeinit_shutdown should wait for kdeinit to actually exit
Summary: kdeinit_shutdown should wait for kdeinit to actually exit
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-05 22:00 UTC by Sune Vuorela
Modified: 2007-06-05 23:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sune Vuorela 2007-06-05 22:00:34 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    Debian testing/unstable Packages

All details can be found in a debian bug report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425314 - but I try to draw out the important issues here.

kdeinit keeps .xsession-errors open until kdeinit exits. The startkde script does return before kdeinit is exited completely. Then .xsession-errors is still open.
This is a problem for users using pam and encrypted home - because pam tries to unmount home before kdeinit is completely finished - so .xsession-errors is still open - and umount of course fails.

adding a sleep 2; or a sleep 5; after kdeinit_shutdown works around the issue, but is kind of hackish. But it shows that it is a timing issue between startkde ending and kdeinit ending.

/Sune
Comment 1 Thiago Macieira 2007-06-05 23:40:39 UTC
SVN commit 671951 by thiago:

Make kdeinit4_shutdown wait for kdeinit4's exit.

Since kdeinit4 doesn't explicitly close the socket, it gets closed
when the program exits. So, this read_socket call returns when
kdeinit4 has finished.

BUG:146426


 M  +1 -0      wrapper.c  


--- trunk/KDE/kdelibs/kinit/wrapper.c #671950:671951
@@ -359,6 +359,7 @@
       header.cmd = LAUNCHER_TERMINATE_KDE;
       header.arg_length = 0;
       write_socket(sock, (char *) &header, sizeof(header));
+      read_socket(sock, (char *) &header, 1); /* wait for the socket to close */
       return 0;
    }