Bug 183371 - race condition between USB device creation and hal callouts
race condition between USB device creation and hal callouts
Product: Fedora
Classification: Fedora
Component: hal (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Zeuthen
Depends On:
Blocks: FC6Target
  Show dependency treegraph
Reported: 2006-02-28 13:07 EST by Kostas Georgiou
Modified: 2013-03-05 22:45 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-03-19 12:12:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Looping (1.20 MB, application/x-redhat-package-manager)
2006-03-02 17:20 EST, Ray Strode [halfline]
no flags Details

  None (edit)
Description Kostas Georgiou 2006-02-28 13:07:28 EST
The "chown $console_user /dev/bus/usb/$bus_num/$dev_num" line in
/usr/libexec/gphoto-set-procperm fails with 
chown: cannot access `/dev/bus/usb/002/018': No such file or directory

A small delay before the chown command seems to fix the problem so it seems
like the script is run before(during?) the device creation, it either needs
to be called after the device has been created or it needs to spin for a while
if the device isn't there yet (probably a bad idea).
Comment 1 Jesse Barnes 2006-03-01 16:01:22 EST
FWIW, adding a delay before the chown doesn't help in my case.  The selinux  
trace in 180751 indicates that there might be a policy problem with  
gphoto-set-procperm.  Maybe we're chasing two bugs for this problem? 
Comment 2 John (J5) Palmieri 2006-03-01 16:11:33 EST
There should not be a race.  Looks like se-linux is preventing
/usr/libexec/gphoto-set-procperm from accessing /dev/bus/usb/.  
Comment 3 Jesse Barnes 2006-03-01 16:20:52 EST
How does that explain what Kostas is seeing then?  In my case, selinux is 
enabled so gphoto-set-procperm might be getting stopped from doing its job.  
In his case though, adding a delay made the script set the permissions 
correctly.  That must mean he has selinux disabled and still sees a problem? 
Comment 4 John (J5) Palmieri 2006-03-01 16:48:06 EST
Bringing back to HAL.  Davidz says it is a kernel issue with HAL.
Comment 5 Kostas Georgiou 2006-03-01 17:25:09 EST
I am running with:
so selinux isn't involved.

I was running 1977_FC5 at the time so I just had a test with 1996_FC5 and the
first try worked and the next 5 failed :(

Let me know if you need more debug information.
Comment 6 Ray Strode [halfline] 2006-03-02 17:20:17 EST
Created attachment 125570 [details]

Hi Kostas,
The above package works around the HAL/kernel issue by spinning as suggested.
Can you verify that it does work around your problem?
Comment 7 Kostas Georgiou 2006-03-02 17:36:07 EST
Yes it seems fine, note that since I am in x86_64 system I just grabbed
gphoto-set-procperm from the rpm so if there are other changes they aren't tested.

I am not sure you need to spin around /proc/bus/usb/$bus_num/$dev_num since the
chown was always succesful in my system but it's not going to hurt either.
Comment 8 David Zeuthen 2006-03-02 17:50:32 EST
Comment 6: This is not really the right solution. Will comment more tomorrow, am
busy all night, sorry.
Comment 9 Ray Strode [halfline] 2006-03-03 18:15:52 EST
Yes, it's obviously not the *right* solution, but I guess a better question, is
whether it's a *good enough* solution given that FC5 freezes on monday.
Comment 10 Ray Strode [halfline] 2006-03-07 11:30:42 EST
moving off fc5 blocker since we have a workaround in place now.
Comment 11 Asko Tontti 2006-03-11 11:58:21 EST
I'm also seeing problems with my digital camera with rawhide (2006-03-11) and
kernel 2.6.15-1.2032_FC5.

Ray Strode, should we open a new bug about SELinux preventing
gphoto-set-procperm for doing its job? I couldn't find an open bug that
discusses only gphoto2 vs. SELinux case which seems to be cause of my problems.
Comment 12 Kostas Georgiou 2007-03-18 14:22:32 EDT
It's been a year without an update, is the workaround still needed? 
Comment 13 David Zeuthen 2007-03-19 12:12:58 EDT
This is fixed in Rawhide with latest HAL packages that manages permissions.

Note You need to log in before you can comment on or make changes to this bug.