Bug 78352

Summary: Problem when kontact session is restored after logout,login
Product: [Applications] kmail Reporter: zabilcm <zabilcm>
Component: generalAssignee: Daniel Molkentin <molkentin>
Status: RESOLVED FIXED    
Severity: normal CC: Stefan.Borggraefe
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Patch for kmstartup.cpp.

Description zabilcm 2004-03-24 07:07:37 UTC
Version:            (using KDE KDE 3.2.1)
Installed from:    RedHat RPMs
OS:          Linux

The "lock" file in '~/.kde/share/apps/kmail' folder does not get deleted when the user ends session/logs out while running 'kontact'.
Because of this reason when the user log's in, an attempt is made to restore the kontact session and while this happens a message stating that there is already one instance of kmail running as indicated by the "lock" file.
The only way to get contact running after this is manually deleting the "lock" file in the '~/.kde/share/apps/kmail' folder.
Comment 1 tjg 2004-03-25 04:25:22 UTC
I have a similar problem, though it doens not happen every time. It happens frequently enough to be annoying.

I believe it is related to Kontact or KMail not shutting down correctly when I shut my notebook down without closing KMail first. 

I'm not sure, but I don't believe I've ever had the problem if I've closed Kontact before shutting my system down.
Comment 2 info 2004-11-25 18:37:59 UTC
I had this problem in previous versions but never in 3.3. or 3.3.1.
Comment 3 Peter Thomassen 2005-02-23 21:17:10 UTC
I can confirm #1, and this is very annoying.

BTW: Is the session saved when calling "halt"?
Comment 4 Artur Jaroschek 2005-05-03 11:05:48 UTC
I have a related bug in 3.3. When I login kontact is always restored correctly. But when I try to start kontact (again), to bring it to front I get this error message that kontact is already running and I have the option to kill kontact or to go on. This only habbens when the first instance of kontact is started by restoring the previous session. It does not appear when I start kontact manually and then try to start kontact again. Very annoying since I use my multi-media-keys to bring kontact to front...
Comment 5 Daniel Molkentin 2005-06-09 15:27:44 UTC
Can someone from the kmail hackers please have a look at the session management when running in kontact?
Comment 6 Janis M. 2005-08-25 15:23:52 UTC
I got a similar prblem in KDE3.4.0 (Kontact 1.1). If Kontakt is killed with kill oder killall the pid value in the lock file will not be set to -1. If I log out from KDE (Kontact still running) the pid value is set to -1 (sometimes, not every time.).
Comment 7 Janis M. 2005-08-29 11:37:29 UTC
Created attachment 12415 [details]
Patch for kmstartup.cpp.

We have created a Patch for KMails kmstartup.cpp.
It fixes the problem for us. (Sets -1 as Pid value in the lock-file. Even if
Kontact gets SIGTERM or SIGHUP etc.)
Comment 8 Stefan Borggraefe 2006-01-20 07:42:55 UTC
I still run into this bug with Kontact 1.2/KDE 3.5.

Why wasn't the attached patch checked in? Maybe it could be refactored to avoid the code duplication, but isn't it the right approach?
Comment 9 FiNeX 2007-12-11 17:44:27 UTC
Kontact on KDE 3.5.8 and KDE 4 is working fine. After killing process there is no more file locking problems.