You are not logged in.

#1 2021-09-15 08:35:02

Blutkoete
Member
Registered: 2019-12-01
Posts: 6

[SOLVED] Launch services depending on which kernel is running

Is it possible to configure systemd in a way that it launches specific services only if a specific kernel is running?

Background is that I'd like SDDM to not launch when I'm booting into linux-rt and currently I'm solving that by disabling and reenabling it manually which doesn't feel right.

Last edited by Blutkoete (2021-09-16 21:28:26)

Offline

#2 2021-09-15 08:41:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,376

Re: [SOLVED] Launch services depending on which kernel is running

I've recently done this for cpupower and switching the default governor depending on kernel version. Systemd provides the ConditionKernelVersion= check you can use to identify whether a service should run or not based on the kernel version number.

In my example I've created a drop-in for the cpupower systemd service and only run it when "ConditionKernelVersion=*ck*" for the CK kernel.

You'd do the same for SDDM. As you want to negate this you'll probably need to use ConditionKernelVersion=!*rt* or so

Last edited by V1del (2021-09-15 08:49:15)

Offline

#3 2021-09-16 21:28:09

Blutkoete
Member
Registered: 2019-12-01
Posts: 6

Re: [SOLVED] Launch services depending on which kernel is running

Thank you, worked like a charm.

Offline

Board footer

Powered by FluxBB