Merge lp:~afrantzis/ubuntu-touch-session/fix-1642360 into lp:ubuntu-touch-session

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 294
Merged at revision: 294
Proposed branch: lp:~afrantzis/ubuntu-touch-session/fix-1642360
Merge into: lp:ubuntu-touch-session
Diff against target: 15 lines (+7/-0)
1 file modified
keep-display-on-during-boot.conf (+7/-0)
To merge this branch: bzr merge lp:~afrantzis/ubuntu-touch-session/fix-1642360
Reviewer Review Type Date Requested Status
Pat McGowan (community) Approve
Łukasz Zemczak Approve
Review via email: mp+311074@code.launchpad.net

Commit message

Fix potential upstart job race between lightdm and keep-display-on-during-boot (LP: #1642360)

If lightdm happens to start before keep-display-on-during-boot, then keep-display-on-during-boot will never receive the "started lightdm" event, and will therefore never release the display-on lock.

This MP ensures that the keep-display-on-during-boot job does not acquire a display-on lock if lightdm is already running, thus avoiding the scenario described above.

Description of the change

Fix potential upstart job race between lightdm and keep-display-on-during-boot (LP: #1642360)

If lightdm happens to start before keep-display-on-during-boot, then keep-display-on-during-boot will never receive the "started lightdm" event, and will therefore never release the display-on lock.

This MP ensures that the keep-display-on-during-boot job does not acquire a display-on lock if lightdm is already running, thus avoiding the scenario described above.

To post a comment you must log in.
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I tried to reproduce this using the suggestion in the linked bug report but could not manage to.
I added this to /etc/init/repowerd.conf

pre-start script
    sleep 30
end script

but the screen still turned off. I tried on both rc and rc-proposed

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> I tried to reproduce this using the suggestion in the linked bug report but could not manage to.

Pat, do you mean that you cannot reproduce the issue without the fix applied, or that you can't reproduce it with the fix applied (i.e. that the fix works)?

I just tried this (added the pre-start script to repowerd.conf) on a freshly flashed krillin with rc-proposed/bq-aquaris.en, and I am able to reproduce the problem easily.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Ok, too bad we have to use such measures to make sure this is not executed when lightdm is running already. But in overall, +1.

review: Approve
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I had a bad conf file, reproduced the issue and saw the fix resolve it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'keep-display-on-during-boot.conf'
2--- keep-display-on-during-boot.conf 2016-10-07 12:20:58 +0000
3+++ keep-display-on-during-boot.conf 2016-11-16 20:58:32 +0000
4@@ -13,4 +13,11 @@
5 start on started repowerd
6 stop on started lightdm
7
8+pre-start script
9+ if status lightdm | grep running;
10+ then
11+ stop; exit 0
12+ fi
13+end script
14+
15 exec repowerd-cli display on

Subscribers

People subscribed via source and target branches