[systemd-devel] Failed to start Container: minus sign is replaced to slash in container name

Stefan Schweter stefan at schweter.it
Sun Jan 17 13:40:23 PST 2016



Am 12.01.2016 um 21:43 schrieb Lennart Poettering:
> On Tue, 12.01.16 21:23, Stefan Schweter (stefan at schweter.it) wrote:
> 
>> Dear systemd-users,
>>
>> e.g. when a container name includes a minus sign like:
>>
>> ls -l /var/lib/machines
>> insgesamt 4
>> drwxr-xr-x 22 root root 4096 12. Jan 21:14 host.cis.uni-muenchen.de
>>
>> Enabling the systemd-nspawn service with:
>>
>> systemctl enable systemd-nspawn at host.cis.uni-muenchen.de
>> Created symlink from
>> /etc/systemd/system/machines.target.wants/systemd-nspawn at host.cis.uni-muenchen.de.service
>> to /usr/lib/systemd/system/systemd-nspawn at .service.
> 
> Yeah, the way systemd encodes slashes in unit names is by converting
> them to dots. Thus when you actually want a dash you need to escape
> it. The tool systemd-escape can help you with getting this right from
> shell scripts. See the last example in the systemd-escape(1) man page
> For details.
> 

Hi Lennart,

thanks for your explanation. I tried registering the container with the
machinectl command and enabling + starting the container works without
any problems!

Thanks again + regards,

Stefan


More information about the systemd-devel mailing list