<div dir="ltr"><div>Thanks Julien,<br><br></div>I'll apply this fix and upload tonight. I'll also look at the other fixes made upstream on the 2014.1 branch.<br><br>Joe<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 19, 2014 at 10:43 PM, Julien Cristau <span dir="ltr"><<a href="mailto:julien.cristau@logilab.fr" target="_blank">julien.cristau@logilab.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Package: salt-common<br>
Version: 2014.1.13+ds-1<br>
Severity: grave<br>
Tags: patch upstream fixed-upstream<br>
Justification: renders package unusable<br>
<br>
Hi,<br>
<br>
when booting with systemd, the service module is provided by<br>
salt/modules/systemd.py, which only considers native systemd units in<br>
its get_all function, not services provided by init scripts. This<br>
breaks the service state.<br>
<br>
The fix is in upstream commits<br>
90bece1faa1862465e97f7caf262c65cd84583ff and<br>
968b26f45351d790a9fa2afd9bbd6c5bb31f13d5, so basically:<br>
<br>
diff --git a/salt/modules/systemd.py b/salt/modules/systemd.py<br>
--- a/salt/modules/systemd.py<br>
+++ b/salt/modules/systemd.py<br>
@@ -72,6 +74,28 @@ def _systemctl_cmd(action, name):<br>
   return 'systemctl {0} {1}'.format(action, _canonical_unit_name(name))<br>
<br>
<br>
+def _get_all_units():<br>
+Â Â '''<br>
+Â Â Get all units and their state. Units ending in .service<br>
+Â Â are normalized so that they can be referenced without a type suffix.<br>
+Â Â '''<br>
+Â Â rexp = re.compile(r'(?m)^(?P<name>.+)\.(?P<type>' +<br>
+Â Â Â Â Â Â Â Â Â Â Â '|'.join(VALID_UNIT_TYPES) +<br>
+Â Â Â Â Â Â Â Â Â Â Â r')\s+loaded\s+(?P<active>[^\s]+)')<br>
+<br>
+Â Â out = __salt__['cmd.run_stdout'](<br>
+Â Â Â Â 'systemctl --all --full --no-legend --no-pager list-units | col -b'<br>
+Â Â )<br>
+<br>
+Â Â ret = {}<br>
+Â Â for match in rexp.finditer(out):<br>
+Â Â Â Â name = match.group('name')<br>
+Â Â Â Â if match.group('type') != 'service':<br>
+Â Â Â Â Â Â name += '.' + match.group('type')<br>
+Â Â Â Â ret[name] = match.group('active')<br>
+Â Â return ret<br>
+<br>
+<br>
 def _get_all_unit_files():<br>
   '''<br>
   Get all unit files and their state. Unit files ending in .service<br>
@@ -173,7 +197,7 @@ def get_all():<br>
<br>
     salt '*' service.get_all<br>
   '''<br>
-Â Â return sorted(_get_all_unit_files().keys())<br>
+Â Â return sorted(set(_get_all_units().keys() + _get_all_unit_files().keys()))<br>
<br>
<br>
 def available(name):<br>
<br>
<br>
There are a few other fixes in that file that might be worth<br>
considering, but at least the above is I think necessary for salt to<br>
be in decent shape for jessie.<br>
<br>
Cheers,<br>
Julien<br>
<span class="HOEnZb"><font color="#888888">--<br>
Julien Cristau     <<a href="mailto:julien.cristau@logilab.fr">julien.cristau@logilab.fr</a>><br>
Logilab         <a href="http://www.logilab.fr/" target="_blank">http://www.logilab.fr/</a><br>
Informatique scientifique & gestion de connaissances<br>
<br>
_______________________________________________<br>
pkg-salt-team mailing list<br>
<a href="mailto:pkg-salt-team@lists.alioth.debian.org">pkg-salt-team@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-salt-team" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-salt-team</a><br>
</font></span></blockquote></div><br></div>