Date: Tue, 03 Jan 2012 16:00:20 -0800 From: Doug Barton <dougb@FreeBSD.org> To: d@delphij.net Cc: freebsd-rc@FreeBSD.org, Xin Li <delphij@delphij.net>, mm@FreeBSD.org Subject: Re: [review] Move slapd to 'DAEMON' stage Message-ID: <4F039694.4010801@FreeBSD.org> In-Reply-To: <4F036DA5.7040907@delphij.net> References: <4F036DA5.7040907@delphij.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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="<set as needed>" # # 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F039694.4010801>