[systemd-devel] Antw: [EXT] Re: Bare Metal or VM

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Mon Jul 19 06:15:33 UTC 2021


>>> Ed Greshko <ed.greshko at greshko.com> schrieb am 17.07.2021 um 06:56 in Nachricht
<e0f645e2-c0e1-fab3-a8df-9d8c55d856be at greshko.com>:
> On 17/07/2021 12:49, Andrei Borzenkov wrote:
>> 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.
> 
> Yes. After knowing what it was called I found it.  I blame my 67 years old 
> eyes and feeling
> bad after Moderna shot.

I guess the real problem is that you don't know where to look first:
# man -k systemd |wc -l
158
(systemd-234 of SLES 15 SP2)

> 
> I have tested it in my use case and that is exactly what I needed.
> 
> Thanks Very Much!
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org 
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel 






More information about the systemd-devel mailing list