[Groonga-commit] droonga/droonga-http-server at 0b86929 [master] Add --daemon option

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Apr 25 15:47:57 JST 2014


Kouhei Sutou	2014-04-25 15:47:57 +0900 (Fri, 25 Apr 2014)

  New Revision: 0b869297b8c4225e0fda6a91d327531b00cf258c
  https://github.com/droonga/droonga-http-server/commit/0b869297b8c4225e0fda6a91d327531b00cf258c

  Message:
    Add --daemon option

  Modified files:
    bin/droonga-http-server
    package.json

  Modified: bin/droonga-http-server (+6 -0)
===================================================================
--- bin/droonga-http-server    2014-04-25 15:36:56 +0900 (a5fb4f3)
+++ bin/droonga-http-server    2014-04-25 15:47:57 +0900 (26fe199)
@@ -2,6 +2,7 @@
 // -*- js -*-
 
 var fs = require('fs'),
+    daemon = require('daemon'),
     express = require('express'),
     bodyParser = require('body-parser'),
     cookieParser = require('cookie-parser'),
@@ -53,8 +54,13 @@ options
             droonga.API_DROONGA
           ])
   .option('--pid-file <pid-file>', 'Output PID to <pid-file>.')
+  .option('--daemon', 'Run as a daemon.')
   .parse(process.argv);
 
+if (options.daemon) {
+  daemon();
+}
+
 if (options.pidFile) {
   var fd = fs.openSync(options.pidFile, 'w', 0644);
   fs.writeSync(fd, process.pid.toString());

  Modified: package.json (+1 -0)
===================================================================
--- package.json    2014-04-25 15:36:56 +0900 (47a8360)
+++ package.json    2014-04-25 15:47:57 +0900 (5139569)
@@ -21,6 +21,7 @@
   "dependencies": {
     "cookie-parser": "*",
     "commander": "*",
+    "daemon": "*",
     "express": ">=4.0",
     "express-droonga": "*",
     "express-session": "*",
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index