Public bug reported:

When running the nginx agent syslog is spammed with these messages:

Aug  2 14:29:15 p2c2ppx01 lrmd: [17150]: info: RA output: 
(p2nginx:monitor:stderr) ls: 
Aug  2 14:29:15 p2c2ppx01 lrmd: [17150]: info: RA output: 
(p2nginx:monitor:stderr) cannot access /etc/nginx/conf.d/*.conf
Aug  2 14:29:15 p2c2ppx01 lrmd: [17150]: info: RA output: 
(p2nginx:monitor:stderr) : No such file or directory
Aug  2 14:29:15 p2c2ppx01 lrmd: [17150]: info: RA output: 
(p2nginx:monitor:stderr) 
Aug  2 14:29:15 p2c2ppx01 lrmd: [17150]: info: RA output: 
(p2nginx:monitor:stderr) ls: cannot access /etc/nginx/conf.d/*.conf: No such 
file or directory

Due to this line in nginx.conf

        include /etc/nginx/conf.d/*.conf;

This seemed strange since the only "ls" line in the nginx script
contains a error redirect.  Strace to the rescue:

31799 execve("/bin/sh", ["sh", "-c", "ls /etc/nginx/conf.d/*.conf;
2>/dev/null"], [/* 25 vars */]) = 0

Not removing the ; on the input line. I expect that the author of the
awk script had a space before the ; on each line in his config.
Similarly for the other include line:

31801 stat("/etc/nginx/sites-enabled/*;", 0x7fffd3bf9490) = -1 ENOENT
(No such file or directory)

To fix replace the procline function in the awk script with this:


        function procline() {
                split($0,a);
                if( a[1]~/^[Ii]nclude$/ ) {
                        gsub(";$","",a[2]);
                        procinclude(a[2]);
                } else {
                        if( a[1]=="root" ) {
                                rootdir=a[2];
                                gsub("\"","",rootdir);
                        }
                        print;
                }
        }

Note the gsub replacing trailing ; with nothing.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: resource-agents 1:3.9.2-5ubuntu4.1
ProcVersionSignature: Ubuntu 3.2.0-26.41-generic 3.2.19
Uname: Linux 3.2.0-26-generic x86_64
ApportVersion: 2.0.1-0ubuntu11
Architecture: amd64
Date: Thu Aug  2 14:24:43 2012
InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Release amd64 
(20120424.1)
SourcePackage: resource-agents
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: resource-agents (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug precise

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1032163

Title:
  nginx agent produces spurious error messages (includes patch)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resource-agents/+bug/1032163/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to