fix(core): update

This commit is contained in:
Philipp Kunz 2019-09-06 17:33:01 +02:00
parent 8957e03445
commit ce1fa6640b
3 changed files with 11 additions and 8 deletions

View File

@ -77,4 +77,8 @@ export class SmartDaemonService implements ISmartDaemonServiceConstructorOptions
public async delete() { public async delete() {
await this.smartdaemonRef.systemdManager.deleteService(this); await this.smartdaemonRef.systemdManager.deleteService(this);
} }
public async reload() {
await this.smartdaemonRef.systemdManager.reload();
}
} }

View File

@ -35,8 +35,4 @@ export class SmartDaemon {
await serviceToAdd.save(); await serviceToAdd.save();
return serviceToAdd; return serviceToAdd;
} }
public async init() {
await this.systemdManager.init();
}
} }

View File

@ -79,9 +79,6 @@ export class SmartDaemonSystemdManager {
public async startService(serviceArg: SmartDaemonService) { public async startService(serviceArg: SmartDaemonService) {
if (await this.checkElegibility()) { if (await this.checkElegibility()) {
if (serviceArg.alreadyExists) {
await this.stopService(serviceArg);
}
await this.execute( await this.execute(
`systemctl start ${SmartDaemonSystemdManager.createServiceNameFromServiceName(serviceArg.name)}` `systemctl start ${SmartDaemonSystemdManager.createServiceNameFromServiceName(serviceArg.name)}`
); );
@ -131,5 +128,11 @@ export class SmartDaemonSystemdManager {
} }
} }
public async init() {} public async reload() {
if (await this.checkElegibility()) {
await this.execute(
`systemctl daemon-reload`
);
}
}
} }