outpost# uname -rs
FreeBSD 4.11-RELEASE
outpost# ls -la /etc/defaults
total 116
drwxr-xr-x 2 root wheel 512 Nov 1 17:16 .
drwxr-xr-x 16 root wheel 2560 Apr 12 13:31 ..
-rw-r--r-- 1 root wheel 16301 May 26 2004 make.conf
-rw-r--r-- 1 root wheel 62261 May 26 2004 pccard.conf
-rw-r--r-- 1 root wheel 8217 May 26 2004 periodic.conf
-rw-r--r-- 1 root wheel 21589 May 26 2004 rc.conf
outpost# grep local_startup /etc/defaults/*
/etc/defaults/rc.conf:local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs
outpost# ls -la /etc/rc
-rw-r--r-- 1 root wheel 16348 May 26 2004 /etc/rc
outpost# md5 /usr/src/etc/rc
MD5 (/usr/src/etc/rc) = ede81497c7ed5fffbdfd79def0ff2759
outpost# cat /usr/local/etc/rc.d/squid.sh
#!/bin/sh
#
# $FreeBSD: ports/www/squid/files/squid.sh,v 1.10 2004/10/13 09:43:48 sergei Exp $
#
# PROVIDE: squid
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: FreeBSD shutdown
#
# Note:
# Set "squid_enable=yes" in either /etc/rc.conf, /etc/rc.conf.local or
# /etc/rc.conf.d/squid to make this script actually do something. There
# you can also set squid_chdir, squid_user, and squid_flags.
#
# Please see squid(8), rc.conf(5) and rc(8) for further details.
#
name=squid
command=/usr/local/sbin/squid
extra_commands=reload
reload_cmd="${command} -k reconfigure"
stop_cmd="squid_stop"
squid_chdir=${squid_chdir:-/usr/local/squid/logs}
squid_enable=${squid_enable:-"NO"}
squid_flags=${squid_flags-"-D"}
squid_user=${squid_user:-squid}
default_config=/usr/local/etc/squid/squid.conf
squid_stop() {
${command} -k shutdown
run_rc_command poll
}
. /usr/local/etc/rc.subr
rcvar=`set_rcvar`
load_rc_config ${name}
# squid(8) will not start if ${default_config} is not present so try
# to catch that beforehand via ${required_files} rather than make
# squid(8) crash.
# If you remove the default configuration file make sure to add
# '-f /path/to/your/squid.conf' to squid_flags
if [ -z "${squid_flags}" ]; then
required_files=${default_config}
fi
required_dirs=${squid_chdir}
run_rc_command "$1"
outpost# cat /usr/local/etc/rc.d/samba.sh
#!/bin/sh
#
# $FreeBSD: ports/net/samba3/files/samba.sh.sample,v 1.9 2004/11/23 17:34:51 krion Exp $
#
# PROVIDE: nmbd smbd
# PROVIDE: winbindd
# REQUIRE: NETWORKING SERVERS named cups
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable samba:
#
#samba_enable="YES"
#
# or, for fine grain control
#
#nmbd_enable="YES"
#smbd_enable="YES"
#winbindd_enable="YES"
#
. /usr/local/etc/rc.subr
name=samba
rcvar=`set_rcvar`
load_rc_config $name
# Set defaults
samba_config=${samba_config:-"/usr/local/etc/smb.conf"}
# Config file is required
if [ ! -r ${samba_config} ]; then
warn "${samba_config} is not readable."
case $1 in
force*) : ;;
*) exit 1 ;;
esac
fi
if test -n ${samba_enable:-""} && checkyesno samba_enable; then
nmbd_enable=${nmbd_enable:-"YES"}
smbd_enable=${smbd_enable:-"YES"}
winbindd_enable=${winbindd_enable:-"YES"}
# Check, that winbind is actally configured
if [ ! "`egrep -i '(idmap.*uid|winbind.*uid)' ${samba_config} 2>/dev/null | egrep -v [\#\;]`" ]; then
#warn "Winbind support is not configured"
winbindd_enable="NO"
fi
fi
# Hack until run_rc_command() get rid of exit()
samba_stop() {
pid=$(check_pidfile ${pidfile} ${command})
if [ -z ${pid} ]; then
echo "${name} not running? (check ${pidfile})."
return 1
fi
echo "Stopping ${command}."
kill -${sig_stop:-TERM} ${pid}
[ $? -ne 0 ] && [ -z "$rc_force" ] && return 1
wait_for_pids ${pid}
}
nmbd_precmd() {
# XXX: Never delete winbindd_idmap, winbindd_cache and group_mapping
if [ -d "/var/db/samba" ]; then
echo "Starting SAMBA: removing stale tdbs :"
for file in connections.tdb locking.tdb messages.tdb \
sessionid.tdb unexpected.tdb brlock.tdb \
namelist.debug
do
rm -vf "/var/db/samba/$file"
done
fi
}
# nmbd
name=nmbd
rcvar=`set_rcvar`
command="/usr/local/sbin/${name}"
required_dirs="/var/db/samba"
pidfile=/var/run/${name}.pid
start_precmd="nmbd_precmd"
stop_cmd="samba_stop"
# Defaults
nmbd_enable=${nmbd_enable:-"NO"}
nmbd_flags=${nmbd_flags:-"-D"}
command_args="-s ${samba_config}"
load_rc_config $name
run_rc_command "$1"
# smbd
name=smbd
rcvar=`set_rcvar`
command="/usr/local/sbin/${name}"
pidfile=/var/run/${name}.pid
start_precmd=":"
stop_cmd="samba_stop"
# Defaults
smbd_enable=${smbd_enable:-"NO"}
smbd_flags=${smbd_flags:-"-D"}
command_args="-s ${samba_config}"
load_rc_config $name
run_rc_command "$1"
# winbindd
name=winbindd
rcvar=`set_rcvar`
command="/usr/local/sbin/${name}"
required_dirs="/var/db/samba"
pidfile=/var/run/${name}.pid
start_precmd=":"
stop_cmd="samba_stop"
# Defaults
winbindd_enable=${winbindd_enable:-"NO"}
winbindd_flags=${winbindd_flags:-""}
command_args="-s ${samba_config}"
load_rc_config $name
run_rc_command "$1"
outpost# ls -la /usr/local/etc/squid/squid.conf
-r--r--r-- 1 root wheel 116835 Mar 23 14:18 /usr/local/etc/squid/squid.conf
outpost# ls -la /usr/local/etc/smb.conf
-r--r--r-- 1 root wheel 1163 Mar 18 13:44 /usr/local/etc/smb.conf