Refactor the negotiate() and connected functions
[nbd.git] / systemd / nbd@.service.sh.in
blob3794010fc6ad958e2f5938f73f681410295bbcb4
1 #!/bin/sh
3 prefix=@prefix@
4 exec_prefix=@exec_prefix@
5 sysconfdir=@sysconfdir@
7 cat <<EOF
8 [Unit]
9 Description=NBD client connection for %i
10 Documentation=man:nbd-client
11 PartOf=nbd.service
12 Before=dev-%i.device
13 After=network-online.target
14 Conflicts=shutdown.target
15 DefaultDependencies=no
16 [Service]
17 Type=oneshot
18 RemainAfterExit=yes
19 ExecStart=@sbindir@/nbd-client %i
20 ExecStop=@sbindir@/nbd-client -d /dev/%i
21 [Install]
22 RequiredBy=dev-%i.device
23 RequiredBy=dev-%ip1.device
24 RequiredBy=dev-%ip2.device
25 RequiredBy=dev-%ip3.device
26 RequiredBy=dev-%ip4.device
27 RequiredBy=dev-%ip5.device
28 RequiredBy=dev-%ip6.device
29 RequiredBy=dev-%ip7.device
30 RequiredBy=dev-%ip8.device
31 RequiredBy=dev-%ip9.device
32 RequiredBy=dev-%ip10.device
33 RequiredBy=dev-%ip11.device
34 RequiredBy=dev-%ip12.device
35 RequiredBy=dev-%ip13.device
36 RequiredBy=dev-%ip14.device
37 RequiredBy=dev-%ip15.device
38 EOF