How can i force dexter-server to exit when i close dexter?

Asked by Filfish on 2012-07-18

dexter works fine for me now except that the process "dexter-server" continues to run after i close the window, is there a way I can add an exit button so that when i close dexter the "dexter-server" process is terminated as well?

I have backups set against the folder where my dexterdb file is located but it won't backup while dexter-server has it locked open, at the moment I have to manually kill the "dexter-server" process to allow the backup to complete.

Question information

Language:
English Edit question
Status:
Solved
For:
Dexter - Old Edit question
Assignee:
No assignee Edit question
Solved by:
Filfish
Solved:
2012-07-19
Last query:
2012-07-19
Last reply:
Filfish (filfish) said : #1

Ok, i've sorted it.

I added a line to the app.py script as detailed below so when the main window closes a killall is run against dexter-server process.

    def _on_menuitem_quit_activated(self, widget):
        self._on_window_main_delete_event(None, None)

changed to

    def _on_menuitem_quit_activated(self, widget):
        self._on_window_main_delete_event(None, None)
        os.system("killall -9 dexter-server");

Filfish (filfish) said : #2

Update!

Oops, the first part of the above snippet is an extra button I added to try to exit nicely but it didn't do anything (I also added a new button in the main_window_.ui

I realised after the above post that the line "os.system("killall -9 dexter-server");" only needs to be added to app.py at the end of "_on_window_main_delete_event", this will then kill the dexter-server process (after it has finished writing the database file) and my additional button is obsolete (though I do prefer an exit button)

Hope this helps others in the future, The code guys could easily add this or a tidier version to the distribution just as a tidy up.