Merge pull request #455 from bcoca/service_systemd_initscript_fix2
now actually adds usable name for systemd when using init scripts
This commit is contained in:
commit
657291d3df
1 changed files with 2 additions and 0 deletions
|
@ -420,6 +420,7 @@ class LinuxService(Service):
|
||||||
if not systemd_enabled:
|
if not systemd_enabled:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
originalname = name
|
||||||
# default to .service if the unit type is not specified
|
# default to .service if the unit type is not specified
|
||||||
if name.find('.') > 0:
|
if name.find('.') > 0:
|
||||||
unit_name, unit_type = name.rsplit('.', 1)
|
unit_name, unit_type = name.rsplit('.', 1)
|
||||||
|
@ -446,6 +447,7 @@ class LinuxService(Service):
|
||||||
|
|
||||||
# systemd also handles init scripts (and is enabled at this point)
|
# systemd also handles init scripts (and is enabled at this point)
|
||||||
if initscript:
|
if initscript:
|
||||||
|
self.__systemd_unit = originalname
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue