Le 11/06/2025 à 19:29, Gilles BULOZ a écrit : > Sorry for overhead, but I'm unable to find any answer to this question. > > I use a diskless board that is booted from a PXE server and is mounting its > rootfs from an iSCSI target on this server running tgtd. OS is Fedora 41. > > The problem is that on diskless shutdown/reboot, the rootfs is cleanly unmounted > but no session logout is sent to the server. So at next diskles boot, another > session is created but the old one is still there. As a workaround I can manually > delete these old sessions by running something like this on the server : > tgtadm --op delete --mode conn --tid x --sid y --cid z > I've found another workaround for that that is to run a logout from a script that > is run by the diskless board near the end of its shutdown. > > But the issue is still there is the diskless is brutally reset or power-cycled > (occurs very often in the embedded world) because of no session logout. > > I'm wondering why a session from the same initiator to the same target could not > automatically delete older sessions. > I'm still wondering that > > Also I'm wondering if there's some sort of timeout to enable to have old > sessions automatically deleted if the connection to the initiator is broken. > In fact there's already a timeout set to ~1 hour. In the worst case, if I do boot/reboot loops and depending of the boot/reboot speed I end up with ~45 sessions but this seems not to cause any issue. > > Should I really care about these old sessions or do with them ? The problem is > see with them is that stopping tgtd from a command or shutting down the server > hangs for ~40s seconds because of these old sessions. > A workaround for the ~40s delay when stopping tftd is to add "TimeoutStopSec=3" to /usr/lib/systemd/system/tgtd.service so that systemd only waits for 3 seconds after the attempt to kill tgtd cleanly before killing it more brutally but successfully. > > Thanks for your answers > > Gilles Buloz > Kontron Modular Computers >