pidfile left after logout may cause critical issues
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Accomplishments Daemon |
Fix Committed
|
Critical
|
Rafał Cieślak |
Bug Description
For some reason, the daemon's pidfile stays when user logs out or when system shuts down. I suspect this may be because the daemon does not receive a SIGTERM signal, but is KILLed instead.
In such case, next time the daemon is started, it will kill the pid that is stored in the pid file. Note that in a new session this may be a completely unrelated process!
Moreover, this makes the daemon startup much longer, especially if started from the viewer.
The ideal solution to this would be to make the pidfile disappear when the daemon is closed because of user logging out. I have investigated this, and it seems this may be almost impossible, the only reasonable way incorporates connecting to gnome-session, which would make the daemon depending on gnome DE. Not cool.
The alternative solution is to *never* try killing the daemon. We'll assume that twistd never locks down. That would change the startup procedure to: 1) check if pidfile exists, if not, start the daemon 2) if the file exists, try connecting to the daemon, if successful, then there is no need to start the daemon 3) if not successful, remove the pidfile for twistd and start the daemon.
summary: |
- pidfile left after logout makes next daemon start very long + pidfile left after logout may cause critical issues |
Changed in ubuntu-accomplishments-daemon: | |
status: | New → In Progress |
Changed in ubuntu-accomplishments-daemon: | |
status: | In Progress → Fix Committed |
Won't this get fixed by the move to dbus? If so let's mark it in-progress.