4 Commits

Author SHA1 Message Date
119f20915e 1.0.18 2019-09-06 17:33:02 +02:00
ce1fa6640b fix(core): update 2019-09-06 17:33:01 +02:00
8957e03445 1.0.17 2019-09-05 16:19:18 +02:00
3df86bee10 fix(core): update 2019-09-05 16:19:18 +02:00
6 changed files with 13 additions and 12 deletions

View File

@ -1,2 +0,0 @@
npm install -g @servezone_private/spark
spark installdaemon

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartdaemon",
"version": "1.0.16",
"version": "1.0.18",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartdaemon",
"version": "1.0.16",
"version": "1.0.18",
"private": false,
"description": "start scripts as long running daemons and manage them",
"main": "dist/index.js",

View File

@ -77,4 +77,8 @@ export class SmartDaemonService implements ISmartDaemonServiceConstructorOptions
public async delete() {
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();
return serviceToAdd;
}
public async init() {
await this.systemdManager.init();
}
}

View File

@ -79,9 +79,6 @@ export class SmartDaemonSystemdManager {
public async startService(serviceArg: SmartDaemonService) {
if (await this.checkElegibility()) {
if (serviceArg.alreadyExists) {
await this.stopService(serviceArg);
}
await this.execute(
`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`
);
}
}
}