Checkbox on Kubuntu stalls when gathering information
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox |
Fix Released
|
Undecided
|
Marc Tardif | ||
checkbox (Ubuntu) |
Fix Released
|
Undecided
|
Marc Tardif | ||
Lucid |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The impact of this bug is that checkbox stalls forever when attempting to gather system information on Kubuntu. This fix changes the way that kdesudo is called in order to successfully pass the PATH information in the environment.
When running Checkbox on Kubuntu, the application seems to stall forever when attempting to gather information from the system. The reason is that the backend is started during this process which calls upon kdesudo. The backend_info plugin assumes that kdesudo can take environment variables as part of the option:
kdesudo -- PATH=/foo command
However, it seems that kdesudo calls the argument with execv instead of the shell, so environment variables cannot be given this way.
Related branches
- Mathias Gug: Needs Fixing
-
Diff: 822 lines (+253/-247)20 files modifiedbackend (+12/-3)
checkbox/job.py (+1/-1)
checkbox/resource.py (+3/-2)
checkbox/user_interface.py (+7/-2)
debian/changelog (+17/-0)
debian/control (+1/-0)
jobs/disk.txt.in (+1/-2)
jobs/local.txt.in (+1/-1)
jobs/resource.txt.in (+1/-0)
plugins/backend_info.py (+15/-17)
plugins/begin_prompt.py (+33/-0)
plugins/launchpad_exchange.py (+2/-1)
plugins/persist_info.py (+2/-2)
po/checkbox.pot (+10/-10)
scripts/ansi_parser (+2/-1)
scripts/device_list (+0/-168)
scripts/disk_test (+0/-33)
scripts/run_templates (+142/-0)
scripts/suspend_test (+2/-3)
scripts/udev_resource (+1/-1)
- Stéphane Graber: Approve
-
Diff: 807 lines (+250/-246)19 files modifiedbackend (+12/-3)
checkbox/job.py (+1/-1)
checkbox/resource.py (+3/-2)
checkbox/user_interface.py (+7/-2)
debian/changelog (+16/-0)
debian/control (+1/-0)
jobs/disk.txt.in (+1/-2)
jobs/local.txt.in (+1/-1)
jobs/resource.txt.in (+1/-0)
plugins/backend_info.py (+15/-17)
plugins/begin_prompt.py (+33/-0)
plugins/launchpad_exchange.py (+2/-1)
plugins/persist_info.py (+2/-2)
po/checkbox.pot (+10/-10)
scripts/device_list (+0/-168)
scripts/disk_test (+0/-33)
scripts/run_templates (+142/-0)
scripts/suspend_test (+2/-3)
scripts/udev_resource (+1/-1)
Changed in checkbox: | |
assignee: | nobody → Marc Tardif (cr3) |
status: | New → Confirmed |
Changed in checkbox: | |
status: | Confirmed → Fix Committed |
Changed in checkbox: | |
status: | Fix Committed → Fix Released |
Changed in checkbox (Ubuntu Lucid): | |
milestone: | none → lucid-updates |
Changed in checkbox (Ubuntu): | |
status: | New → Fix Released |
assignee: | nobody → Marc Tardif (cr3) |
Changed in checkbox (Ubuntu Lucid): | |
status: | New → In Progress |
description: | updated |
Hello, the following information should complete this bug as a valid SRU report, to hopefully upload this fix to Lucid.
Further discussion of the problem:
The command used to invoke the backend will be of the form:
kdesudo -- PATH=/usr/ share/checkbox/ scripts: /usr/local/ sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin:/usr/ games /usr/share/ checkbox/ backend
kdesudo absolutely can't handle the environment variable so if this command is invoked by hand, it simply exits without invoking the backend.
When this happens, the frontend just hangs there, waiting for the backend to start and respond to control messages. This obviously never happens and the frontend will stall forever.
Solution:
Checkbox revision 787 works around this problem by adding a --path parameter on the superprivileged backend. The backend then adds the given path to its own environment, in substitution of passing the PATH environment variable which kdesudo can't handle.
The backend_info plugin takes its own $PATH and passes it, via --path, to the backend when spawning it. This way, even under kdesudo, we ensure that the backend will have the correct path, all while avoiding confusing kdesudo with the PATH variable before the command to execute.
TEST CASE:
1- Boot a Kubuntu 10.04 LiveCD choosing "Try Kubuntu without installing"
2- Open konsole and install checkbox:
sudo apt-get update; sudo apt-get install checkbox-gtk
3- Launch checkbox-gtk from the terminal
4- When it gets to the "Gathering information from your system" it stays there forever, as the frontend is waiting for the backend to start and open the communication pipes (which never happens as the backend fails to start).
5- Additional verification is to ps wwuxa |grep backend and confirm that the backend process is not present.
Regression potential:
The new code is just passing the contents of $PATH (which coming from the environment should already be properly formatted) to the backend (handling it through Python's options module so it should also be quite resilient). Thus the new code doesn't look like it could introduce potential problems; An empty $PATH would result in a lot of failed tests (as the backend might fail to find commands to run) and a malformed $PATH would have given problems with the old version as well. Given that the original behavior was "doesn't work at all", chances for a regression are almost nil.