From owner-freebsd-questions@FreeBSD.ORG Mon Mar 5 15:46:54 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 69FF216A406 for ; Mon, 5 Mar 2007 15:46:54 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 21BE713C4AA for ; Mon, 5 Mar 2007 15:46:53 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id l25Fi59W004234; Mon, 5 Mar 2007 10:44:05 -0500 (EST) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id l25Fi5Pb004233; Mon, 5 Mar 2007 10:44:05 -0500 (EST) (envelope-from jerrymc) Date: Mon, 5 Mar 2007 10:44:04 -0500 From: Jerry McAllister To: Jean-Philippe Daigle Message-ID: <20070305154404.GD3926@gizmo.acns.msu.edu> References: <6B865826E860EF42B3A387A03F39539616917F69@EX0004.AllstreamITS.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6B865826E860EF42B3A387A03F39539616917F69@EX0004.AllstreamITS.local> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org 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 15:46:54 -0000 On Mon, Mar 05, 2007 at 09:37:54AM -0500, 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): A couple of comments before attemting to look at the script: First, it should go in to '/usr/local/etc/rc.d', not just plain /etc/rc.d The /etc/rc.d location is reserved for system stuff and may be nuked (overwritten) in an upgrade. /usr/local/etc/rc.d is reserved for user installed third party and locally written scripts and will generally be preserved over upgrades. Second, it needs to have execute permission set. Third, the name used to have to end in '.sh'. I don't know if that is still true. Mine all do. Finally, the only value of putting something like 'foo_enable="YES"' in your rc.conf is if the script itself checks for the value on a 'foo_enable' environmental variable. The system doesn't care about it. I don't see this in your script. Also, if you want messages to show in the logs, then you will have to put writing them in to your script. Once those things are dealt with, then see what that script does. ////jerry > > (/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" >