From owner-freebsd-rc@FreeBSD.ORG Tue Jun 14 22:12:30 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 781DA16A41F for ; Tue, 14 Jun 2005 22:12:30 +0000 (GMT) (envelope-from jmartin37@speakeasy.net) Received: from mail27.sea5.speakeasy.net (mail27.sea5.speakeasy.net [69.17.117.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 331FC43D4C for ; Tue, 14 Jun 2005 22:12:30 +0000 (GMT) (envelope-from jmartin37@speakeasy.net) Received: (qmail 16430 invoked from network); 14 Jun 2005 22:12:29 -0000 Received: from dsl027-163-157.atl1.dsl.speakeasy.net (HELO [192.168.0.200]) (moonlightcheese@[216.27.163.157]) (envelope-sender ) by mail27.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 14 Jun 2005 22:12:29 -0000 Message-ID: <42AF564C.4040907@speakeasy.net> Date: Tue, 14 Jun 2005 18:12:28 -0400 From: Jarrod Martin User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Chad Leigh -- Shire.Net LLC" References: <42AF0EDD.4090100@speakeasy.net> <200506141342.07886.kirk@strauser.com> <42AF328D.8090502@speakeasy.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org, freebsd-questions@freebsd.org Subject: Re: rcNG script problems X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2005 22:12:30 -0000 Chad Leigh -- Shire.Net LLC wrote: > > On Jun 14, 2005, at 1:39 PM, JM wrote: > >> Kirk Strauser wrote: >> >> >>> On Tuesday 14 June 2005 12:07, JM wrote: >>> >>> >>>> i've written an rcNG script but i'm having some issues. >>>> >>>> >>> >>> Step one: set rc_debug="YES" in /etc/rc.conf to see what's actually >>> happening when you attempt to run your script. That seems to >>> uncover about 95% of the problems I've had. >>> >>> >> turned on the option rc_debug="YES" and ran 'dmesg -a'... the script >> doesn't even show up in the list anywhere. are we not supposed to >> be able to write custom rcNG scripts? is there something i'm >> overlooking where i need to register httpd_start in the rc stuff? >> here's my newbie impression of how rc works: >> - rc i run by init >> - rc runs rcorder on all script directories. >> - rc reads rc.conf and runs all scripts found by rcorder >> rcorder recognizes the script i wrote without any errors... yet when >> i boot the system, there is no "checkyesno" for httpd_start. >> there's nothing that references the script at all... WHY? >.< >> >> why did FreeBSD have to adopt this standard anyhow? it seems >> unnecessarily complicated to write custom scripts now. > > > > Where does your script live? You can use rcNG style scripts in /usr/ > local/etc but they must end in .sh and are done in lexographic order > without the rcorder and stuff (unless you write your own ueber- > script to do it) > > I battled this for a long while before I figured out the /usr/local/ > etc does not get full rcNG support > > Chad > _______________________________________________ > 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" yea i've figured it out. this really should be better documented though... i'll be sending all the info to the documentation mailing list. here's the proper way to do it. the filename is 'httpd_start.sh' with 555 mode. rc scripts, both rcNG and the old *.sh styles must have the .sh extension to be recognized (source: bsdforums.org). the script was placed in '/usr/local/etc/rc.d'. and here is the code: [code] #!/bin/sh # # PROVIDE: httpd_start # REQUIRE: LOGIN . /etc/rc.subr name="httpd_start" rcvar=`set_rcvar` command="/var/www/bin/apachectl" args="start" start_cmd="${command} ${args}" stop_cmd="/var/www/bin/apachectl stop" httpd_start_enable=${httpd_start_enable-"NO"} httpd_start_flags=${httpd_start_flags-""} load_rc_config $name run_rc_command "$1" [/code] the line 'httpd_start_enable="YES"' was added to rc.conf and this fixed everything.