Repository navigation
Description
Description of Issue
systemd service is not restarted if it is already running and disabled. it will enable the service but then will not do a restart per the watch requisite. if the service is running and enabled then it does a restart.
Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
see steps to reproduce
Steps to Reproduce Issue
(Include debug logs if possible and relevant.
test case
on salt master:
file fail2ban.sls
fail2ban:
pkg.installed: []
service.running:
- enable: True
- name: fail2ban
- require:
- pkg: fail2ban
- watch:
- file: /etc/fail2ban/jail.local
/etc/fail2ban/jail.local:
file.managed:
- source: salt://fail2ban/files/jail.local
- mode: 644
- require:
- pkg: fail2ban
====
in jail.local you can just make something up that doesn't match what is on the minion now
on minion server setup:
systemctl start fail2ban
systemctl disable fail2ban
run debug on the minion:
salt-call -l debug state.apply fail2ban
and you will see that it enables the service
it updates fail.local
and does NOT restart fail2ban.
if the service is enabled then it will do a restart.
Actual results:
only the service gets enable not restarted after the file change. it should do both an enable and a restart.
Expected results:
From the salt documentation i believe this is a bug as this stack should make sure the service is enabled and restarted if the watch condition is true.
Versions Report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: 1.11.5
cherrypy: Not Installed
dateutil: 2.8.0
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.10.1
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.6.1
mysql-python: Not Installed
pycparser: 2.14
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.16 (default, Apr 30 2019, 15:54:43)
python-gnupg: Not Installed
PyYAML: 5.1
PyZMQ: 17.0.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 5.0.2
ZMQ: 4.3.2
System Versions:
dist: fedora 30 Thirty
locale: UTF-8
machine: x86_64
release: 5.2.17-200.fc30.x86_64
system: Linux
version: Fedora 30 Thirty
[mark.preston@vmserver ~]$
Activity
stale commentedon Jan 7, 2020
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.
mepreston commentedon Jan 7, 2020
then someone better get busy on it because it is still an issue.
stale commentedon Jan 7, 2020
Thank you for updating this issue. It is no longer marked as stale.
Ch3LL commentedon Jan 13, 2020
i believe this is a duplicate of #47361.
If confirmed please close here and we will use that issue to monitor this issue.
mepreston commentedon Jan 14, 2020
it seems to be a duplicate.
stale commentedon Feb 13, 2020
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.
mitar commentedon Nov 27, 2026
I made a PR to address this: #70974