Merge lp:~sil2100/otto/autopilot_add_setup_upstart_job into lp:otto/autopilot

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 38
Proposed branch: lp:~sil2100/otto/autopilot_add_setup_upstart_job
Merge into: lp:otto/autopilot
Diff against target: 19 lines (+15/-0)
1 file modified
target-override/etc/init/otto-autopilot-setup.conf (+15/-0)
To merge this branch: bzr merge lp:~sil2100/otto/autopilot_add_setup_upstart_job
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Francis Ginther Approve
Review via email: mp+171075@code.launchpad.net

Description of the change

Add the otto-autopilot-setup.conf upstart job for configuring autopilot users correctly. It seems that python-autopilot prepares the autopilot group, but it only adds the currently logged in user (we don't have that). So, to fix permissions, we need to add ubuntu to autopilot automatically. Otherwise, /dev/uinput is inaccessible.

To post a comment you must log in.
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for you work, I have a few comments though:
1. env DEBIAN_FRONTEND=noninteractive is useless because the job doesn't install any package, but it doesn't hurt.
2. There is no error handling around usermod call. Since this job will run on every boot it is possible that the user is already a member of this group and the job will fail. You should at least test for group membership.
3. The function "exit_job" doesn't exit, you can just remove that line

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

Thanks! Fixing!

39. By Łukasz Zemczak

Remove unnecessary elements

40. By Łukasz Zemczak

Add a check for existence of autopilot and ubuntu

41. By Łukasz Zemczak

Final improvements (I hope)

Revision history for this message
Francis Ginther (fginther) wrote :

Looks like it should work.

review: Approve
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for this patch. Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'target-override/etc/init/otto-autopilot-setup.conf'
--- target-override/etc/init/otto-autopilot-setup.conf 1970-01-01 00:00:00 +0000
+++ target-override/etc/init/otto-autopilot-setup.conf 2013-06-24 16:48:31 +0000
@@ -0,0 +1,15 @@
1description "Setup evnivonment specific to the autopilot jobs for otto"
2author "Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>"
3
4start on (starting lightdm and stopped otto-setup)
5
6pre-start script
7 # Add the ubuntu user to the autopilot group, as only the autopilot group
8 # has the required permissions to access /dev/uinput
9
10 if getent group autopilot >/dev/null && getent passwd ubuntu >/dev/null; then
11 echo "Adding the ubuntu user to the autopilot group"
12 usermod -a -G autopilot ubuntu
13 fi
14
15end script

Subscribers

People subscribed via source and target branches