hi,
my system is a Linux (5.10.83) with SystemD (249.7) and Qemu (6.1.0) and I've a poor small Bash script:
#!/usr/bin/bash
systemd-cat -p warning <<< "script running..."
qemu-nbd -r -s -f raw -c /dev/nbd0 /dev/sdb |& systemd-cat -p warning
after loading nbd module, if I plug a blank disk (/dev/sdb with no partition) and call the script (as root) then all is ok and my disk is accessible via /dev/nbd0.
after rebooting and reloading nbd module, I install a Udev rule that calls my script when a device is added to the system, plug the disk and observe the system events with journalctl -f.
the script is called (eg. script running...) and /dev/nbd0 seems to be linked with /dev/sdb but 2 seconds later, the message kernel: block nbd0: shutting down sockets appears and /dev/nbd0 becomes unreachable.
where can the problem come from ?
regards, lacsaP.