-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
service.running and service.enabled fail to enable services (Debian and systemd) #34267
Comments
@morganwillcock I was able to replicate this. weirdly enough once I enable the service maually the state started working even if I disabled it again. Are you seeing the same behavior? |
@Ch3LL Thank you for looking at this. Yes, I see the same thing. I manually disabled the rsync service and re-applying the states has successfully re-enabled it. |
I am seeing the same issue on Ubuntu 16.04(Xenial). |
It looks like salt is running the check, and is getting back disabled as an answer. Then it isn't doing anything about it. saltstack/map.jinja: services.sls: saltstack_minion_service: /var/log/salt/minion: systemctl status salt-minion.service |
What I think may be happening for me is that salt-miinion also has /etc/init/salt-minion.conf and /etc/init.d/salt-minion. The disabling of the service works the upstart way with /etc/init/salt-minion.override if /etc/init/salt-minion.conf exists. If it doesn't, if /etc/init.d/salt-minion exists, then it does it the init.d way by creating symlinks in /etc/rc3.d. If /etc/init.d/salt-minion doesn't exist, then it finally does it the systemd way by putting a symlink, /etc/systemd/system/multi-user.target.wants/salt-minion.service. |
I think they only expect you to have one, but if you have more than one you can get this confused behavior. In the cause of salt-minion, it is just poor packaging. |
Looks like this is fixed in master, but hasn't made it into a released version. |
FWIW: I have similar behavior on Centos 7 not enabling an elasticsearch service when run through highstate. When we provision Amazon stack, the master starts first. Each minion independently runs salt-call to apply its highstate. The state below will start the service but systemd reports it as disable (and it is really is because it does not start on reboot). start-service: [centos@es01.wb-S5-1 ~]$ systemctl status elasticsearch However, if I then run just the specific id it will enable the service. [centos@es01.wb-S5-1 ~]$ sudo salt-call state.sls_id start-service elasticsearch
Summary for localSucceeded: 4 (changed=1) Failed: 0Total states run: 4 And now we see the service is now enabled. [centos@es01.wb-S5-1 ~]$ systemctl status elasticsearch [centos@es01.wb-S5-1 ~]$ sudo salt-call --versions-report Dependency Versions: System Versions: |
Under the hood, Wayne's issue is likely:
The above is from the cfn-init.log on an amazon instance we spun up using his rules. |
I verified that the commit @edgan references does indeed fix this issue. I will see about getting it backported to 2016.3 |
Thank you, thank you!
|
I'm having problems trying to enable services using states. The following is an example of trying to enable the rsync service on a Debian 8 machine (systemd). The service is started if it's stopped, but it is never enabled (even though two states claim that it is). The service execution module does correctly report it as disabled, although in this example I'm querying directly with systemctl.
To re-create:
salt salt-test state.apply
Versions Report
The text was updated successfully, but these errors were encountered: