fix(core): update
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import * as plugins from './smartdaemon.plugins';
|
||||
import { SmartDaemon } from './smartdaemon.classes.smartdaemon';
|
||||
|
||||
export class SmartDaemonTemplateManager {
|
||||
public smartdaemonRef: SmartDaemon;
|
||||
|
||||
constructor(smartdaemonRefArg: SmartDaemon) {
|
||||
this.smartdaemonRef = smartdaemonRefArg;
|
||||
}
|
||||
|
||||
public generateServiceTemplate = (optionsArg: {
|
||||
serviceName: string;
|
||||
description: string;
|
||||
serviceVersion: string;
|
||||
pathNodeJs: string;
|
||||
command: string;
|
||||
pathWorkkingDir;
|
||||
pathJsFileToRun;
|
||||
}) => {
|
||||
@@ -18,7 +25,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=${optionsArg.pathNodeJs} ${optionsArg.pathJsFileToRun}
|
||||
ExecStart=/bin/bash -c "cd ${optionsArg.pathWorkkingDir} && ${optionsArg.command}"
|
||||
WorkingDirectory=${optionsArg.pathWorkkingDir}
|
||||
Restart=on-failure
|
||||
LimitNOFILE=infinity
|
||||
@@ -30,5 +37,5 @@ Restart=always
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
`;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user