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

srp_daemon: Detect proper path to systemctl #1140

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

nmorey
Copy link
Contributor

@nmorey nmorey commented Feb 18, 2022

While debian uses /bin/systemctl, SUSE only supports /usr/bin/systemctl,
causing srp_daemon to fail silently starting on all ports.
Detect at built which path is the right one and use it.

Fixes: b03beb1 ("srp_daemon: Call systemctl properly from udev")
Signed-off-by: Nicolas Morey-Chaisemartin nmoreychaisemartin@suse.com

While debian uses /bin/systemctl, SUSE only supports /usr/bin/systemctl,
causing srp_daemon to fail silently starting on all ports.
Detect at built which path is the right one and use it.

Fixes: b03beb1 ("srp_daemon: Call systemctl properly from udev")
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
@nmorey
Copy link
Contributor Author

nmorey commented Feb 18, 2022

@Honggang-LI @bdrung
Hopefully this patch should get the proper path for all distros. Could you check it does work well on yours ?

@Honggang-LI
Copy link
Contributor

@Honggang-LI @bdrung Hopefully this patch should get the proper path for all distros. Could you check it does work well on yours ?

Tested it with fedora-35. It works for me.

Thanks

@jgunthorpe jgunthorpe merged commit 847d02f into linux-rdma:master Feb 18, 2022
@nmorey nmorey deleted the dev/systemctl-path branch March 10, 2022 08:28
@bdrung
Copy link
Contributor

bdrung commented Mar 15, 2022

I tested building the master branch on Debian unstable, and 60-srp_daemon.rules got evaluated to:

SUBSYSTEM=="infiniband_mad", KERNEL=="*umad*", PROGRAM=="SYSTEMCTL_BIN-NOTFOUND show srp_daemon -p ActiveState", RESULT=="ActiveState=active", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$attr{ibdev}:$attr{port}.service"

This is caused by not having systemd installed in the minimal chroot environment. Please fall back to use /bin/systemctl if the binary is not found or provide a way to configure it during build.

@rleon
Copy link
Member

rleon commented Mar 18, 2022

@nmorey, are you fixing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants