[systemd-devel] Bare Metal or VM
Andrei Borzenkov
arvidjaar at gmail.com
Sat Jul 17 04:49:21 UTC 2021
On 17.07.2021 03:36, Ed Greshko wrote:
> Hi,
>
> This may be an "uninformed" question since I've not done much with systemd.
>
> Is there a way for a service or unit to be aware if the environment is
> Bare Metal or a Virtual Machine.
>
> For example, a unit is triggered by a user logging in as a graphical
> user. But, I only want the unit's
> ExecStart to be processed if the environment is a qemu VM. I'd rather
> not have the process started on
> Bare Metal since it would be unused.
>
See ConditionVirtualization directive in man systemd.unit.
More information about the systemd-devel
mailing list