From owner-freebsd-questions@FreeBSD.ORG Wed Feb 6 14:33:49 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 05F9D16A420 for ; Wed, 6 Feb 2008 14:33:49 +0000 (UTC) (envelope-from navneet.upadhyay@gmail.com) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.182]) by mx1.freebsd.org (Postfix) with ESMTP id 57CC913C4D9 for ; Wed, 6 Feb 2008 14:33:47 +0000 (UTC) (envelope-from navneet.upadhyay@gmail.com) Received: by ik-out-1112.google.com with SMTP id c21so409747ika.3 for ; Wed, 06 Feb 2008 06:33:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=6DuCC50zZj4Pt5vQ+2ifhY5brxZVk7mt3aftkS65tV4=; b=uFEnj5ktOpG91B78b0AuzPhgjV+/ATc8CQ06Mb+wamamXug5D1blITMVPKZHN2I4w85NSfYGJ5I8JoeGbZ8gigKYG4Zhh/1BoyCkPg3ywRZaEAw7ZLYuE6NZLmasf7EBMWf20HCJFyophYM1Xc/Wy5UnsdvSADzqhEUFReRLTdQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=CSN3Yce4OITxNcxja7TtqE7eo7DyYFD5mIiEnW5fAIkxGy1eRH9tq0JTZtgUEjn1W0NXee0t/GbUYwIxeptRHvtCuJmWkSCHU6ha7QuFaA6opdf43DBaewbLuP0ndLSjZ411GgqE4n1w7E6/RYTW+Eq4vWIwa9Tng9RcPxk68Oc= Received: by 10.150.91.20 with SMTP id o20mr4216235ybb.92.1202308417746; Wed, 06 Feb 2008 06:33:37 -0800 (PST) Received: by 10.150.185.7 with HTTP; Wed, 6 Feb 2008 06:33:37 -0800 (PST) Message-ID: <1563a4fd0802060633s2bb0569cwdc9feea96709fa3c@mail.gmail.com> Date: Wed, 6 Feb 2008 20:03:37 +0530 From: "navneet Upadhyay" To: "Derek Ragona" In-Reply-To: <6.0.0.22.2.20080206081827.02516d20@mail.computinginnovations.com> MIME-Version: 1.0 References: <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <6.0.0.22.2.20080206081827.02516d20@mail.computinginnovations.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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:33:49 -0000 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 On 2/6/08, Derek Ragona wrote: > > At 08:09 AM 2/6/2008, navneet Upadhyay wrote: > > Hi, > I have a script file, i want that script to be executed on system > startup. > > I am doing this on Linux in following two steps : - > > 1. Copying the script to /etc/rc.d directory. > 2. /sbin/chkconfig --add "scriptname" > > > I want to achieve the same on FreeBSD > > chckconfig file is not present, documentation says i have to add it to > rc.conf file. > > How can i add it to rc.conf file, is there any command? > > > You don't need any command. Depending on the version of FreeBSD, put your > script in /usr/local/etc/rc.d and if you are using earlier than 6.XFreeBSD name the script > chckconfig.sh > > You can name it in the same in 6.X and 7.X and it will work. > > Be sure the script is chmod'd (usually 755) to execute. Since your script > runs without a known environment be sure to either use full pathnames for > executables or set the path in your script. > > -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.