mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-09-19 09:51:28 +08:00
Co-authored-by: Managor <42655600+Managor@users.noreply.github.com>
952 B
952 B
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}}