Public bug reported:

I have the following line in the main config file
(/etc/nginx/nginx.conf):

    log_format syslog 'nginx[$pid]: $host $remote_addr $remote_user
"$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';

This line alone makes it impossible to start nginx. The init script
parses the pid file path from the config file, but does that in a
unreliable way:

    PID=$(awk -F'[ \t;]+' '/[^#]pid/ {print $2}' /etc/nginx/nginx.conf)

For my config file, this returns two lines, the first one with the pid
file, the second line with just 'log_format':

    $ awk -F'[ \t;]+' '/[^#]pid/ {print $2}' /etc/nginx/nginx.conf
    /var/run/nginx.pid
    log_format
    $

Later on when the init script attempts to start nginx, it fails:

    $ start-stop-daemon --start --quiet --pidfile /var/run/nginx.pid log_format 
--exec /usr/sbin/nginx --
    nginx: invalid option: "log_format"

Ubuntu 14.04, everything updated today.

** Affects: nginx (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nginx in Ubuntu.
https://bugs.launchpad.net/bugs/1325683

Title:
  Having the string '$pid' in the config file breaks the init script

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1325683/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to