Выскочка произвела, предварительно запускают содержание сценария

Это - потому что это действительно прибывает из localhost - это - Apache, говорящий с собой.

См. http://wiki.apache.org/httpd/InternalDummyConnection

0
задан 31 December 2011 в 02:45
1 ответ

There's no easy answer here. Unfortunately, if you pipe the output of the syntax check to something like logger, you lose the return code to check if it failed.. so you have to do it something like this:

syntax_check_output=`mktemp /tmp/nginx.check.XXXXXX`
if $DAEMON -t -c $NGINX_CONF_FILE > $syntax_check_output 2>&1 ; then
  rm -f $syntax_check_output
else
  logger -t nginx -p daemon.err < $syntax_check_output
  rm -f $syntax_check_output
  exit 1
fi

(incidentally, you should note that all upstart script sections are run with 'set -e', so the if statement in your original example won't be executed.. as soon as the command exits non-zero, the shell will exit.)

0
ответ дан 5 December 2019 в 16:46

Теги

Похожие вопросы