From owner-freebsd-questions Wed Oct 10 21:12: 2 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.ideal.net.au (ion.ideal.net.au [203.20.241.5]) by hub.freebsd.org (Postfix) with ESMTP id 4A6DE37B406 for ; Wed, 10 Oct 2001 21:11:57 -0700 (PDT) Received: from helium.ideal.net.au (trilluser@helium.staff.ideal.net.au [202.3.35.2]) by mail.ideal.net.au (8.9.3/8.9.3) with ESMTP id OAA71174 for ; Thu, 11 Oct 2001 14:11:48 +1000 (EST) (envelope-from chris@ideal.net.au) Message-Id: <5.1.0.14.2.20011011133734.03a52948@mail.ideal.net.au> X-Sender: chris@mail.ideal.net.au X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 11 Oct 2001 14:11:47 +1000 To: FreeBSD From: Chris Aitken Subject: rc.d running a perl script/expect In-Reply-To: <20011010201400.R387@blossom.cjclark.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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