Activity log for bug #1314740

Date Who What changed Old value New value Message
2014-04-30 17:45:50 Scott Hollenbeck bug added bug
2014-05-01 10:22:53 Robie Basak nginx (Ubuntu): status New Triaged
2014-05-01 10:22:56 Robie Basak nginx (Ubuntu): importance Undecided Medium
2014-06-03 11:26:32 Robie Basak summary awk in startup script finds wrong pid init script pid parsing has failure cases
2014-06-03 11:26:53 Robie Basak tags amd64 apport-bug trusty amd64 apport-bug needs-upstream-report trusty
2014-06-04 15:20:20 Greg Lutostanski bug watch added http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747329
2014-06-04 15:20:20 Greg Lutostanski bug task added nginx (Debian)
2014-06-04 15:21:21 Greg Lutostanski tags amd64 apport-bug needs-upstream-report trusty amd64 apport-bug trusty
2014-06-04 17:06:37 Bug Watch Updater nginx (Debian): status Unknown New
2014-08-28 21:06:05 Bug Watch Updater nginx (Debian): status New Fix Committed
2014-09-05 05:27:01 Bug Watch Updater nginx (Debian): status Fix Committed Fix Released
2015-07-25 18:06:43 Thomas Ward nominated for series Ubuntu Trusty
2015-07-25 18:06:43 Thomas Ward bug task added nginx (Ubuntu Trusty)
2015-07-25 18:28:52 Thomas Ward nginx (Ubuntu): status Triaged Fix Released
2015-07-25 18:38:40 Thomas Ward description After upgrading a server from 12.04 to 14.04 I found that the nginx web server wasn't starting automatically. I could start the server without error from the command line. Running "sudo /etc/init.d/nginx start" would produce no visible error, but the service would not be started. Running "sudo /etc/init.d/nginx restart" produces a visible "fail" error. The nginx startup script (/etc/init.d/nginx) includes this line: PID=$(awk -F'[ \t;]+' '/[^#]pid/ {print $2}' /etc/nginx/nginx.conf) This is intended to find this line (or similar) in the nginx.conf file: pid /var/run/nginx.pid; My nginx.conf file includes this map directive: map $http_user_agent $is_bot { default 0; ~*(crawl|Google|Slurp|bingbot|tracker|click|parser|spider|msnbot|Gigabot) 1; } The issue is that awk returns the line that includes "spider", which creates an incorrect value for the location of the pid file, and the startup script fails. The version of /etc/init.d/nginx provided with 12.04 did not inlcude this awk command and the startup script worked without error. $ lsb_release -rd Description: Ubuntu 14.04 LTS Release: 14.04 $ sudo nginx -v nginx version: nginx/1.4.6 (Ubuntu) $ ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: nginx 1.4.6-1ubuntu3 ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9 Uname: Linux 3.13.0-24-generic x86_64 ApportVersion: 2.14.1-0ubuntu3 Architecture: amd64 Date: Wed Apr 30 13:30:35 2014 Dependencies: InstallationDate: Installed on 2014-01-30 (90 days ago) InstallationMedia: Ubuntu-Server 12.04.3 LTS "Precise Pangolin" - Release amd64 (20130820.2) PackageArchitecture: all ProcEnviron: SHELL=/bin/bash TERM=xterm PATH=(custom, no user) LANG=en_US.UTF-8 XDG_RUNTIME_DIR=<set> SourcePackage: nginx UpgradeStatus: Upgraded to trusty on 2014-04-25 (4 days ago) [Impact] * The init script fails to start correctly due to the parsing used by the init file. The init file here now will scan all of nginx.conf and find references to 'pid, rather than the actual pidfile line. * This means that other directives can cause this to fail. Removing /dev/null redirections from the init script, the failure error is wildly apparent. Using the below test case, the 'failure' shows as this when /dev/null redirections in the init script are removed" teward@trusty:/etc/nginx$ sudo service nginx start nginx: invalid option: "~*(crawl|Google|Slurp|bingbot|tracker|click|parser|spider|msnbot|Gigabot)" [Test Case] There are multiple ways to trigger this, however we'll use the provided test case here. (TEST CASE 1) Add this section of code to anywhere in the http { } block of /etc/nginx/nginx.conf: map $http_user_agent $is_bot { default 0; ~*(crawl|Google|Slurp|bingbot|tracker|click|parser|spider|msnbot|Gigabot) 1; } With the currently existing package, run `sudo service nginx start` - it should return a Failure state. Or it will silently fail. `pidof nginx` will show no output if it fails. With the modified code/package, do the same, it will not error out, and will correctly start nginx. `pidof nginx` will show multiple PIDs. [Regression Potential] The changes applied originate from Debian, and are in all subsequent package releases currently in supported Ubuntu releases. Regression potential is likely near-zero. [Original Description] After upgrading a server from 12.04 to 14.04 I found that the nginx web server wasn't starting automatically. I could start the server without error from the command line. Running "sudo /etc/init.d/nginx start" would produce no visible error, but the service would not be started. Running "sudo /etc/init.d/nginx restart" produces a visible "fail" error. The nginx startup script (/etc/init.d/nginx) includes this line: PID=$(awk -F'[ \t;]+' '/[^#]pid/ {print $2}' /etc/nginx/nginx.conf) This is intended to find this line (or similar) in the nginx.conf file: pid /var/run/nginx.pid; My nginx.conf file includes this map directive: map $http_user_agent $is_bot {                 default 0;                 ~*(crawl|Google|Slurp|bingbot|tracker|click|parser|spider|msnbot|Gigabot) 1;  } The issue is that awk returns the line that includes "spider", which creates an incorrect value for the location of the pid file, and the startup script fails. The version of /etc/init.d/nginx provided with 12.04 did not inlcude this awk command and the startup script worked without error. $ lsb_release -rd Description: Ubuntu 14.04 LTS Release: 14.04 $ sudo nginx -v nginx version: nginx/1.4.6 (Ubuntu) $ ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: nginx 1.4.6-1ubuntu3 ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9 Uname: Linux 3.13.0-24-generic x86_64 ApportVersion: 2.14.1-0ubuntu3 Architecture: amd64 Date: Wed Apr 30 13:30:35 2014 Dependencies: InstallationDate: Installed on 2014-01-30 (90 days ago) InstallationMedia: Ubuntu-Server 12.04.3 LTS "Precise Pangolin" - Release amd64 (20130820.2) PackageArchitecture: all ProcEnviron:  SHELL=/bin/bash  TERM=xterm  PATH=(custom, no user)  LANG=en_US.UTF-8  XDG_RUNTIME_DIR=<set> SourcePackage: nginx UpgradeStatus: Upgraded to trusty on 2014-04-25 (4 days ago)
2015-07-25 18:38:47 Thomas Ward nginx (Ubuntu Trusty): status New In Progress
2015-07-25 18:38:50 Thomas Ward nginx (Ubuntu Trusty): importance Undecided Medium
2015-07-25 18:38:54 Thomas Ward nginx (Ubuntu Trusty): assignee Thomas Ward (teward)
2015-07-25 19:01:29 Thomas Ward summary init script pid parsing has failure cases [SRU] init script pid parsing has failure cases
2015-07-25 19:04:55 Thomas Ward attachment added DebDiff for LP#1314740 in Trusty https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1314740/+attachment/4434043/+files/lp1314740.trusty.debdiff
2015-07-25 22:52:36 Thomas Ward bug added subscriber Ubuntu Stable Release Updates Team
2015-07-29 23:43:51 Thomas Ward attachment removed DebDiff for LP#1314740 in Trusty https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1314740/+attachment/4434043/+files/lp1314740.trusty.debdiff
2015-07-29 23:55:23 Thomas Ward attachment added lp1314740.debdiff https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1314740/+attachment/4435967/+files/lp1314740.debdiff
2015-07-30 00:05:33 Adam Conrad nginx (Ubuntu Trusty): status In Progress Fix Committed
2015-07-30 00:05:37 Adam Conrad bug added subscriber SRU Verification
2015-07-30 00:05:41 Adam Conrad tags amd64 apport-bug trusty amd64 apport-bug trusty verification-needed
2015-07-30 00:24:51 Launchpad Janitor branch linked lp:ubuntu/trusty-proposed/nginx
2015-07-30 00:50:26 Thomas Ward tags amd64 apport-bug trusty verification-needed amd64 apport-bug trusty verification-done
2015-08-06 22:48:37 Launchpad Janitor nginx (Ubuntu Trusty): status Fix Committed Fix Released
2015-08-06 22:48:44 Brian Murray removed subscriber Ubuntu Stable Release Updates Team