upstream release 0.10.5, pciutils as Requires

e9
Clint Savage 12 years ago
parent 8444fcb503
commit 01afcd04a6

@ -1,48 +0,0 @@
From d21f01128f378cd9bbcf59e7436114594ddf08e4 Mon Sep 17 00:00:00 2001
From: "Jeffrey C. Ollie" <jeff@ocjtech.us>
Date: Tue, 23 Oct 2012 09:20:38 -0500
Subject: [PATCH] Fix systemd service status.
Under systemd, not every service has a "Main PID" so using that to
determine whether a service was running failed for a number of useful
cases, especially services that use systemd's init script
compatibility layer.
Instead, use the 'systemctl is-active' command to determine the status
of a service.
---
salt/modules/systemd.py | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/salt/modules/systemd.py b/salt/modules/systemd.py
index 2e37718..185b1d5 100644
--- a/salt/modules/systemd.py
+++ b/salt/modules/systemd.py
@@ -166,20 +166,15 @@ def reload(name):
# system
def status(name, sig=None):
'''
- Return the status for a service via systemd, returns the PID if the service
- is running or an empty string if the service is not running
+ Return the status for a service via systemd, returns a bool
+ whether the service is running.
CLI Example::
salt '*' service.status <service name>
'''
- ret = __salt__['cmd.run'](_systemctl_cmd('show', name))
- index1 = ret.find('\nMainPID=')
- index2 = ret.find('\n', index1+9)
- mainpid = ret[index1+9:index2]
- if mainpid == '0':
- return ''
- return mainpid
+ cmd = 'systemctl is-active {0}'.format(name)
+ return not __salt__['cmd.retcode'](cmd)
def enable(name):
--
1.7.11.7

@ -9,7 +9,7 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: salt Name: salt
Version: 0.10.4 Version: 0.10.5
Release: 1%{?dist} Release: 1%{?dist}
Summary: A parallel remote execution system Summary: A parallel remote execution system
@ -24,15 +24,16 @@ Source4: %{name}-master.service
Source5: %{name}-syndic.service Source5: %{name}-syndic.service
Source6: %{name}-minion.service Source6: %{name}-minion.service
Source7: README.fedora Source7: README.fedora
Patch0: 0002-Fix-systemd-service-status.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
%ifarch %{ix86} x86_64 %ifarch %{ix86} x86_64
Requires: dmidecode Requires: dmidecode
%endif %endif
Requires: pciutils
%if 0%{?with_python26} %if 0%{?with_python26}
BuildRequires: python26-zmq BuildRequires: python26-zmq
BuildRequires: python26-crypto BuildRequires: python26-crypto
@ -115,7 +116,6 @@ Salt minion is queried and controlled from the master.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .systemd
%build %build
@ -294,6 +294,10 @@ rm -rf $RPM_BUILD_ROOT
%endif %endif
%changelog %changelog
* Sun Nov 18 2012 Clint Savage <herlo1@gmail.com> - 0.10.5-1
- Moved to upstream release 0.10.5
- Added pciutils as Requires
* Tue Oct 24 2012 Clint Savage <herlo1@gmail.com> - 0.10.4-1 * Tue Oct 24 2012 Clint Savage <herlo1@gmail.com> - 0.10.4-1
- Moved to upstream release 0.10.4 - Moved to upstream release 0.10.4
- Patched jcollie/systemd-service-status (SALT@GH#2335) (RHBZ#869669) - Patched jcollie/systemd-service-status (SALT@GH#2335) (RHBZ#869669)

Loading…
Cancel
Save