Skip to content

Instantly share code, notes, and snippets.

@astoeckel
Last active November 16, 2020 07:44
Show Gist options
  • Save astoeckel/2f5483d8ffcc772a4810c81369732516 to your computer and use it in GitHub Desktop.
Save astoeckel/2f5483d8ffcc772a4810c81369732516 to your computer and use it in GitHub Desktop.
nbdkit systemd socket and service file
# nbdkit.service
[Unit]
Description=nbdkit Service
After=nbdkit.socket
Requires=nbdkit.socket
[Service]
Environment="LD_LIBRARY_PATH=/opt/nbdkit/lib64"
Environment="TMPDIR=/var/lib/nbdkit/cache/"
User=nbdkit
ExecStart=/opt/nbdkit/sbin/nbdkit -f \
--filter retry \
ssh \
host=ctnsrv-storage.uwaterloo.ca \
user=ctnuser \
path=/home/ctnuser/data/ctngpu2.raw \
timeout=10 \
retries=10
# nbdkit.socket
[Unit]
Description=NBDKit Network Block Device server
[Socket]
ListenStream=10809
[Install]
WantedBy=sockets.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment