[systemd-devel] restricting systemd user services by hostname

Mike Gulick mike.gulick at mathworks.com
Wed Jan 4 22:16:19 UTC 2017


On 01/04/2017 04:36 PM, Mantas Mikulėnas wrote:
> systemd.unit documents ConditionHost=, which can match either by 
> hostname or by machine-id for exactly this situation.
>
> There is also the (slightly horrible) 
> ConditionPathExists=/var/lib/systemd/linger/%u.
>
Thanks!  Can't believe I missed that in my searching. ConditionHost= 
meets my needs and seems cleaner, although that is a nice suggestion 
about ConditionPathExists, since it avoids the need to hard-code a 
hostname in the service file.

-Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170104/ced68d83/attachment-0001.html>


More information about the systemd-devel mailing list