mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
Remove service file even if it isn't link.
(Link to) service file from /etc/systemd/system/ must be removed before masking systemd service. https://fedorahosted.org/freeipa/ticket/4658 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
2712b609cb
commit
e28eb13907
@ -442,11 +442,9 @@ class SystemdService(PlatformService):
|
||||
pass
|
||||
|
||||
def mask(self, instance_name=""):
|
||||
if instance_name != "":
|
||||
srv_tgt = os.path.join(paths.ETC_SYSTEMD_SYSTEM_DIR, instance_name)
|
||||
# remove instance file or link before masking
|
||||
if os.path.islink(srv_tgt):
|
||||
os.unlink(srv_tgt)
|
||||
srv_tgt = os.path.join(paths.ETC_SYSTEMD_SYSTEM_DIR, self.service_instance(instance_name))
|
||||
if os.path.exists(srv_tgt):
|
||||
os.unlink(srv_tgt)
|
||||
try:
|
||||
ipautil.run([paths.SYSTEMCTL, "mask",
|
||||
self.service_instance(instance_name)])
|
||||
|
Loading…
Reference in New Issue
Block a user