Attaching a patch against lightdm-0.3.7-0ubuntu2 that implements the
third idea above. When lightdm receives a TERM signal, right before
ending the mainloop it calls a cleanup function that just calls
g_hash_table_remove_all on the processes table. This works on its own,
but in rare instances I was able to trigger a SIGSEGV with from_child_cb
still being called on a finalized child process. To fix this, the patch
saves the event source ids for g_io_add_watch and g_child_watch_add and
removes them when the child process is finalized.

This works for service start/stop but restart still isn't working. This
seems to be because the lightdm process is restarted so quickly that the
previous X server instance hasn't had time to completely exit, so the
new X server instance exits with an error (that is what the log seems to
indicate:

[+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.00s] DEBUG: Starting Light Display Manager 0.3.7, PID=6574
[+0.00s] DEBUG: Loaded configuration from /etc/lightdm.conf
[+0.00s] DEBUG: Loading display default-display
[+0.00s] DEBUG: Logging to /var/log/lightdm/:0.log
[+0.00s] DEBUG: Starting on /dev/tty7
[+0.01s] DEBUG: Launching X Server
[+0.01s] DEBUG: Launching process 6578: /usr/bin/X :0 -auth 
/var/run/lightdm/authority/0 -nolisten tcp vt7
[+0.01s] DEBUG: Waiting for signal from X server :0
[+0.01s] DEBUG: Process 6578 exited with return value 1
[+0.01s] WARNING: X server exited with value 1)

Not really related to the issue in this bug, but I thought I would
mention it here since I stumbled on it, and it is partially related.


** Patch added: "cleanup_table.patch"
   
https://bugs.launchpad.net/lightdm/+bug/789389/+attachment/2167529/+files/cleanup_table.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/789389

Title:
  LightDM leaves a child X instance running when the service is stopped

To manage notifications about this bug go to:
https://bugs.launchpad.net/lightdm/+bug/789389/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to