0

i have two custom targets A and B:

A.target:

Description=A
Requires=multi-user.target
Wants=
Conflicts=B.target
After=multi-user.target
AllowIsolate=yes

B.target:

Description=B
Requires=multi-user.target
Wants=
Conflicts=A.target
After=multi-user.target
AllowIsolate=yes

If A is isolated, services in A are started, services in B are stopped and the other way round. That's good so far.

Problem: Whenever i switch from A to B or B to A, all services in multi-user.target are restarted.

How can i prevent this?

Martze
  • 101
  • 1
  • 4
  • Why are you requiring multi-user.target or trying to start after it? This is basically something you should never do. – Michael Hampton Jan 12 '21 at 18:24
  • because there are some basic services, that are enabled in both scenarios. They are currently in multi-user.target. Why should i never do this? – Martze Jan 13 '21 at 08:17
  • 1
    I suspect you have your logic backward. Services should be _required by_ (or more likely _wanted by_) multi-user.target. You have specified the reverse. For an example, look at pretty much every other service on your system. – Michael Hampton Jan 13 '21 at 09:32
  • @MichaelHampton you're right – Martze Jan 20 '21 at 14:04

0 Answers0