From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jun 23 07:40:12 2003 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6900637B401 for ; Mon, 23 Jun 2003 07:40:12 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6407943FF9 for ; Mon, 23 Jun 2003 07:40:11 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h5NEeBUp080201 for ; Mon, 23 Jun 2003 07:40:11 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5NEeBBm080200; Mon, 23 Jun 2003 07:40:11 -0700 (PDT) Resent-Date: Mon, 23 Jun 2003 07:40:11 -0700 (PDT) Resent-Message-Id: <200306231440.h5NEeBBm080200@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, xavier@xavhome.fr.eu.org (Xavier HUMBERT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D85C337B401 for ; Mon, 23 Jun 2003 07:37:26 -0700 (PDT) Received: from arnor.xavhome.fr.eu.org (ns0.xavhome.fr.eu.org [62.212.110.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2212A43FDD for ; Mon, 23 Jun 2003 07:37:25 -0700 (PDT) (envelope-from xavier@xavhome.fr.eu.org) Received: by arnor.xavhome.fr.eu.org (Postfix, from userid 53) id 679DC41C46; Mon, 23 Jun 2003 16:37:22 +0200 (CEST) Received: from smtp.xavhome.fr.eu.org (doriath.xavhome.fr.eu.org [192.168.100.7]) by arnor.xavhome.fr.eu.org (Postfix) with SMTP id 71D8B41C0D for ; Mon, 23 Jun 2003 16:37:02 +0200 (CEST) Message-Id: <20030623163702.1DA9C6D%0CB705A6@xavhome.fr.eu.org> Date: Mon, 23 Jun 2003 16:37:02 +0200 From: xavier@xavhome.fr.eu.org (Xavier HUMBERT) To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/53636: Suggestion for rc.d style startup scripts for localdaemons X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2003 14:40:12 -0000 >Number: 53636 >Category: ports >Synopsis: Suggestion for rc.d style startup scripts for localdaemons >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jun 23 07:40:10 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Xavier HUMBERT >Release: FreeBSD 5.1-CURRENT i386 >Organization: >Environment: System: FreeBSD valinor.groumpf.org 5.1-CURRENT FreeBSD 5.1-CURRENT #12: Tue Jun 10 16:48:20 CEST 2003 root@valinor.groumpf.org:/usr /obj/usr/src/sys/XAVIER i386 >Description: Now that FreeBSD has a rc.d style startup mechanisme, it seems that the user should have the choice for port's startup scripts between legacy /usr/local/etc/rc.d strtup scripts, and new rc-scripts style. This should be acomplished in at least two ways : 1- Move the port's rc-script in /etc/rc.d (like NetBSD way) 2- Mix old and new kind of scripts in /usr/local/etc/rc.d. Based on the presence of .sh extension, old or new startup style is choosen. I have actually no spare time to patch and test /etc/rc.d/localdaemons, but I cant try it this summer. >How-To-Repeat: >Fix: to come. In the meantime, here is the postfix script, inspired from Luke's NetBSD one : =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #!/bin/sh # # $NetBSD: postfix,v 1.7 2003/01/31 06:47:16 lukem Exp $ # FreeBSD 2003/03/17 XH # PROVIDE: mail # REQUIRE: LOGIN # KEYWORD: FreeBSD NetBSD . /etc/rc.subr name="postfix" rcvar=`set_rcvar` command="/usr/local/sbin/postfix" procname=/usr/local/libexec/postfix/master start_precmd="postfix_precmd" start_cmd="${command} start" stop_cmd="${command} stop" reload_cmd="${command} reload" configdir="/etc/postfix" #configdir="/usr/local/etc/postfix" required_files="${configdir}/main.cf" spooletcdir="/var/spool/postfix/etc" required_dirs=$spooletcdir postfix_precmd() { # As this is called after the is_running and required_dir checks # are made in run_rc_command(), we can safely assume ${spooletcdir} # exists and postfix isn't running at this point (unless forcestart # is used). # for f in localtime resolv.conf services; do if [ -f /etc/$f ]; then cmp -s /etc/$f ${spooletcdir}/$f || \ cp -p /etc/$f ${spooletcdir}/$f fi done } load_rc_config $name run_rc_command "$1" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thanks for your attention, Best regards, -- Xavier HUMBERT - MacOS & BSD Programmer >Release-Note: >Audit-Trail: >Unformatted: