6 Commits

Author SHA1 Message Date
8957e03445 1.0.17 2019-09-05 16:19:18 +02:00
3df86bee10 fix(core): update 2019-09-05 16:19:18 +02:00
65326710ab 1.0.16 2019-09-05 16:14:05 +02:00
2e174c9f55 fix(core): update 2019-09-05 16:14:05 +02:00
9e42910456 1.0.15 2019-09-05 16:04:38 +02:00
ff85cee528 fix(core): update 2019-09-05 16:04:38 +02:00
3 changed files with 8 additions and 5 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@ -79,6 +79,9 @@ 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)}`
);
@ -94,9 +97,6 @@ export class SmartDaemonSystemdManager {
public async saveService(serviceArg: SmartDaemonService) {
if (await this.checkElegibility()) {
if (serviceArg.alreadyExists) {
this.stopService(serviceArg);
}
await plugins.smartfile.memory.toFs(
this.smartdaemonRef.templateManager.generateUnitFileForService(serviceArg),
SmartDaemonSystemdManager.createFilePathFromServiceName(serviceArg.name)
@ -115,6 +115,9 @@ export class SmartDaemonSystemdManager {
public async enableService(serviceArg: SmartDaemonService) {
if (await this.checkElegibility()) {
await this.saveService(serviceArg);
if (serviceArg.alreadyExists) {
await this.execute(`systemctl daemon-reload`);
}
await this.execute(
`systemctl enable ${SmartDaemonSystemdManager.createServiceNameFromServiceName(serviceArg.name)}`
);