thermald: does not check lock file correctly
Bug #1480892 reported by
Colin Ian King
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
thermald (Ubuntu) |
Fix Released
|
High
|
Colin Ian King | ||
Trusty |
Fix Released
|
High
|
Colin Ian King | ||
Vivid |
Fix Released
|
High
|
Colin Ian King | ||
Wily |
Fix Released
|
High
|
Colin Ian King |
Bug Description
Commit 97b1720a42f33fd
The regression was caused by overzealous file descriptor leakage cleanups to stop static analysis warnings. The locking should be improved by:
1. Making the fd global
2. Closing and unlinking the lock file on abort exits or normal terminations
Changed in thermald (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Colin Ian King (colin-king) |
importance: | Medium → High |
Changed in thermald (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in thermald (Ubuntu Vivid): | |
status: | New → In Progress |
Changed in thermald (Ubuntu Trusty): | |
importance: | Undecided → High |
Changed in thermald (Ubuntu Vivid): | |
importance: | Undecided → High |
Changed in thermald (Ubuntu Trusty): | |
assignee: | nobody → Colin Ian King (colin-king) |
Changed in thermald (Ubuntu Vivid): | |
assignee: | nobody → Colin Ian King (colin-king) |
Changed in thermald (Ubuntu Wily): | |
status: | In Progress → Fix Released |
To post a comment you must log in.
[SRU Justification] (Vivid, Trusty)
Thermald lockfile has been broken during a code cleanup, meaning multiple instances of thermald can be started. This fix is required to re-instate the lockfile functionality while also performing correct closure and removal of the lock file on thermald termination (be it an error or a successful termination). Thus this fix restores the original functionality plus it also cleans up the lockfile too.
[Test Case]
Without the fix, one can start multiple instances of thermald, e.g run the following while thermald is running as a service:
sudo thermald --no-daemon --loglevel=info
With the fix, thermald will detect another instance of thermald (via the lockfile) and terminate with an error message, for example:
Couldn't get lock file 21449
An instance of thermald is already running, exiting ...
[Regression Potential]
Can't think of any.