Debugging mysterious perl script problem

the attached perl script is a deamon that, once kicked off from the command line, it runs in the background and waits for the master server to tell it what plugins to run.

the script works well. but the problem is, whenever i start it, after about a few seconds of starting it, i start getting the following error messages:

root@vbox]# agent.pl
[root@vbox]# sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file

This only seems to happen on RedHat Linux hosts. It doesn't happen on ubuntu, aix or hpux. just redhat. i have been trying desperately to debug this but i cant find the problem. any help will be greatly appreciated!

Are you seeing any output in /var/log/messages either related to SELinux blocking activity of your script/perl or any HORRAYD messages from the script that indicates what it was trying before the problem?

To rule out that it is not Selinux interfering.

# sestatus

If current mode is disabled or permissive, Selinux is not the problem.
If current mode is enforcing, Selinux is still a suspect.

You could temporarily place it into permissive mode as a way of troubleshooting.

# setenforce "permissive"

Test the agent.pl

To bring Selinux back to action.

# setenforce "enforcing"

Also, you can look for Selinux Denials searching for Access Vector Cache (AVC)

# grep "AVC" /var/log/audit/audit.log

Check for any type=AVC with denied, and see if it is related to any commands you are issuing.

i'm not seeing anything error related in the /var/log/messages file. this is quite baffling.

Hi,
I'm unable to see the attached file on my mobile.

Please try:

perl ./agent.ol

Regards
xabbu