view profiles/xSMALL_/files/etc/rc.d/MAIN @ 350:f83ebf9a770f

Remove ipfw from base profile. Now it will be defined by ipfw profile. Submitted by: Maciej Milewski
author ray@terran.dlink.ua
date Mon, 06 Feb 2012 14:47:20 +0200
parents 67a155d37199
children bd7977a03670
line wrap: on
line source
#!/bin/sh

# PROVIDE: MAIN
# REQUIRE: ADAPTATION

. /etc/rc.subr
. /etc/network.subr

name="MAIN"
start_cmd="main_start"
start_precmd="main_prestart"
start_postcmd="main_poststart"
stop_cmd="main_stop"

main_prestart()
{
	stty status '^T'
	sysctl kern.coredump=0
	sysctl net.inet.ip.forwarding=1

	md=`/sbin/mdconfig -a -t malloc -s 10m`
	newfs -b 4096 -f 512 -n -o space /dev/${md} > /dev/null
	mount /dev/${md} /tmp

	mkdir -p /tmp/etc
	mkdir -p /tmp/var/empty
	mkdir -p /tmp/var/log
	mkdir -p /tmp/var/run
	mkdir -p /tmp/var/spool/lock
	touch /tmp/var/log/all.log

	syslogd -s

	mount_unionfs /tmp/etc /etc

	if [ -c /dev/map/config ]; then
		dd if=/dev/map/config of=/tmp/etc.tar.gz;
		cd /tmp/ && tar xvzf /tmp/etc.tar.gz
	fi

	ifconfig lo0 127.0.0.1/8
	#ifconfig rt0 192.168.0.28/24
	mpd  --background

	inetd -wW

}

main_start()
{
}

main_poststart()
{
}

main_stop()
{
	if [ -c /dev/map/config ]; then
		cd /tmp/ && tar cvzf /tmp/etc.tar.gz etc/* ;
		sysctl hw.cfi.rdonly=0
		dd if=/tmp/etc.tar.gz of=/dev/map/config bs=64k conv=sync ;
		sysctl hw.cfi.rdonly=1
	fi
}

load_rc_config $name

run_rc_command $*