I need to log output from /dev/ttyUSB0
. This is how I start the start-log script on a connection
pi@raspberrypi:/etc/udev/rules.d $ cat 50-text-log.rules
ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", RUN+="/bin/bash /scripts/start-log"
all it essentially does is cat /dev/ttyUSB0 > somefile
, besides figuring out the path in /dev
but it will result into this message from service udev status
raspberrypi systemd-udevd[4990]: Spawned process '/bin/bash /scripts/start-log' [5018] is taking longer than 59s to complete
I have tried this: How to run long time process on Udev event?
By doing a double fork it already stops after 8 seconds, making it even worse. Changing the cgroup like this: echo $$ >> /sys/fs/cgroup/cpu/tasks
(tried to repllicate what was described in the link above in bash) does not change a thing, still exists after 8 seconds.
How can I start a script that may run forever when my USB device connects?
Or how can this be done with a .device file in /etc/systemd/system
("device unit")? There is so little information on this.
at now
. – Apr 22 '20 at 16:46at now
because this is ridiculous – sezanzeb Apr 22 '20 at 17:35