nginx agent produces spurious error messages (includes patch)

Bug #1032163 reported by janl
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
resource-agents (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Won't Fix
Undecided
Unassigned

Bug Description

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)

Revision history for this message
janl (janl) wrote :
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Thank you for taking the time to report this bug. In an effort to keep an
up-to-date and valid list of bugs to work on, I have reviewed this report
to verify it still requires effort and occurs on an Ubuntu release in
standard support, and it does not.

It is unfortunate that we were unable to resolve this defect, however
there appears to be no further action possible at this time. I am
therefore moving the bug to 'Incomplete'. If you disagree or have
new information, we would be grateful if you could please add a comment
stating why and then change the status of the bug to 'New'.

Changed in resource-agents (Ubuntu Precise):
status: New → Won't Fix
Changed in resource-agents (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.