FS#60881 - [ndb] nbd@.service enters reboot loop
Attached to Project:
Community Packages
Opened by Dan Anderson (mxork) - Wednesday, 21 November 2018, 16:44 GMT
Last edited by Toolybird (Toolybird) - Friday, 19 May 2023, 22:41 GMT
Opened by Dan Anderson (mxork) - Wednesday, 21 November 2018, 16:44 GMT
Last edited by Toolybird (Toolybird) - Friday, 19 May 2023, 22:41 GMT
|
Details
Description:
With nbd@nbd0.service enabled and an nbd0 mount configured in nbdtab, the nbd@nbd0 enters a reboot loop: Nov 21 11:06:16 localhost nbd-client[351]: Connected /dev/nbd0 ... Nov 21 11:28:21 localhost systemd[1]: Starting NBD client connection for nbd0... Nov 21 11:28:21 localhost nbd-client[341]: Negotiation: ..size = 32768MB Nov 21 11:28:21 localhost systemd[1]: nbd@nbd0.service: Control process exited, code=exited status=1 Nov 21 11:28:21 localhost nbd-client[341]: Error: Failed to setup device, check dmesg Nov 21 11:28:21 localhost nbd-client[341]: Exiting. Nov 21 11:28:21 localhost nbd_client[341]: Failed to setup device, check dmesg Nov 21 11:28:21 localhost systemd[1]: nbd@nbd0.service: Failed with result 'exit-code'. Nov 21 11:28:21 localhost nbd_client[341]: Exiting. Nov 21 11:28:21 localhost systemd[1]: Failed to start NBD client connection for nbd0. Following the advice and checking dmesg shows that /dev/nbd0 was already mounted: [ 348.619470] nbd: nbd0 already in use /dev/nbd0 is properly loaded, partitions and everything, so nbd@.service is failed on a successful mount. I suspect this is due to `Type=forking` and nbd not presenting a PIDFile to track the process, but I'm not sure. A quick and dirty workaround is to set ExecStart=/usr/bin/sh -c 'nbd-client -c %i || nbd-client %i', which isn't perfect, but does converge. Additional info: * nbd 3.18-1 Steps to reproduce: 0. configure an nbd server instance exposing MOUNT 1. on client machine, add MOUNT to /etc/nbdtab, binding to nbd0 2. enable nbd@nbd0 3. reboot |
This task depends upon
Honestly, this would be easier with a darn PIDFile from nbd-client, but pretty sure we could hack it good with a shell wrapper and using `nbd-client -persist` instead of Restart=OnFailure, and an `nbd-client -check` for Notify/Watchdog.