Skip to content

Commit f027649

Browse files
systemctl-bind: add page (#18153)
Co-authored-by: Managor <[email protected]>
1 parent 50d0f72 commit f027649

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pages/linux/systemctl-bind.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# systemctl bind
2+
3+
> Ephemerally bind-mount a file or directory from the host into a unit's mount namespace.
4+
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html#%0A%20%20%20%20%20%20%20%20%20%20%20%20bind%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT%0A%20%20%20%20%20%20%20%20%20%20%20%20PATH%0A%20%20%20%20%20%20%20%20%20%20%20%20%5BPATH%5D%0A%20%20%20%20%20%20%20%20%20%20>.
5+
6+
- Bind-mount a host path into the same location inside the unit:
7+
8+
`systemctl bind {{unit}} /{{path/to/host_directory}}`
9+
10+
- Bind-mount a host path into a different location inside the unit:
11+
12+
`systemctl bind {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}`
13+
14+
- Bind-mount a path as read-only inside the unit:
15+
16+
`systemctl bind --read-only {{unit}} /{{path/to/host_directory}}`
17+
18+
- Create the destination path inside the unit before binding:
19+
20+
`systemctl bind --mkdir {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}`

0 commit comments

Comments
 (0)