I'm running nbd-server
on Debian (nbd-server
package) with my config at /etc/nbd-server/config
, but then I might change the config and need to reload. How can I do that?
man nbd-server
has nothing on this
All I can use is kill PID
and killall nbd-server
to stop or restart it. There must be a command like nbd-server --reload
or somehting.
What is the right way to do this to reload the ndb-server
config after making changes?
What is the right way to stop the nbd-server
if I don't want it running anymore?
In my version of the
nbd-server
man page, it says in the "DESCRIPTION" section:You can see this online here.
You can send SIGHUP to
nbd-server
using thekill
command:You can try signalling it by name, using either
killall
orpkill
...Or:
...but note that there is an additional
nbd-server
process for every active connection, and I'm not sure how these processes respond to SIGHUP. A better option is just to configure a systemd unit for the service and then usesystemctl reload nbd-server
, and let systemd worry about keeping track of the main pid.Update: It looks like the version of nbd-server in Debian stable (3.24) is buggy. Sending
SIGHUP
to the nbd-server process causes it to fail with aninvalid pointer
error:If you upgrade to the version in
sid
(3.26.1), it behaves as expected: sending SIGHUP to the process causes it to load any new configuration files, but does not impact existing clients. The server continues to run instead of crashing.