()
| 290 | }; |
| 291 | |
| 292 | var stop = function () { |
| 293 | try { |
| 294 | fs.readFileSync(lock_file); |
| 295 | } catch (e) { |
| 296 | return status('Daemon is not running', 'error'); |
| 297 | }; |
| 298 | daemon.kill(lock_file, function (err, pid) { |
| 299 | if (err && err.errno === 3) { |
| 300 | return status('Daemon is not running', 'error'); |
| 301 | } else if (err) { |
| 302 | return status('Error stopping daemon: ' + err.errno, 'error'); |
| 303 | } |
| 304 | status('Successfully stopped daemon with pid: ' + pid, 'ok'); |
| 305 | }); |
| 306 | }; |
| 307 | |
| 308 | switch(arg) { |
| 309 | case 'stop': |