From owner-freebsd-questions@FreeBSD.ORG Mon Mar 5 22:27:33 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 940E416A403 for ; Mon, 5 Mar 2007 22:27:33 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (dsl081-227-250.chi1.dsl.speakeasy.net [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id 0375513C4A3 for ; Mon, 5 Mar 2007 22:27:30 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.13.8/8.12.11) with ESMTP id l25MR450030768; Mon, 5 Mar 2007 16:27:04 -0600 (CST) Message-Id: <6.0.0.22.2.20070305162342.024b6f58@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Mon, 05 Mar 2007 16:26:50 -0600 To: "Jean-Philippe Daigle" , From: Derek Ragona In-Reply-To: <6B865826E860EF42B3A387A03F39539616917F69@EX0004.AllstreamI TS.local> References: <6B865826E860EF42B3A387A03F39539616917F69@EX0004.AllstreamITS.local> 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: Subject: Re: Starting a service on boot 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: Mon, 05 Mar 2007 22:27:33 -0000 rc scripts should accept a few arguments: start stop restart You can usually find one in /usr/local/etc/rc.d to copy from. In most cases you want the service to write the PID to a file in /var/log so only one instance is started. Also be sure you use full pathnames in your scripts, don't assume an environment exists. -Derek At 08:37 AM 3/5/2007, Jean-Philippe Daigle wrote: >Hello, > >I'm attempting to add a new program to the list of services starting at >boot time on FreeBSD 6.1. Unfortunately, although running the script >directly as root starts it up just fine, it's not starting at boot time. >I've found documentation that says there are two basic steps to follow: > >1) Create a script named, say, 'foo' starting the program, place it in >/etc/rc.d/, and make sure it satisfies a few minimal requirements (see >script below). > >2) Edit rc.conf to add "foo_enable=YES" so the init system knows to >start the new program. > >I've done (2), and here's the script for (1) (anything between <> is me >redacting a username, it's obviously not that way in the script): > >(/etc/rc.d)$ cat cc >#!/bin/sh ># ># PROVIDE: cc ># REQUIRE: DAEMON > >. /etc/rc.subr > >name="cc" >rcvar=`set_rcvar` >command="/home//cruisecontrol.sh" >command_args="&" >cc_user="" > >load_rc_config $name >run_rc_command "$1" > > >I can also check if it's enabled: >(/etc/rc.d)$ ./cc rcvar ># cc >$cc_enable=YES > >I haven't found anything interesting in the system logs from the last >boot - any ideas why it's not starting up? > >Thanks >-Jean-Philippe Daigle > >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > >-- >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. -- 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.