Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Oct 2001 14:11:47 +1000
From:      Chris Aitken <chris@ideal.net.au>
To:        FreeBSD <freebsd-questions@FreeBSD.ORG>
Subject:   rc.d running a perl script/expect
Message-ID:  <5.1.0.14.2.20011011133734.03a52948@mail.ideal.net.au>
In-Reply-To: <20011010201400.R387@blossom.cjclark.org>
References:  <KPEMLBLEMPMHGLJOCDEGEEIGCJAA.scott@gerhardt-it.com> <KPEMLBLEMPMHGLJOCDEGEEIGCJAA.scott@gerhardt-it.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi all,


I have come across a weird one that I just cannot explain....... I have a 
perl script that gets launched from rc.d that simply runs 24x7 and does the 
following

* Loop starts
* uses DBI to connect to a database
* queries the database and gets 2 variables
* launches an expect script with 2 arguments (the 2 variables above)
* returns to the perl script
* updates the database
* Loops back to start

Problem is.... If I run the script as root from console, or as a user 
su'ed, then it works perfectly.......

if I reboot the machine and let the script run from the .sh file in the 
rc.d directory, expect seems to ignore any arguments after the script name....

/usr/local/bin/expect /location/to/script.exp Argument1 Argument2

whats happening is that the expect script isnt being issued the arguments, 
and the expect script is barfing (because of inbuilt error checking). Yet 
when I run it from root@console or an su'ed user, it spawns the expect 
script with arguments in place.

Now I know that the perl script is accessing the database properly because 
its updating the database properly, so im assuming the error is with the 
expect script not accepting the arguments.



Can anyone shed some light on this or point me in the right direction as to 
why this would be happening as a system service, and works fine otherwise.



Thanks


Chris




--
     Chris Aitken - Administration/Database Designer - IDEAL Internet
  email: chris@ideal.net.au  phone: +61 2 4628 8888  fax: +61 2 4628 8890
              __-----------------------------------------__
    It is said that if you line up all the cars in the world end to end,
          some moron in a rotary will still to try and pass them


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.0.14.2.20011011133734.03a52948>