From owner-freebsd-questions@FreeBSD.ORG Wed Feb 6 14:45:07 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C38F016A41A for ; Wed, 6 Feb 2008 14:45:07 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (mail.computinginnovations.com [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id 51FCB13C514 for ; Wed, 6 Feb 2008 14:45:07 +0000 (UTC) (envelope-from derek@computinginnovations.com) MailScanner-NULL-Check: 1202913893.12091@2nwpA2U1ghXpBh55xJW/Ig Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.14.2/8.13.8) with ESMTP id m16Einlu008534; Wed, 6 Feb 2008 08:44:50 -0600 (CST) (envelope-from derek@computinginnovations.com) Message-Id: <6.0.0.22.2.20080206084151.02528b70@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Wed, 06 Feb 2008 08:44:32 -0600 To: "navneet Upadhyay" From: Derek Ragona In-Reply-To: <1563a4fd0802060633s2bb0569cwdc9feea96709fa3c@mail.gmail.co m> References: <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <6.0.0.22.2.20080206081827.02516d20@mail.computinginnovations.com> <1563a4fd0802060633s2bb0569cwdc9feea96709fa3c@mail.gmail.com> Mime-Version: 1.0 X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: script to be executed on system startup. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2008 14:45:07 -0000 At 08:33 AM 2/6/2008, navneet Upadhyay wrote: >i dont want to go with the rename option, as if tomorrow i want to add >more scripts to run at startup i will be in a mess. > >I will tell in detail so that it would be easy for you to understand my >problem :- > >Intention is that the script file should be called at both startup and >shutdown. > >In Linux after doing :- >1. Copying the script to /etc/rc.d directory. >2. /sbin/chkconfig --add "scriptname" > >While startup scriptfile is called with parameter start and while shutdown >it is called with parameter stop. > >So i check the parameter value in the script and if it is start , i run my >executables and if it is stop i gracefully exit from my executables. > > >I want to achie same thing in FreeBSD. > >Thanks, >Navneet All scripts in /usr/local/etc/rc.d are sent the "start" parameter at bootup and the "stop" parameter at shutdown. So this is exactly what you are looking for. If your script isn't running correctly check the paths to the executables, and also put some echo statements in the script to follow the logic to debug it. -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support.