qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kernel: block nbd0: shutting down sockets


From: Pascal
Subject: Re: kernel: block nbd0: shutting down sockets
Date: Fri, 20 May 2022 14:01:21 +0200

I activated auditd and asked it to monitor /var/lock/qemu-nbd-nbd0 and here is the result :

audit[1754]: SYSCALL arch=c000003e syscall=49 success=yes exit=0 a0=3 a1=7ffe6a0075f0 a2=6e a3=7ffe6a0075e0 items=2 ppid=1752 pid=1754 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=qemu-nbd exe=/usr/bin/qemu-nbd key=(null)
audit: SOCKADDR saddr=01002F7661722F6C6F636B2F71656D752D6E62642D6E62643000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
audit: CWD cwd=/
audit: PATH item=0 name=/var/lock/ inode=570 dev=00:16 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=PARENT cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
audit: PATH item=1 name=/var/lock/qemu-nbd-nbd0 inode=1371 dev=00:16 mode=0140755 ouid=0 ogid=0 rdev=00:00 nametype=CREATE cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
audit: PROCTITLE proctitle=71656D752D6E6264002D72002D73002D6600726177002D63002F6465762F6E626430002F6465762F736462
kernel: block nbd0: shutting down sockets

the socket is well created and left in place while the qemu-nbd process gets killed.
nothing else appears about nbd after the kernel message.

regards, lascaP.

Le jeu. 19 mai 2022 à 17:09, Eric Blake <eblake@redhat.com> a écrit :
On Thu, May 19, 2022 at 04:40:27PM +0200, Pascal wrote:
> 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 ?

git grep 'shutting down sockets'

does not have any hits in qemu.git, so the message is coming from the
kernel module, and not from the qemu-nbd side of things.  Is the
qemu-nbd process still alive when you see the error message?  Could it
be a permissions issue, where running your script via a udev rule
creates sockets with different permissions than when running the
script as root, such that the qemu-nbd process is locked out of access
to sockets needed to drive the kernel module?

Can you add a --trace parameter to qemu-nbd to cause it to log more
details about what is going on?

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]