Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions lib/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,29 @@ var daemon = function(config) {
writable: true,
configurable: false,
value: config.cwd || p.dirname( ( ( this.script === undefined ) || ( this.script === null ) ) ? '' : this.script.toString() )
},
},

/**
* @cfg {Boolean} [runAtLoad]
* To set the script to run at load. Defaults to true.
*/
runAtLoad: {
enumerable: false,
writable: true,
configurable: false,
value: config.runAtLoad instanceof Boolean ? config.runAtLoad : true
},

/**
* @cfg {Boolean} [keepAlive]
* Keep the script running all the time. Defaults to false.
*/
keepAlive: {
enumerable: false,
writable: true,
configurable: false,
value: config.keepAlive instanceof Boolean ? config.keepAlive : false
},

/**
* @cfg {Array|Object} [env]
Expand Down Expand Up @@ -340,9 +362,9 @@ var daemon = function(config) {
var tpl = {
Label: me.label,
ProgramArguments: args,
RunAtLoad: true,
RunAtLoad: me.runAtLoad,
//StartInterval: 3600,
KeepAlive: false,
KeepAlive: me.keepAlive,
WorkingDirectory: me.cwd,
StandardOutPath: me.outlog,
StandardErrorPath: me.errlog
Expand Down