3

Recently we upgraded our systems from Flatcar stable 3815.2.5 to Flatcar 3975.2.0. This means we moved from systemd version 252 to 255.

Our systems are configured with a custom default target called online.target.

ls -l /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 33 Aug 16 09:41 /etc/systemd/system/default.target -> /etc/systemd/system/online.target

The file contains only a few simple statements:

[Unit]
Description=Start publishing
After=multi-user.target
Requires=multi-user.target
AllowIsolate=yes

Two services depend on this target by means of a WantedBy=online.target in their respective service files. One is a Type=oneshot service which runs a custom activation-check.sh script, the other is a Type=exec service which runs the Bird routing daemon.

In addition, there is a directory /etc/systemd/system/online.target.wants which contains symlinks to the services mentioned earlier.

The problem is that the system says it has successfully reached online.target, but the activation-check.service was never started.

Logging says:

Aug 16 09:44:09 dev-ns01 systemd[1]: Reached target multi-user.target - Multi-User System.
Aug 16 09:44:09 dev-ns01 systemd[1]: Reached target online.target

So according to systemd, both targets were reached within a window of one second. This was not the case under systemd 252, where online.target was only reached when its dependent services were successfully started.

However, when I manually change to the online target using systemctl isolate online.target everything works perfectly fine. So that tells me the dependencies are configured correctly, right?

I have looked through the changelog from systemd 252 to 255 but have found nothing related to this issue. Anybody have a clue?

1
  • I don't know if it can provide any info, but there is systemd-analyze critical-chain online.target (or activation-check.service) to show more detailed timings. Also there is systemctl show -p Wants online.target and similar for Requires etc which resumes what systemd thinks. You are right to look at the links in the .wants directories, but remember you should be using systemctl enable ... and systemctl daemon-reload in case things change in each release. Commented Aug 19, 2024 at 10:04

1 Answer 1

0

It's difficult to answer with such context. Did you try :

  • Adding Before and After Directives
  • Explicitly starting services in online.target :
Requires=activation-check.service bird.service

OR

Wants=activation-check.service bird.service
1
  • 1
    Thanks for responding. I understand that it's difficult to answer my question because it's also hard to provide the correct details. One thing I forgot to mention is that the activation-check.service and bird.service files both have Requires=multi-user.target and After=multi-user.target directives. I might try moving the Wants services to the online.target file instead of a separate online.target.wants directory but I'm not sure that is the problem. As I said, the online target works perfectly fine if I activate it manually using systemctl isolate online.target Commented Aug 17, 2024 at 12:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.