Discussion:
[Libstoragemgmt-devel] [PATCH] RPM SPEC: Fix post install script of MegaRAID plugin.
Gris Ge
2015-03-24 04:23:28 UTC
Permalink
* The lsmd daemon should be restarted after this new plugin installed.

Signed-off-by: Gris Ge <***@redhat.com>
---
packaging/libstoragemgmt.spec.in | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/packaging/libstoragemgmt.spec.in b/packaging/libstoragemgmt.spec.in
index 8b84105..1ca0eea 100644
--- a/packaging/libstoragemgmt.spec.in
+++ b/packaging/libstoragemgmt.spec.in
@@ -435,6 +435,13 @@ if [ $1 -eq 0 ]; then
fi

%if 0%{?with_megaraid}
+# Need to restart lsmd if plugin is new installed or removed.
+%post -n %{libstoragemgmt}-megaraid-plugin
+if [ $1 -eq 1 ]; then
+ # New install.
+ /usr/bin/systemctl try-restart libstoragemgmt.service \
+ >/dev/null 2>&1 || :
+fi
%postun -n %{libstoragemgmt}-megaraid-plugin
if [ $1 -eq 0 ]; then
# Remove
--
1.8.3.1
Tony Asleson
2015-03-24 16:20:49 UTC
Permalink
Committed!

Thanks!
-Tony
Post by Gris Ge
* The lsmd daemon should be restarted after this new plugin installed.
---
packaging/libstoragemgmt.spec.in | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/packaging/libstoragemgmt.spec.in b/packaging/libstoragemgmt.spec.in
index 8b84105..1ca0eea 100644
--- a/packaging/libstoragemgmt.spec.in
+++ b/packaging/libstoragemgmt.spec.in
@@ -435,6 +435,13 @@ if [ $1 -eq 0 ]; then
fi
%if 0%{?with_megaraid}
+# Need to restart lsmd if plugin is new installed or removed.
+%post -n %{libstoragemgmt}-megaraid-plugin
+if [ $1 -eq 1 ]; then
+ # New install.
+ /usr/bin/systemctl try-restart libstoragemgmt.service \
+fi
%postun -n %{libstoragemgmt}-megaraid-plugin
if [ $1 -eq 0 ]; then
# Remove
Loading...