Forgive me - not following exactly what you are advising I try.

I enabled tracing in the expect script - with --detach mode I don't see any of 
the debug information.  Without --detach I do see everything and it 
finishes/completes as expected.  If I run with:

sudo /usr/bin/perl -w /usr/bin/sec.pl --conf=/etc/sec.conf --quoting 
--input=/var/log/local3 --pid=/var/run/sec.pid --syslog=daemon > /dev/null 2>&1

It completes as expected.  If I put a & on the end of that and run in the 
background it gets hung up again on in the expect script.


I changed my sec.conf file to this:

# Executing on arbor alert

type=Single
continue=TakeNext
ptype=RegExp
pattern=\s\d\d:\d\d:\d\d\s(.*)\spfsp:\sanomaly\sTotal_traffic_rate_Misuse\s+id\s+(\d+)\s+status\s+ongoing\s+severity\s+3\s+classification\s+medium\s+impact\s+\".*\"\s+src\s+0\.0\.0\.0\/0\s+All\s+dst\s+(\d.\d.\d.*\/32)
desc=Arbor hostname $1 alertid $2 blackholeip $3
action=spawn exec /usr/bin/addarborpfBlackholeexp.pl $1 $2 $3 $0  > /dev/null 
2>&1


And it works fine.  I have to believe it's something with stdin/out/error with 
expect.  I'll look through the trace and expect options to see if there is 
anything there I can adjust.  Let me know if you have any other suggestions and 
thank you for your patience/help.

Thanks,

Chris


----- Original Message -----
From: John P. Rouillard <rou...@cs.umb.edu>
To: chris heidbrink <chrisheidbr...@yahoo.com>
Cc: "simple-evcorr-users@lists.sourceforge.net" 
<simple-evcorr-users@lists.sourceforge.net>
Sent: Thursday, February 28, 2013 10:58 AM
Subject: Re: [Simple-evcorr-users] detach mode probs 


In message <1362024745.34694.yahoomail...@web125403.mail.ne1.yahoo.com>,
chris heidbrink writes:
>   but when that script calls out the expect script it starts at the
>   first part to try to ssh / login / but doesn't go anywhere.
>
>   <snip of addarborpfBlackholeexp.pl>
>
>    $arboroutput = qx(/usr/local/bin/expect -f
>   /usr/bin/addarborpfBlackhole.exp '$params->{'devusername'}'
>   '$params->{'password'}' '$params->{'device'}'

Is tracing enabled in the expect script? If so what is it telling you?
I am wondering if there is an environment variable issue here as well.

One big difference with detatched/daemon mode is that stdin, stdout
and stderr are all directed to /dev/null. Can you try running it
*without* detatch and using

   < /dev/null > /dev/null 2>&1

or equivalent for your shell to redirect descriptors 0, 1 and 2.

--
                -- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to