From 216d5c33ba8e68442dcf69d96c528f1eb57caca9 Mon Sep 17 00:00:00 2001 From: sunguoshuai Date: Mon, 23 Aug 2021 11:18:55 +0800 Subject: [PATCH] Fix runtime error and uninstall warning (cherry picked from commit 9be6d8606cfa18a65e3af8c1ec7cd8dab68ebab3) --- storm-logviewer.service | 4 +--- storm-nimbus.service | 4 +--- storm-supervisor.service | 4 +--- storm-ui.service | 4 +--- storm.spec | 21 +++++++++------------ 5 files changed, 13 insertions(+), 24 deletions(-) diff --git a/storm-logviewer.service b/storm-logviewer.service index 9c28905..bb7e204 100644 --- a/storm-logviewer.service +++ b/storm-logviewer.service @@ -3,9 +3,7 @@ Description=Apache Storm logviewer service After=syslog.target network.target [Service] -User=storm -Group=storm -EnvironmentFile=/etc/sysconfog/storm +EnvironmentFile=/etc/sysconfig/storm ExecStart=/opt/storm/bin/storm --config /etc/storm/storm.yaml logviewer Restart=on-failure StandardOutput=syslog diff --git a/storm-nimbus.service b/storm-nimbus.service index 31a77f0..8091238 100644 --- a/storm-nimbus.service +++ b/storm-nimbus.service @@ -3,9 +3,7 @@ Description=Apache Storm nimbus service After=syslog.target network.target [Service] -User=storm -Group=storm -EnvironmentFile=/etc/sysconfog/storm +EnvironmentFile=/etc/sysconfig/storm ExecStart=/opt/storm/bin/storm --config /etc/storm/storm.yaml nimbus Restart=on-failure StandardOutput=syslog diff --git a/storm-supervisor.service b/storm-supervisor.service index d525438..e94f5f2 100644 --- a/storm-supervisor.service +++ b/storm-supervisor.service @@ -3,9 +3,7 @@ Description=Apache Storm supervisor service After=syslog.target network.target [Service] -User=storm -Group=storm -EnvironmentFile=/etc/sysconfog/storm +EnvironmentFile=/etc/sysconfig/storm ExecStart=/opt/storm/bin/storm --config /etc/storm/storm.yaml supervisor Restart=on-failure StandardOutput=syslog diff --git a/storm-ui.service b/storm-ui.service index 8aaccdb..d937859 100644 --- a/storm-ui.service +++ b/storm-ui.service @@ -3,9 +3,7 @@ Description=Apache Storm ui service After=syslog.target network.target [Service] -User=storm -Group=storm -EnvironmentFile=/etc/sysconfog/storm +EnvironmentFile=/etc/sysconfig/storm ExecStart=/opt/storm/bin/storm --config /etc/storm/storm.yaml ui Restart=on-failure StandardOutput=syslog diff --git a/storm.spec b/storm.spec index 59a4bc9..1639b8d 100644 --- a/storm.spec +++ b/storm.spec @@ -5,7 +5,7 @@ %define _data_dir %{_sharedstatedir}/storm Name: storm Version: 1.2.3 -Release: 3 +Release: 4 Summary: Apache Storm realtime computation system License: Apache-2.0 Url: http://storm.apache.org @@ -60,21 +60,15 @@ install -p -D -m 644 %{S:6} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/storm install -p -D -m 644 conf/storm.yaml $RPM_BUILD_ROOT%{_conf_dir}/ install -p -D -m 644 conf/storm_env.ini $RPM_BUILD_ROOT%{_conf_dir}/ -%pre -/usr/bin/getent group storm > /dev/null || /usr/sbin/groupadd -r storm -if ! /usr/bin/getent passwd storm > /dev/null ; then - /usr/sbin/useradd -r -g storm -m -d %{_prefix}/storm -s /bin/bash -c "Storm" storm -fi - %post %systemd_post storm-nimbus.service %systemd_post storm-supervisor.service %systemd_post storm-logviewer.service %systemd_post storm-ui.service -%postun +%preun for module in nimbus supervisor logviewer ui; do -systemctl status storm.$module > /dev/null +systemctl status storm-$module > /dev/null if [[ $? -eq 0 ]]; then %systemd_preun storm-$module.service fi @@ -89,11 +83,14 @@ done %config(noreplace) %{_sysconfdir}/logrotate.d/storm %config(noreplace) %{_sysconfdir}/sysconfig/storm %config(noreplace) %{_conf_dir}/* -%attr(-,storm,storm) %{_prefix}/storm -%attr(0755,storm,storm) %dir %{_log_dir} -%attr(0700,storm,storm) %dir %{_data_dir} +%{_prefix}/storm +%dir %{_log_dir} +%dir %{_data_dir} %changelog +* Fri 20 Aug 2021 sunguoshuai 1.2.3 - 4 +- Fix runtime error and uninstall warning + * Mon Jun 14 2021 lingsheng 1.2.3 - 3 - Fix status failure after stopping service