I'm trying to create an udev rule for when an usb device is plugged in to call a bash script that uses pulseaudio to load a module. The udev rule triggers when the USB is plugged in and I can load the module if I run the script manually but when I try to run the script with udev I usually get a message from pulseaudio saying "module load failed". If I run udevd in debug mode, however, it occasionally works. I'm looking for some suggestions on how this could be and where I should look to fix it. I've tried changing the udev rule number (95,99) and adding a delay of up to 60 seconds before the script runs, neither helped. Thanks.