Debugging mysterious perl script problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Debugging mysterious perl script problem
# 1  
Old 10-26-2014
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:

Code:
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!
# 2  
Old 10-26-2014
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?
# 3  
Old 10-26-2014
To rule out that it is not Selinux interfering.

Code:
# 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.
Code:
# setenforce "permissive"

Test the agent.pl

To bring Selinux back to action.
Code:
# setenforce "enforcing"

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

Code:
# 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.
# 4  
Old 10-29-2014
Quote:
Originally Posted by Chubler_XL
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?
i'm not seeing anything error related in the /var/log/messages file. this is quite baffling.
# 5  
Old 10-30-2014
Hi,
I'm unable to see the attached file on my mobile.

Please try:
Code:
perl ./agent.ol

Regards
xabbu

Last edited by Don Cragun; 10-30-2014 at 03:12 AM.. Reason: Add CODE tags.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

GDB Debugging Problem

I have added some code in my file. I have created executable rpm file of our code and also I have created debuginfo and debugsource files and installed all three. But when I debug in gdb I see the the code changes in soucre file. But the break point does not hit at that place as if it did not... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

2. Shell Programming and Scripting

Problem in understanding debugging

Hi i was going through the script debugging technique. below example was given in the book. 1 #!/bin/sh 2 3 Failed() { 4 if ; then 5 echo "Failed. Exiting." ; exit 1 ; 6 fi 7 echo "Done." 8 } 9 10 echo "Deleting old backups,... (11 Replies)
Discussion started by: scriptor
11 Replies

3. Shell Programming and Scripting

Turning on Debugging for a perl script

for security reasons I can not post any part of the script in question in this thread. i hope im not breaking any rules by not doing so. but i have a perl script that i've been asked to turn on debugging on. i didn't write this perl script and i have very very little knowledge of perl. so i... (3 Replies)
Discussion started by: SkySmart
3 Replies

4. Shell Programming and Scripting

Methods For Debugging Perl Problems

Note: Not a programmer by profession but occasionally have to program. I am looking for general methods and freely/readily available tools employed to debug problems during development of perl scripts. Anything that has really helped you out with problems you just couldn't find. A couple of... (5 Replies)
Discussion started by: Vi-Curious
5 Replies

5. Shell Programming and Scripting

script debugging

is there any way you can add a breakpoint in a script so you can stop on it? i have used -xv in my shebang but the script just runs and i want it to stop at a specific point in the script. appreciate any help. (1 Reply)
Discussion started by: npatwardhan
1 Replies

6. Solaris

debugging problem

OS : SOLARIS 10 debug tool :$gdb -v GNU gdb 6.6 compiler : $gcc -v gcc version 2.95.3 20010315 (release) When i tried to debug my application i got the following error. $gdb Pal GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. This GDB was... (2 Replies)
Discussion started by: satish@123
2 Replies

7. Shell Programming and Scripting

debugging a script??

Hi all, Am working on a script to understand the flow control of it.. Since i am from a C background i looking out for an easy way to analyze the script as it runs .. In C/C++ we have F7 that starts execution from main() and proceeds accordingly.. I was wondering if there is a same approach... (2 Replies)
Discussion started by: wrapster
2 Replies

8. Programming

mysterious #define

in the header file orville.h, outside of the #ifdef #endif , there is the following #define JOB_CONTROL /* support job-control */ As you can see, the JOB_CONTROL macro has no value associated with it. Here is what I go when I ran grep on the entire source code. $ grep -iR... (6 Replies)
Discussion started by: frequency8
6 Replies

9. UNIX for Advanced & Expert Users

Mysterious Server Shutdown

Virtually no UNIX admin experience. Any admin duties are shared by several folks with no special training. Today we had our Sun v880 server, running Solaris 5.8, shutdown for no apparent reason. When we checked on server we found it completely powered down, yet still connected to a fully... (6 Replies)
Discussion started by: buechler66
6 Replies
Login or Register to Ask a Question