best way to disable a linux service in a AppVM

17 views
Skip to first unread message

lik...@gmx.de

unread,
Nov 6, 2021, 12:09:40 PM11/6/21
to qubes...@googlegroups.com
Hi!

What's the best way to disable a linux service "e.g. systemctl disable --now systemd-resolved.service &" in a AppVM. I don't want to disable the service in my template because it's used by other AppVMs.

Currently, I'm doing this in /rw/config/rc.local by "sleep 5s && sudo systemctl disable --now systemd-resolved.service &". But it's probably not the best way as it relies on the startup timing.

Thanks in advance and best, P

badgateway

unread,
Nov 6, 2021, 12:23:46 PM11/6/21
to qubes...@googlegroups.com
Is it an option to clone your current template and disable the services permanently in your new template?

lik...@gmx.de

unread,
Nov 6, 2021, 12:34:08 PM11/6/21
to qubes...@googlegroups.com
On 11/6/21 16:23, badgateway wrote:
> Is it an option to clone your current template and disable the services permanently in your new template?
>

It is an option. But in this case I'd prefer the way using /rw/config/rc.local not to maintain another template.

I've learned there must be 3 alternatives, otherwise you've not done enough research. Maybe there's a 3rd way?

unman

unread,
Nov 6, 2021, 2:06:44 PM11/6/21
to qubes...@googlegroups.com
There is indeed a third way, which fits nicely in to the Qubes
framework, and is used by qvm-service. Instead of disabling the
service, control it.

If your service is foo.service:
Create a folder foo.service.d, and create a file 10_qubes.conf with
something like
```
[Unit]
ConditionPathExists=/var/run/qubes/service/foo
After=qubes.sysinit.service
```

Now you can control with `qvm-service --enable <qube> foo` in qubes
where you want the service to run.

You could invert the sense of control by using
ConditionPathExists=!<some parameter> but this may lead to confusion.

lik...@gmx.de

unread,
Nov 7, 2021, 6:09:07 AM11/7/21
to qubes...@googlegroups.com

On 11/6/21 18:06, unman wrote:
Thanks unman, that's exactly what I was looking for. Except, there's a 4th way. :)

awokd

unread,
Nov 7, 2021, 4:22:14 PM11/7/21
to qubes...@googlegroups.com
lik...@gmx.de:
I think the canonical way to do that is to use the services tab of the
qube to identify which service(s) to start or stop. I am a bit unclear
on how that is done exactly, though.

--
- don't top post
Mailing list etiquette:
- trim quoted reply to only relevant portions
- when possible, copy and paste text instead of screenshots
Reply all
Reply to author
Forward
0 new messages