Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
65326710ab | |||
2e174c9f55 | |||
9e42910456 | |||
ff85cee528 |
2
assets/update.sh
Normal file
2
assets/update.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
npm install -g @servezone_private/spark
|
||||||
|
spark installdaemon
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartdaemon",
|
"name": "@pushrocks/smartdaemon",
|
||||||
"version": "1.0.14",
|
"version": "1.0.16",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartdaemon",
|
"name": "@pushrocks/smartdaemon",
|
||||||
"version": "1.0.14",
|
"version": "1.0.16",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "start scripts as long running daemons and manage them",
|
"description": "start scripts as long running daemons and manage them",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -79,6 +79,9 @@ 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)}`
|
||||||
);
|
);
|
||||||
@ -94,9 +97,6 @@ export class SmartDaemonSystemdManager {
|
|||||||
|
|
||||||
public async saveService(serviceArg: SmartDaemonService) {
|
public async saveService(serviceArg: SmartDaemonService) {
|
||||||
if (await this.checkElegibility()) {
|
if (await this.checkElegibility()) {
|
||||||
if (serviceArg.alreadyExists) {
|
|
||||||
this.stopService(serviceArg);
|
|
||||||
}
|
|
||||||
await plugins.smartfile.memory.toFs(
|
await plugins.smartfile.memory.toFs(
|
||||||
this.smartdaemonRef.templateManager.generateUnitFileForService(serviceArg),
|
this.smartdaemonRef.templateManager.generateUnitFileForService(serviceArg),
|
||||||
SmartDaemonSystemdManager.createFilePathFromServiceName(serviceArg.name)
|
SmartDaemonSystemdManager.createFilePathFromServiceName(serviceArg.name)
|
||||||
@ -115,6 +115,9 @@ export class SmartDaemonSystemdManager {
|
|||||||
public async enableService(serviceArg: SmartDaemonService) {
|
public async enableService(serviceArg: SmartDaemonService) {
|
||||||
if (await this.checkElegibility()) {
|
if (await this.checkElegibility()) {
|
||||||
await this.saveService(serviceArg);
|
await this.saveService(serviceArg);
|
||||||
|
if (serviceArg.alreadyExists) {
|
||||||
|
await this.execute(`systemctl daemon-reload`);
|
||||||
|
}
|
||||||
await this.execute(
|
await this.execute(
|
||||||
`systemctl enable ${SmartDaemonSystemdManager.createServiceNameFromServiceName(serviceArg.name)}`
|
`systemctl enable ${SmartDaemonSystemdManager.createServiceNameFromServiceName(serviceArg.name)}`
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user