@@ -1,6 +1,8 @@
etc/init.d/iwpmd
etc/iwpmd.conf
+etc/rdma/modules/iwpmd.conf
lib/systemd/system/iwpmd.service
+lib/udev/rules.d/90-iwpmd.rules
usr/sbin/iwpmd
usr/share/man/man1/iwpmd.1
usr/share/man/man5/iwpmd.conf.5
@@ -21,3 +21,11 @@ rdma_subst_install(FILES "iwpmd_init.in"
RENAME "iwpmd"
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
install(FILES "iwpmd.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}")
+
+install(FILES "iwpmd.rules"
+ RENAME "90-iwpmd.rules"
+ DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}")
+
+install(FILES modules-iwpmd.conf
+ RENAME "iwpmd.conf"
+ DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/rdma/modules")
new file mode 100644
@@ -0,0 +1 @@
+TAG+="systemd", ENV{ID_RDMA_IWARP}=="1", ENV{SYSTEMD_WANTS}+="iwpmd.service"
@@ -1,12 +1,12 @@
[Unit]
Description=iWarp Port Mapper
Documentation=man:iwpmd file:/etc/iwpmd.conf
-After=network.target
+Requires=rdma-load-modules@iwpmd.service
+After=network.target rdma-load-modules@iwpmd.service
[Service]
ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/iwpmd
LimitNOFILE=102400
KillMode=process
-[Install]
-WantedBy=multi-user.target
+# iwpmd is automatically started by udev when an iWarp RDMA device is present
new file mode 100644
@@ -0,0 +1,2 @@
+# These modules are loaded by the system if iwpmd is to be run
+iw_cm
@@ -1,2 +1 @@
# These modules are loaded by the system if any iWarp device is installed
-iw_cm
@@ -403,7 +403,9 @@ rm -rf %{buildroot}/%{_initrddir}/
%files -n iwpmd
%{_sbindir}/iwpmd
%{_unitdir}/iwpmd.service
+%config(noreplace) %{_sysconfdir}/rdma/modules/iwpmd.conf
%config(noreplace) %{_sysconfdir}/iwpmd.conf
+%{_udevrulesdir}/90-iwpmd.rules
%{_mandir}/man1/iwpmd.*
%{_mandir}/man5/iwpmd.*
Use udev to determine if an iWarp device is present, and if so then start iwpmd and autoload the required module. iwpmd no longer starts if it is simply installed. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- debian/iwpmd.install | 2 ++ iwpmd/CMakeLists.txt | 8 ++++++++ iwpmd/iwpmd.rules | 1 + iwpmd/iwpmd.service.in | 6 +++--- iwpmd/modules-iwpmd.conf | 2 ++ kernel-boot/modules/iwarp.conf | 1 - redhat/rdma-core.spec | 2 ++ 7 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 iwpmd/iwpmd.rules create mode 100644 iwpmd/modules-iwpmd.conf