From nobody@FreeBSD.org Mon Dec 17 10:22:55 2007 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08BAF16A419 for ; Mon, 17 Dec 2007 10:22:55 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC7213C442 for ; Mon, 17 Dec 2007 10:22:55 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lBHAMclD033123 for ; Mon, 17 Dec 2007 10:22:38 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id lBHAMcnH033122; Mon, 17 Dec 2007 10:22:38 GMT (envelope-from nobody) Message-Id: <200712171022.lBHAMcnH033122@www.freebsd.org> Date: Mon, 17 Dec 2007 10:22:38 GMT From: Erik Cederstrand To: freebsd-gnats-submit@FreeBSD.org Subject: PATCH: rc.d scripts: print information instead of silently failing when rcvar is not set X-Send-Pr-Version: www-3.1 X-GNATS-Notify: >Number: 118770 >Category: conf >Synopsis: [patch] rc.d scripts: print information instead of silently failing when rcvar is not set >Confidential: no >Severity: non-critical >Priority: medium >Responsible: mtm >State: patched >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Dec 17 10:30:00 UTC 2007 >Closed-Date: >Last-Modified: Fri Jan 25 19:30:01 UTC 2008 >Originator: Erik Cederstrand >Release: 7.0-BETA4 >Organization: >Environment: FreeBSD blanc.affect-it.dk 7.0-BETA4 FreeBSD 7.0-BETA4 #0: Sun Dec 2 19:19:04 UTC 2007 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: Starting an rc.d script without the corresponding rcvar variable set in rc.conf will silently fail. Printing a notice would be more helpful. >How-To-Repeat: # /etc/rc.d/ftpd start # .. but ftpd is not started >Fix: This patch to /etc/rc.subr notifies the user if the rc.d script is called without the rcvar set. # diff rc.subr.orig rc.subr 608a609 > echo "$name not started. Set ${rcvar} to YES in /etc./rc.conf or use '$name onestart'." which gives the output: # /etc/rc.d/ftpd start ftpd not started. Set ftpd_enable to YES in /etc./rc.conf or use 'ftpd onestart'. # >Release-Note: >Audit-Trail: Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Mon Dec 17 10:53:39 UTC 2007 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=118770 Responsible-Changed-From-To: freebsd-rc->mtm Responsible-Changed-By: mtm Responsible-Changed-When: Fri Jan 25 14:40:50 UTC 2008 Responsible-Changed-Why: I'll take this. http://www.freebsd.org/cgi/query-pr.cgi?pr=118770 State-Changed-From-To: open->patched State-Changed-By: mtm State-Changed-When: Fri Jan 25 15:08:41 UTC 2008 State-Changed-Why: Patched in HEAD, MFC in one week. http://www.freebsd.org/cgi/query-pr.cgi?pr=118770 From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: conf/118770: commit references a PR Date: Fri, 25 Jan 2008 15:06:34 +0000 (UTC) mtm 2008-01-25 15:06:26 UTC FreeBSD src repository Modified files: etc rc.subr Log: If the rc.conf(5) variable for a script is not enabled do not fail silently. Display a message that the command wasn't run and make possible suggestions for what to do. PR: conf/118770 MFC after: 1 week Revision Changes Path 1.78 +3 -0 src/etc/rc.subr _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" From: Erik Cederstrand To: bug-followup@FreeBSD.org, erik@cederstrand.dk Cc: Subject: Re: conf/118770: [patch] rc.d scripts: print information instead of silently failing when rcvar is not set Date: Fri, 25 Jan 2008 20:24:25 +0100 Actually, there's a minor bug in that it will also print the message at boot time for all services that are not set to start. This is undesirable. I'm not sure how to distinguish between the two scenarios, though. Erik >Unformatted: