Skip site navigation (1)Skip section navigation (2)
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
Message-ID:  <20030623163702.1DA9C6D%0CB705A6@xavhome.fr.eu.org>
Resent-Message-ID: <200306231440.h5NEeBBm080200@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030623163702.1DA9C6D%0CB705A6>