Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 632814 Details for
Bug 869669
salt doesn't correctly determin status of services when using systemd
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to fix problem
0001-Fix-systemd-service-status.patch (text/plain), 1.50 KB, created by
Jeffrey C. Ollie
on 2012-10-24 14:15:03 UTC
(
hide
)
Description:
patch to fix problem
Filename:
MIME Type:
Creator:
Jeffrey C. Ollie
Created:
2012-10-24 14:15:03 UTC
Size:
1.50 KB
patch
obsolete
>From c09c22ecbf9ab1fe51d66eed793ca377c6461981 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 1fd489d..dc79a2f 100644 >--- a/salt/modules/systemd.py >+++ b/salt/modules/systemd.py >@@ -140,20 +140,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.12.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 869669
: 632814