Skip to content

Commit

Permalink
Run external commands with environment variable correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Sep 23, 2014
1 parent b3c4d70 commit ef550ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/droonga-http-server-configure
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function checkInstalledAsService() {

exec('service droonga-http-server status', function(error, stdin, stdout) {
if (error) {
exec('SYSTEMCTL_SKIP_REDIRECT=yes service droonga-http-server status', function(error, stdin, stdout) {
exec('env SYSTEMCTL_SKIP_REDIRECT=yes service droonga-http-server status', function(error, stdin, stdout) {
installedAsService = stdin.indexOf('running') > -1 ||
stdin.indexOf('droonga-http-server is stopped') > -1;
resolve(installedAsService);
Expand Down Expand Up @@ -74,7 +74,7 @@ function ensureHaveWritePermission() {
function checkRunningStatus() {
return Q.Promise(function(resolve, reject, notify) {
if (installedAsService) {
exec('SYSTEMCTL_SKIP_REDIRECT=yes service droonga-http-server status',
exec('env SYSTEMCTL_SKIP_REDIRECT=yes service droonga-http-server status',
function(error, stdin, stdout) {
running = !error && stdin.indexOf('running') > -1;
resolve(running);
Expand Down

0 comments on commit ef550ef

Please sign in to comment.