I'm having an issue with a script that seems really weird; it appears to stop executing prematurely when run from udev, but not when I run it manually from the command line. I've tried troubleshooting it with the
set -x and when I run it from the command line everything gets executed as expected. However, when it gets run from udev, it stops prematurely after a certain point.
Part of the issue, I think, is that it's hard to debug the script when it's run by udev. I've tried putting in
logger statements, but they basically just tell me the same thing (it stops prematurely).
Do you see anything that pops out that would be causing this issue?
The script(s) can be found here. One note about them, they are intended for an embedded system. When run manually from the command line, the command I run is:
./product.sh -b update /dev/sda1
The udev rule that runs the script is:
ACTION=="add", KERNEL=="sd?1", RUN+="/usr/sbin/product.sh -b update /dev/%k"
The script appears to stop at lines 195 or 197 in
product.sh. I've noticed that if I comment out lines 22 and 28 in
product-manifest.sh everything runs as expected when run by udev and manually on command line.