-
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
Disabled (but running) systemd service is not restarted with mod_watch #47361
Comments
I'm having a hard time replicating this with a small use case as below:
When running the state it restarts the service:
I tried capturing what I found in the states you pointed out and applyling it to this service. Is the use case the same? |
Try running the following commands: systemctl disable apache2 I'm not near my computer at this moment, but it should do the trick. The idea is that systemctl status should report the service as disabled AND running |
I just tripled check that i ran those commands before running the state and I am still seeing the service restart. I even just changed it to zabbix-agent and cannot replicate. Heres a detailed use case:
i'm wondering if my state is just not setup in the same way as your use case |
Oh, I see now, you're using sysvinit, not systemd. Try it using either Ubuntu 16.04 or Debian 8 (or newer) |
my understanding is debian ensures they synchronize the services through both sysvinit and systemd. I even confirmed on the minion that it was running the salt/modules/systemd.py file. |
also to note i tested on both debian 8 and ubuntu 16 |
That's weird, it happened to both me and another commenter on the issue I linked, and we were able to replicate it by running:
and then applying the formula. (or applying the formula on a clean system) Can you try with the formula I linked (my fork is on the correct commit, before the workaround)? Just use zabbix.agent.repo and zabbix.agent.conf and this pillar (just in case):
Although it should work the same on debian 8, you could try it on debian 9, which is the exact version I'm using. |
I can confirm, problem exist. I just checked one more time. Install it again:
zabbix-agent log file
It's still using 127.0.0.1 as server, restart was not performed. I will try to replicate this issue with simple test state later. May be there is some race condition. |
Something weird is going on with this state. |
are any of you seeing this with any other services or only zabbix? Also are you certain this was working on previous salt versions? |
I'm seeing this with docker.service, not sure if it's salt, docker or systemd problem :) |
and do you know if it was working on previous versions? |
Hello, @Ch3LL! I'd try to bring this up again. The issue is reproducable and can be simplified to the description below. Situation 1Assume, we have an
In this case on applying state we get:
and the service hasn't been restarted (take a look on active since) despite the watch for the config. Situation 2When the service is already enabled, but we still have changes in the watched config file, applying the state results in the service's restart correctly:
I believe, Could you take another look on it, please? |
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. |
ping @bandikoot thanks for the example and sorry for the late reply. thanks to stalebot I saw this issue today. I was finally able to replicate this and I'm just gonna paste my exact steps so i don't have an issue replicating this in the future: Using this vagrant file:
and now i see the issue. will label as a bug for us to get fixed thanks |
Thank you for updating this issue. It is no longer marked as stale. |
Confirmed on: Versions Report
Given the text in the watch requisite documentation, it seems this is the intended (or at least expected) behavior.
I haven't dug into the code for this too deep yet, but does anyone know if this is something that's "fixable" in |
Description of Issue/Question
When a systemd service is created, started, but not enabled, salt does not restart the service on mod_watch:
Some packages (zabbix, especifically), don't enable their services when installed, so Salt only enables it, instead of enabling+restarting.
This issue is discussed more thoroughly at this PR:
saltstack-formulas/zabbix-formula#77
Setup
Formula: https://github.com/edusperoni/zabbix-formula
states:
Steps to Reproduce Issue
On a machine that has never installed zabbix-agent, install it using the formula above.
On a machine that has zabbix-agent installed, run
systemctl disable zabbix-agent && apt-get purge zabbix-agent -y
and then apply the state.Versions Report
The text was updated successfully, but these errors were encountered: