Subject: faithd config and rc.d entry
To: None <current-users@netbsd.org>
From: Feico Dillema <feico@pasta.cs.uit.no>
List: current-users
Date: 06/29/2000 20:04:41
Hi,

Use this for a /etc/rc.d/faithd config which enables list of
faithd servers to be started from a /etc/faithd.conf. Maybe 
useful for inclusion in the NetBSD dists? (is one of my first rc.d
scripts so feel free to correct/improve it).

Feico.

> cat /etc/faithd.conf
nntp
cddb
ssh /usr/pkg/sbin/sshd sshd -i
ftp /usr/libexec/ftpd ftpd -ll
smtp
printer

> cat /etc/rc.d/faithd

#!/bin/sh
#
# PROVIDE: faithd
# REQUIRE: DAEMON LOGIN
. /etc/rc.subr
name="faithd"
start_cmd="faithd_start"
faithd_start()
{
        if [ -r /etc/faithd.conf ]; then
                echo "Starting faith daemons"
                (while read args; do
                        if [ -n "`eval echo '$args'`" ] ; then
                                /usr/sbin/faithd $args
                        fi
                done) < /etc/faithd.conf
        fi
}
load_rc_config $name
run_rc_command "$1"