On 11 February 2018 at 13:47, Giacomo Longo via arch-general <[email protected]> wrote: > So you want to have > > vboxadd-service and vboxadd systemd services not starting on Linux kernel > versions 4.15 and above? > > You can manage this by creating a template systemd unit > > /etc/systemd/system/[email protected] > ----------------------------------- > [Unit] > Description=Check if currently installed kernel version is less than target > > [Service] > Type=oneshot > ExecStart=/usr/bin/sh -c '[[ "$(/usr/bin/vercmp %i %v)" = "1" ]]' > Restart=no > CollectMode=inactive-or-failed > > [Install] > WantedBy=multi-user.target > > Then create the directories > > /etc/systemd/system/vboxadd.service.d/ > /etc/systemd/system/vboxadd-service.service.d/ > > Then for each service > > > /etc/systemd/system/vboxadd.service.d/kerver.conf > ------------------------------------------------- > [Unit] > [email protected] > [email protected] > > /etc/systemd/system/vboxadd-service.service.d/kerver.conf > --------------------------------------------------------- > [Unit] > [email protected] > [email protected] > > In this way, if my bash-fu is correct, the version compare will fail the > [email protected] and vboxadd and vboxadd-service will > not start
there is ConditionKernelVersion= man systemd.unit -- damjan

