NetBSD/etc/rc.d/sysdb

38 lines
862 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: sysdb,v 1.10 2002/09/16 02:23:31 perry Exp $
#
# PROVIDE: sysdb
# REQUIRE: mountcritremote
# BEFORE: DAEMON
. /etc/rc.subr
name="sysdb"
start_cmd="sysdb_start"
stop_cmd=":"
sysdb_start()
{
# Build ps databases. If this kernel supports
# machdep.booted_kernel, use that to build the KVM db so dmesg
# will run work when we boot /netbsd.new, etc.
#
echo "Building databases..."
booted_kernel=`sysctl -n machdep.booted_kernel 2>/dev/null`
kvm_mkdb "${booted_kernel:-/netbsd}"
dev_mkdb
# Re-create /var/run/utmp and /var/run/utmpx, which are
# deleted by mountcritlocal but can't be recreated by it
# because install and chown may not be available then
# (possibly no /usr).
#
install -c -m 664 -g utmp /dev/null /var/run/utmp
install -c -m 664 -g utmp /dev/null /var/run/utmpx
}
load_rc_config $name
run_rc_command "$1"