From owner-freebsd-rc@FreeBSD.ORG Sat May 4 11:44:04 2013 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5D406F6A for ; Sat, 4 May 2013 11:44:04 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ia0-x232.google.com (mail-ia0-x232.google.com [IPv6:2607:f8b0:4001:c02::232]) by mx1.freebsd.org (Postfix) with ESMTP id 3820914DE for ; Sat, 4 May 2013 11:44:04 +0000 (UTC) Received: by mail-ia0-f178.google.com with SMTP id t29so2022971iag.37 for ; Sat, 04 May 2013 04:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=mjC56wbLmx40Vhz4LeaxzNRyiXXUCn4oU80NP4BiytE=; b=CvtjEik/kMVqCx0LONOGGsK5wiy2Y9uBjhPCqANAb+8rzAy/vwbNYn2MBhfjNgq4z9 l9R1MrWLUCE38QoTR6LFnbrl9m/iVBO9UtnjD6FgHmGozM1QPQ7b/NMGppB4U4cGzy8Z MVnOc6fVOS9EcgXHDSlpLPBr4aBrhW8f6HUI/LpRGTzsBVybBHFoktfnQ0/acXJQ4SHJ ueY6Nzpo0FaEb2Qz9xl/I0AepO+bcNo24HxbdmVb531chTZzEhkKeWf5feuswsKJxUV8 TCuBZIMXb304nKNnSljwbPHTROfIMl2nnXZ+YFPVsEQ94p8lMiGWTMaQIyencOqlZwj+ 7CYw== X-Received: by 10.50.108.104 with SMTP id hj8mr420985igb.62.1367657105765; Sat, 04 May 2013 01:45:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.58.52 with HTTP; Sat, 4 May 2013 01:44:35 -0700 (PDT) From: Chris Rees Date: Sat, 4 May 2013 09:44:35 +0100 Message-ID: Subject: rc style guide To: "freebsd-rc@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 04 May 2013 11:44:04 -0000 Hi all, Since writing ports-mgmt/rclint with what I figure are sane defaults, I've come across some differences between general usage in ports and the "official" style guide. I'd like to propose the following modifications: 1. Stop recommending using ${name}; it is inconsistent because although you can do something like: start_precmd=${name}_prestart You then *can't* do: ${name}_prestart() { It's also very slightly slower (though of course this is a tiny effect). 2. Move load_rc_config directly below name and rcvar; name=dummy rcvar=dummy_enable load_rc_config dummy 3. Remove the style recommendation on quoting variable values given as expressions; # OK dummy_msg="Nothing started." # Not OK : ${dummy_msg="Nothing started."} # OK : ${dummy_msg=Nothing started.} # [which is preferable to most people?? Comments please] start_cmd=dummy_start start_cmd="dummy_start" There being no objections, I'm going to put these recommendations into the style guide, and enforce them using rclint. [most of this is ports stuff really] http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/rcng-dummy.html http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/rcng-confdummy.html Chris