Dear Maintainer, If I shutdown my machine & forgot close keepass on next boot I have the message that database already opened. I think it is in cause of keepass doesn’t deletes lock file if terminated by shutdown script.
Hi, I can confirm that this bug also happens in Tails (https://tails.boum.org/) on both our stable version (based on Wheezy) and our development version (based on Jessie). The consequences here are similar: if Tails is shut down while KeePassX is still open, then on the next reboot, KeePassX opens with a warning about "The database you are trying to open is locked". This behavior can be triggered by sending the SIGINT signal to KeePassX (for example using `kill -s INT`). KeePassX should instead close the database gracefully and release any lock when received SIGINT.
Hi, What kind of desktop session is Tails running? KeePassX doesn't setup any signal handlers so sending SIGINT or SIGTERM will just kill it. However it does react to requests from the X session manager. It ask whether to save changes, remove the lock file etc. Tested on KDE and Gnome 3. Cheers, Felix
Hi, Felix Geyer wrote (11 Aug 2015 21:34:38 GMT) : GNOME. But our "immediately shutdown" button doesn't properly close the desktop session (instead it stops the GDM service, mainly for speed and simplicity's sake). Is there any reason why, or is it a simple matter of programming + someone finding time to add these signal handlers? Good to know. So I see 3 options: a) KeePassX upstream adds a handler for SIGTERM, so that every standard way of closing the application work as reliably as the already supported ones. b) We modify Tails to close the GNOME session with standard X session manager mechanisms. c) We modify Tails to send the relevant X session manager request to KeePassX upon shutdown. I suspect that (a) would be pretty simple to implement for anyone who's at ease with C++, and would benefit more users than (b) and (c). Now, nobody is interested in implementing (a), then we'll have to go the (b) or (c) way, and this bug could be tagged wontfix or downgraded to wishlist. Cheers, -- intrigeri
http://doc.qt.io/qt-4.8/unix-signals.html However the real issue is that you can't ask the user if unsaved changes should be saved to disk if you terminate the X server underneath KeePassX. The only thing KeePassX can do is clean up the lock file but that seems like a minor issue compared to loosing passwords. This isn't KeePassX specific so I think you should look into (b). Cheers, Felix
Felix Geyer wrote (18 Aug 2015 12:53:30 GMT) : Right. Indeed, fair enough. I'll let you decide how you want to handle this bug report (wontfix and/or wishlist). @sajolida: please file a ticket in Tails bug tracker about it. Thanks!
Done in https://labs.riseup.net/code/issues/10061. Thanks for your help Felix!