YUKI Hiroshi
null+****@clear*****
Wed Sep 24 18:46:40 JST 2014
YUKI Hiroshi 2014-09-24 18:46:40 +0900 (Wed, 24 Sep 2014) New Revision: ee997a984e519139242ac56291945161a3a75b19 https://github.com/droonga/droonga-http-server/commit/ee997a984e519139242ac56291945161a3a75b19 Message: Remove commands to stop service manually Removed files: bin/droonga-http-server-status bin/droonga-http-server-stop Deleted: bin/droonga-http-server-status (+0 -56) 100755 =================================================================== --- bin/droonga-http-server-status 2014-09-24 17:34:02 +0900 (bdbfd77) +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env node -// -*- js -*- - -var fs = require('fs'), - path = require('path'), - ps = require('ps-node'); - -function handleError(error) { - console.log('Failed to detect running droonga-http-server process.'); - console.log(error.message); - process.exit(false); -} - -var defaultConfigs = require('../lib/default-configs'); -try { - if (!defaultConfigs.pid_file) - throw new Error('Cannot detect the location of the PID file.'); - - var pidFile = path.resolve(defaultConfigs.baseDir, defaultConfigs.pid_file); - if (!fs.existsSync(pidFile)) - throw new Error('There is no PID file at <' + pidFile + '>'); - - var pid = fs.readFileSync(pidFile, 'utf8'); - pid = pid.trim(); - if (!/^[1-9][0-9]*$/.test(pid)) - throw new Error('Invalid PID <' + pid + '>'); - - ps.lookup({ pid: pid, psargs: 'aux' }, function(error, processes) { - if (error) - handleError(error); - - try { - if (processes.length == 0) - throw new Error('No such process with the PID <' + pid + '>.'); - - if (!processes.some(function(foundProcess) { - if (foundProcess.pid != pid) - return false; - - var commandLine = foundProcess.command.indexOf('droonga-http-server') + - ' ' + foundProcess.arguments.join(' '); - if (commandLine.indexOf('droonga-http-server') < 0) - throw new Error('Not a droonga-engine process: PID <' + pid + '> (' + commandLine + ')'); - - console.log('droonga-http-server is running.'); - return true; - })) { - throw new Error('Couldn\'t detect droonga-engine process with the PID <' + pid + '>.'); - } - } catch(error) { - handleError(error); - } - }); -} catch(error) { - handleError(error); -} Deleted: bin/droonga-http-server-stop (+0 -20) 100755 =================================================================== --- bin/droonga-http-server-stop 2014-09-24 17:34:02 +0900 (663cb4d) +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node -// -*- js -*- - -var exec = require('child_process').exec, - fs = require('fs'), - path = require('path'); - -exec('droonga-http-server-status', function(error, stdout, stderr) { - if (error) { - process.exit(false); - return; - } - - var defaultConfigs = require('../lib/default-configs'); - var pidFile = path.resolve(defaultConfigs.baseDir, defaultConfigs.pid_file); - var pid = fs.readFileSync(pidFile, 'utf8'); - pid = pid.trim(); - console.log('Sending SIGTERM to the process...'); - process.kill(pid, 'SIGTERM'); -}); -------------- next part -------------- HTML����������������������������... Download