mirror of
https://codeberg.org/icewind/cube.git
synced 2026-06-04 04:24:08 +02:00
initial version
This commit is contained in:
commit
a77d5b719e
7 changed files with 373 additions and 0 deletions
39
README.md
Normal file
39
README.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# NBS
|
||||
|
||||
NBD Block Server
|
||||
|
||||
## What
|
||||
|
||||
A basic NBD block server with a single gimmick.
|
||||
|
||||
## Why
|
||||
|
||||
The main reason for using this over any other NBD server is its ability to reload the config without affecting any existing connection.
|
||||
|
||||
This allows for booting a device off an NBD device and changing the export configuration to point to a new root image. Without affecting the booted devices.
|
||||
Then, when the device is rebooted, it will connect to the new root image.
|
||||
|
||||
## How
|
||||
|
||||
Create a config file `config.toml`
|
||||
|
||||
```toml
|
||||
[listen]
|
||||
port = 10809
|
||||
|
||||
[exports]
|
||||
main = { path = "./src/main.rs", readonly = true }
|
||||
block = "/tmp/block.bin"
|
||||
```
|
||||
|
||||
Run the server with
|
||||
|
||||
```bash
|
||||
nbs -c config.toml
|
||||
```
|
||||
|
||||
When the configuration is changed, it can be reloaded by sending `SIGHUP` to the server.
|
||||
|
||||
```bash
|
||||
pkill -sighup nbs
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue