From f387964f63ca0ebd94e3480053510a93eb7fb3a1 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Mon, 24 Jul 2017 10:44:15 -0600 Subject: [PATCH] iwpmd: Fix install path for iwpmd iwpmd is not user runnable, so it should be installed in sbin. Also wrap-and-sort iwpmd.install Signed-off-by: Jason Gunthorpe --- debian/iwpmd.install | 4 ++-- iwpmd/CMakeLists.txt | 8 +++++--- iwpmd/{iwpmd.service => iwpmd.service.in} | 2 +- iwpmd/{iwpmd_init => iwpmd_init.in} | 2 +- redhat/rdma-core.spec | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) rename iwpmd/{iwpmd.service => iwpmd.service.in} (75%) rename iwpmd/{iwpmd_init => iwpmd_init.in} (97%) mode change 100755 => 100644 diff --git a/debian/iwpmd.install b/debian/iwpmd.install index a78e51704..cc26eccf1 100644 --- a/debian/iwpmd.install +++ b/debian/iwpmd.install @@ -1,6 +1,6 @@ etc/init.d/iwpmd etc/iwpmd.conf lib/systemd/system/iwpmd.service -usr/bin/iwpmd -usr/share/man/man8/iwpmd.8 +usr/sbin/iwpmd usr/share/man/man5/iwpmd.conf.5 +usr/share/man/man8/iwpmd.8 diff --git a/iwpmd/CMakeLists.txt b/iwpmd/CMakeLists.txt index 56dabdcf4..856e3886f 100644 --- a/iwpmd/CMakeLists.txt +++ b/iwpmd/CMakeLists.txt @@ -1,4 +1,4 @@ -rdma_executable(iwpmd +rdma_sbin_executable(iwpmd iwarp_pm_common.c iwarp_pm_helper.c iwarp_pm_server.c @@ -13,8 +13,10 @@ rdma_man_pages( iwpmd.conf.5.in ) -install(FILES "iwpmd.service" DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}") -install(FILES "iwpmd_init" +rdma_subst_install(FILES "iwpmd.service.in" + RENAME "iwpmd.service" + DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}") +rdma_subst_install(FILES "iwpmd_init.in" DESTINATION "${CMAKE_INSTALL_INITDDIR}" RENAME "iwpmd" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) diff --git a/iwpmd/iwpmd.service b/iwpmd/iwpmd.service.in similarity index 75% rename from iwpmd/iwpmd.service rename to iwpmd/iwpmd.service.in index 1f7cacbb9..25740ebdc 100644 --- a/iwpmd/iwpmd.service +++ b/iwpmd/iwpmd.service.in @@ -4,7 +4,7 @@ Documentation=man:iwpmd file:/etc/iwpmd.conf After=network.target [Service] -ExecStart=/usr/bin/iwpmd --systemd +ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/iwpmd --systemd LimitNOFILE=102400 [Install] diff --git a/iwpmd/iwpmd_init b/iwpmd/iwpmd_init.in old mode 100755 new mode 100644 similarity index 97% rename from iwpmd/iwpmd_init rename to iwpmd/iwpmd_init.in index 0d2559e9d..f3ae269c7 --- a/iwpmd/iwpmd_init +++ b/iwpmd/iwpmd_init.in @@ -16,7 +16,7 @@ # Description: iWarp Port Mapper Daemon for opening sockets to claim TCP ports from userspace ### END INIT INFO -IWPMD_BIN="/usr/bin/iwpmd" +IWPMD_BIN="@CMAKE_INSTALL_FULL_SBINDIR@/iwpmd" LOCK="/var/lock/subsys/iwpmd" IWPMD_PID=0 RETVAL=0 diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec index 6402a5682..5ba25a81f 100644 --- a/redhat/rdma-core.spec +++ b/redhat/rdma-core.spec @@ -394,7 +394,7 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %doc %{_docdir}/%{name}-%{version}/ibacm.md %files -n iwpmd -%{_bindir}/iwpmd +%{_sbindir}/iwpmd %{_unitdir}/iwpmd.service %config(noreplace) %{_sysconfdir}/iwpmd.conf %{_mandir}/man8/iwpmd.*