Action

Bind-mounts a into the unit’s namespace

Supported mount types

  • Directory
  • Normal file
  • A device node
  • AF_UNIX socket
  • A named pipe/FIFO

Options

--read-only

Purpose

Mount the bind in a manner where changes cannot be made to the source.

Example

Bind /dev/null over /etc/issue so that the file will always empty to the unit.

systemctl bind --read-only bindable.service /dev/null /etc/issue

--mkdir

Purpose

Create the destination path that the bind will mount to, if not present.

Example

Make the destination path

systemctl bind --mkdir bindable.service