-
Notifications
You must be signed in to change notification settings - Fork 5.5k
salt.states.service fails to recognize init.d/sysv services on systemd systems #11900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree with what you're saying here. Let's try and get this in. |
@mtorromeo says this should be fixed by #11921. @uvsmtid can you verify? |
@cachedout and @mtorromeo Thanks for updates! I cherry-picked both 90bece1 and 9617d33 on top of 2014.1 (latest #8444 looks fixedI used similar state mentioned there in its example
Indeed, commit 9617d33 handles #11900 (this issue) still have problemsSee example of Jenkins service state in the beginning of this issue. The code after commit 90bece1 still uses command
Then stop jenkins service manually and execute:
Although it seems more like an issue with systemd (I have even updated it here), the fastest fix is still possible through salt only. The argument is that |
This is still broken in 2014.1.10 on Fedora-20. While there is a kludgy workaround, this really does need to be fixed. the workaround, for those in a CICD environment who need to clear out any blocks in their pipeline, is ugly but works (this example is for Centrify, which also uses sysv init-style files but is managable with systemd under FC20):
|
Hello, A little update for a strange thing :
But :
Why don't support the ".service" ? On systemd both are working :/ (and it's make me a little headache to find this...) |
This happens to me when using State: {% if hdfs.is_namenode or hdfs.is_datanode %}
hdfs-services:
service.running:
- enable: True
- names:
{% if hdfs.is_namenode %}
- hadoop-secondarynamenode
- hadoop-namenode
{% endif %}
{% if hdfs.is_datanode %}
- hadoop-datanode
{% endif %}
{% endif %} I also extend
Versions report: Salt: 2015.5.0
Python: 2.7.9 (default, Mar 1 2015, 12:57:24)
Jinja2: 2.7.3
M2Crypto: 0.21.1
msgpack-python: 0.4.2
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.11
ioflo: Not Installed
PyZMQ: 14.4.0
RAET: Not Installed
ZMQ: 4.0.5
Mako: 1.0.0
Debian source package: 2015.5.0+ds-1~bpo8+1 I would like to debug this further but haven't debugged Salt much since I switched from Salt SSH to Master/Minion setup. Suggestions? |
Running, CentOS 7, Salt version 2015.8.8.2. Cassandra is affected by this as well. As a work around, running this kludge works: cassandra_kludge:
cmd.run:
- name: systemctl enable cassandra
- unless: systemctl -a | grep cassandra
cassandra_service:
service.running:
- name: cassandra
- init_delay: 10
- require:
- cmd: cassandra_kludge |
This even made me update the bug in My test still confirm that there is no known way by |
I have discovered somewhat similar problem on Debian Jessie, when I deploy new sysv script and try to use
Whole idea is to create I had no problem on Wheesy, but on Jessie with systemd it seems that I have to execute But does that mean that |
Still see this same issue: Dependency Versions: System Versions: Using a very simple file.managed + service.running/enable vxlan SysV service file:/etc/init.d/vxlan: vxlan: If I |
I ran into the same issue with cassandra init service on centos7. @gtmanfred suggested using the https://docs.saltstack.com/en/latest/ref/states/providers.html
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Uh oh!
There was an error while loading. Please reload this page.
Problem/Example
This is a simple Salt state to enable and start
jenkins
service:Official Jenkins installation on RedHat/CentOS/Fedora uses init.d/sysv scripts.
Manually enabling and starting through init.d/sysv scripts perfectly works even on systemd-based Fedora 20:
On the other hand, Salt fails to execute the state:
Cause
The problem stems from the fact that Salt executes
systemctl list-unit-files
command which only lists systemd unit files excluding init.d/sysv scripts:Because Salt doesn't see required
jenkins
service in the list of unit files, it doesn't pass next execution tosystemctl
for enabling/starting/... the service and does't letsystemctl
to tell "authoritatively" about actual existence of the service.Proposal
This issue is very closely related to issue #8444 (as far as the proposed solution is concerned) and described in this comment.
Rather than executing any pre-validation logic (i.e. finding service name somewhere), Salt should rely on systemd (and its
systemctl
command) to determine whether states to enable/start/... the service failed or succeeded. In other words, Salt should executesystemctl
with any arbitrary service name optimistically and report result of the execution instead of trying to predict its outcome.Workaround
Again, see it in issue #8444.
Versions
Master and minion is the same host with Fedora 20 x86_64:
The text was updated successfully, but these errors were encountered: