mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-16 19:49:20 +00:00
Update cheatsheets
This commit is contained in:
25
tldr/linux/systemctl-bind
Normal file
25
tldr/linux/systemctl-bind
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# systemctl bind
|
||||
|
||||
> Ephemerally bind-mount a file or directory from the host into a unit's mount namespace.
|
||||
> 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>.
|
||||
|
||||
- Bind-mount a host path into the same location inside the unit:
|
||||
|
||||
`systemctl bind {{unit}} /{{path/to/host_directory}}`
|
||||
|
||||
- Bind-mount a host path into a different location inside the unit:
|
||||
|
||||
`systemctl bind {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}`
|
||||
|
||||
- Bind-mount a path as read-only inside the unit:
|
||||
|
||||
`systemctl bind --read-only {{unit}} /{{path/to/host_directory}}`
|
||||
|
||||
- Create the destination path inside the unit before binding:
|
||||
|
||||
`systemctl bind --mkdir {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}`
|
||||
Reference in New Issue
Block a user