[systemd-devel] Portable service and bind paths
Claes H
claesatwork at gmail.com
Sun Jan 5 00:46:28 UTC 2020
Hi,
I am experimenting with a portable service for Home Assistant. I think
embedding it as a portable service would be a good way to isolate its
quite extensive dependencies.
But I would like to bind mount a directory on the host into the
service and I can't figure it out.
The portable service file looks like below but the bind path does not
seem to take effect.
Is this maybe the wrong way to go? I am able to bind mount it if I
start using a regular service, that calls systemd-nspawn (like
ExecStart=/usr/bin/systemd-nspawn -M homeassistant /srv/homeassistant/bin/hass
) and has a corresponding .nspawn file with Bind attribute.
I also read in the documentation that .nspawn files are not among the
unit fies copied out from the image. What is the recommended way to go
about with this for a portable service?
best regards,
Claes
[Unit]
Description=Home Assistant (portable service)
After=network-online.target
[Service]
Type=simple
ExecStart=/srv/homeassistant/bin/hass
Restart=on-failure
RestartSec=5s
BindPaths=/home/claes/projects/homeassistant/configuration-.homeassistant:/home/homeassistant/.homeassistant
[Install]
WantedBy=multi-user.target
--
C l a e s H o l m e r s o n
More information about the systemd-devel
mailing list