diff options
| -rwxr-xr-x | meta/recipes-core/systemd/systemd-systemctl/systemctl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl index 7fe751b397..2229bc7b6d 100755 --- a/meta/recipes-core/systemd/systemd-systemctl/systemctl +++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl | |||
| @@ -209,7 +209,7 @@ class SystemdUnit(): | |||
| 209 | except KeyError: | 209 | except KeyError: |
| 210 | pass | 210 | pass |
| 211 | 211 | ||
| 212 | def enable(self, caller_unit=None): | 212 | def enable(self, units_enabled=[]): |
| 213 | # if we're enabling an instance, first extract the actual instance | 213 | # if we're enabling an instance, first extract the actual instance |
| 214 | # then figure out what the template unit is | 214 | # then figure out what the template unit is |
| 215 | template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit) | 215 | template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit) |
| @@ -248,8 +248,9 @@ class SystemdUnit(): | |||
| 248 | try: | 248 | try: |
| 249 | for also in config.get('Install', 'Also'): | 249 | for also in config.get('Install', 'Also'): |
| 250 | try: | 250 | try: |
| 251 | if caller_unit != also: | 251 | units_enabled.append(unit) |
| 252 | SystemdUnit(self.root, also).enable(unit) | 252 | if also not in units_enabled: |
| 253 | SystemdUnit(self.root, also).enable(units_enabled) | ||
| 253 | except SystemdUnitNotFoundError as e: | 254 | except SystemdUnitNotFoundError as e: |
| 254 | sys.exit("Error: Systemctl also enable issue with %s (%s)" % (service, e.unit)) | 255 | sys.exit("Error: Systemctl also enable issue with %s (%s)" % (service, e.unit)) |
| 255 | 256 | ||
