-
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
systemd module misses some files when checking for new unit files #51107
Comments
@rlifshay Thanks for reporting this. Do you think you would be able to create a PR with a fix? |
Hi, It is a bad practice, user write services should never go in /run /lib but in /etc and should never been rewrited. Ref. https://askubuntu.com/questions/659267/how-do-i-override-or-configure-systemd-services Best regards, |
@dwoz, I'm not familiar enough with the internals of salt to know if there's a better way to do this than just looping through a list of paths to check. If that's all there is to it, or someone can point me in the right direction, then yes I can look into making a pull request. @Poil, yes I am aware, however /etc is for custom services and for machine specific overrides. /lib is intended for software that has been installed (something often done with salt), especially if it's a package intended for installation on multiple machines. /run is for units or overrides that are only temporary until reboot, and as such neither /etc or /lib is appropriate. |
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. |
Still an issue last I checked. |
Thank you for updating this issue. It is no longer marked as stale. |
Description of Issue/Question
The systemd module seems to only check for new unit files in
/etc/systemd/system
. This causes issues with new managed unit files that are placed in other valid locations for systemd.service.running
and other related states fail to detect the new unit files and reload systemd before starting/stopping or otherwise managing services thus causing the entire state to fail.There are multiple valid paths for unit files. Personally I was using
/usr/local/lib/systemd/system/
(which seems to be ubuntu specific?) but thesystemd.unit
man page lists a bunch for both user and system modes. The three main system mode ones seem to be:/etc/systemd/system
/run/systemd/system
/lib/systemd/system
The relevant code seems to be in
_untracked_custom_unit_found()
inmodules/systemd.py
:https://github.com/saltstack/salt/blob/develop/salt/modules/systemd.py#L375
Setup
Versions Report
The text was updated successfully, but these errors were encountered: