Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make explicit to systemd our NetworkManager dependency #2685 #2762

Conversation

phillxnet
Copy link
Member

Adds After & Requires for NetworkManager.service to rockstor-pre.service. Primarily to surface to admins our dependency on nmcli.

Fixes #2685

Testing:

Before:

rleap15-5:~ # systemd-analyze dot --require rockstor-pre.service
digraph systemd {
        "rockstor-pre.service"->"-.mount" [color="black"];
        "rockstor-pre.service"->"sysinit.target" [color="black"];
        "rockstor-pre.service"->"system.slice" [color="black"];
        "rockstor-pre.service"->"postgresql.service" [color="black"];
        "rockstor-pre.service"->"opt.mount" [color="black"];
        "rockstor-pre.service"->"shutdown.target" [color="red"];
        "rockstor.service"->"rockstor-pre.service" [color="black"];
}
...

After:

lbuildvm:~ # systemd-analyze dot --require rockstor-pre.service
digraph systemd {
        "rockstor-pre.service"->"NetworkManager.service" [color="black"];
        "rockstor-pre.service"->"system.slice" [color="black"];
        "rockstor-pre.service"->"postgresql.service" [color="black"];
        "rockstor-pre.service"->"sysinit.target" [color="black"];
        "rockstor-pre.service"->"-.mount" [color="black"];
        "rockstor-pre.service"->"opt.mount" [color="black"];
        "rockstor-pre.service"->"shutdown.target" [color="red"];
        "rockstor.service"->"rockstor-pre.service" [color="black"];
        "multi-user.target"->"rockstor-pre.service" [color="grey66"];
}
...

Caveat

We seem to have now inherited, via the new association/requires, the multi-user.target. This may well put us a little later on in the boot sequence.

Adds `After` &  `Requires` for NetworkManager.service to
rockstor-pre.service. Primarily to surface to admins our
dependency on nmcli.
@phillxnet
Copy link
Member Author

An rpm was build & installed successfully on a 15.4 x86_64 host, and was successfully rebooted.

Curiously there is no multi-user (see caveat) indicated in this instance.

rleap15-4:~ # systemd-analyze dot --require rockstor-pre.service
digraph systemd {
        "rockstor-pre.service"->"postgresql.service" [color="black"];
        "rockstor-pre.service"->"sysinit.target" [color="black"];
        "rockstor-pre.service"->"NetworkManager.service" [color="black"];
        "rockstor-pre.service"->"opt.mount" [color="black"];
        "rockstor-pre.service"->"system.slice" [color="black"];
        "rockstor-pre.service"->"-.mount" [color="black"];
        "rockstor-pre.service"->"shutdown.target" [color="red"];
        "rockstor.service"->"rockstor-pre.service" [color="black"];
}
...

@FroggyFlox
Copy link
Member

We seem to have now inherited, via the new association/requires, the multi-user.target. This may well put us a little later on in the boot sequence.

Maybe irrelevant if that new target is actually not seen on an install, but would it mean we could see the rockstor services not being started on systems that fail to start their network? In itself it might not be a problem as a NAS without network is not really a thing, but I'm thinking of rate instances wherewe could have a delay/timeout in the network manager service as we've seen once (rockstor/rockstor-installer#32).

@phillxnet
Copy link
Member Author

@FroggyFlox
Re:

... but would it mean we could see the rockstor services not being started on systems that fail to start their network?

Yes, if the network is managed only by network manager. This is what is intended here. Folks cannot reach our Web-UI with no network. Note this is not an on-line status: just that network manager is now required and we only start after that new requirement has completed it's start-up. We need this to avoid the nmcli failure that is far more obsure than - your system has not Network Manage installed. From sys-admin folks who know of services and not necessarily the relevance/host of nmcli we then make it more accessible where the problem is.

I'm thinking of rate instances wherewe could have a delay/timeout in the network manager service as we've seen once (rockstor/rockstor-installer#32).

Again, us waiting on that delay is appropriate as if Network Manager is mid-start-up whatever it deems startup is, we should wait on that. So we can do our thing re nmcli on a settled network (according to the chosen auth of NM) thereafter.

@phillxnet
Copy link
Member Author

This PR has now been tested on all OS/arch targets re:

  • rpmbuild
  • resulting rpm install

@phillxnet phillxnet merged commit 0f7f997 into rockstor:testing Dec 12, 2023
@phillxnet phillxnet deleted the 2685-Make-explicit-to-systemd-our-NetworkManager-dependency branch December 12, 2023 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants