lava-dispatcher appears to require root permissions (not documented)

Bug #1070309 reported by Paul Sokolovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LAVA Dispatcher
Fix Released
Low
Antonio Terceiro

Bug Description

lava-dispatcher uses sudo to execute shell commands, e.g.:

def image_partition_mounted(image_file, partno):
...
    mount_cmd = "sudo mount -o loop,offset=%s %s %s" % (offset, image, mntdir)
...

However, once that partition is mounted, it tries to access it with direct file access calls, e.g.:

    def _customize_ubuntu(self, rootdir):
        self.deployment_data = Target.ubuntu_deployment_data
        with open('%s/root/.bashrc' % rootdir, 'a') as f:
            f.write('export PS1="%s"\n' % self.deployment_data['TESTER_PS1'])

of course, that files, as that file in mounted partition is not accessible to normal user, but requires root privs.

So:
1. There appears to be some machinery to allow lava-dispatcher to run as non-root user, but it's incomplete.
2. Current docs as present at http://lava-dispatcher.readthedocs.org/en/latest/ don't document root requirement.

Point 2 apparently would the easiest way to fix this. Longer term, it probably would be nice to complete non-root support though, given that there're already partial measures for that.

Tags: docs

Related branches

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

Well I actually went for fixing #1, as my first patch to LAVA: https://code.launchpad.net/~pfalcon/lava-dispatcher/run-as-non-root/+merge/131051

Changed in lava-dispatcher:
status: New → In Progress
Revision history for this message
Alan Bennett (akbennett) wrote :

Please review the current documentation and add necessary information.

Changed in lava-dispatcher:
assignee: nobody → Paul Sokolovsky (pfalcon)
Changed in lava-dispatcher:
importance: Undecided → Low
tags: added: docs
Revision history for this message
Dave Pigott (dpigott) wrote :

Do a test for being root at start of lava-dispatch and fail if not

Changed in lava-dispatcher:
assignee: Paul Sokolovsky (pfalcon) → Antonio Terceiro (terceiro)
Changed in lava-dispatcher:
status: In Progress → Fix Committed
Changed in lava-dispatcher:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.