From owner-freebsd-rc@FreeBSD.ORG Wed Jan 4 00:00:22 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id F06E61065687; Wed, 4 Jan 2012 00:00:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 568881562AC; Wed, 4 Jan 2012 00:00:21 +0000 (UTC) Message-ID: <4F039694.4010801@FreeBSD.org> Date: Tue, 03 Jan 2012 16:00:20 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: d@delphij.net References: <4F036DA5.7040907@delphij.net> In-Reply-To: <4F036DA5.7040907@delphij.net> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------070508030002080304050304" Cc: freebsd-rc@FreeBSD.org, Xin Li , mm@FreeBSD.org Subject: Re: [review] Move slapd to 'DAEMON' stage 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: Wed, 04 Jan 2012 00:00:23 -0000 This is a multi-part message in MIME format. --------------070508030002080304050304 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 01/03/2012 13:05, Xin Li wrote: > Hi, > > A user have asked for this in ports/163799. I _think_ I should move > slapd to 'DAEMON' stage by adding a BEFORE: line? (Or, is that the > right place to start (database) backend service for authentication > services?) The general rule is that ports rc.d scripts should REQUIRE: LOGIN unless there is a good reason not to. Based on the description in the PR, this sounds like a good reason. I would think that a combination of: REQUIRE: DAEMON BEFORE: LOGIN would do it for you. You might also consider adding a comment explaining why it's necessary to deviate from the norm, since the pattern above is one that was originally used for a lot of ports' rc.d scripts, even though it was meaningless to start with, and then pathological after I incorporated them into the base rcorder. Since the originator of the PR mentioned proftpd explicitly, I'll take the opportunity to once again point out that its rc.d script should be fixed to use only 'REQUIRE: LOGIN' rather then the 2 options listed above. This issue is a good reason why. :) It could also benefit from using get_pidfile_from_conf. The attached version has those updates, plus a bug fix, etc. It also adds the ability to specify the configuration file. Martin if you could respond that'd be great. :) Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------070508030002080304050304 Content-Type: text/plain; name="proftpd.in" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="proftpd.in" #!/bin/sh # $FreeBSD: ports/ftp/proftpd/files/proftpd.in,v 1.2 2010/03/27 00:13:01 dougb Exp $ # # PROVIDE: proftpd # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable proftpd: # # proftpd_enable="YES" # proftpd_flags="" # # See proftpd(8) for flags . /etc/rc.subr name=proftpd rcvar=`set_rcvar` load_rc_config $name proftpd_enable=${proftpd_enable:-"NO"} required_files=${proftpd_conf:-"%%PREFIX%%/etc/proftpd.conf"} command=%%PREFIX%%/sbin/proftpd extra_commands="reload" start_precmd=find_pidfile stop_precmd=find_pidfile stop_postcmd="rm -f $pidfile" find_pidfile() { if type get_pidfile_from_conf >/dev/null 2>&1 && get_pidfile_from_conf PidFile $required_files ; then pidfile="$_pidfile_from_conf" else pidfile=$(grep PidFile $required_files) pidfile=${pidfile##*[ ]} fi : ${pidfile:="/var/run/${name}.pid"} } run_rc_command "$1" --------------070508030002080304050304--