#!/bin/sh # # $NetBSD: sysdb,v 1.9 2002/03/22 04:34:00 thorpej Exp $ # $FreeBSD: src/etc/rc.d/sysdb,v 1.2 2002/06/13 22:14:36 gordon Exp $ # $DragonFly: src/etc/rc.d/sysdb,v 1.4 2005/11/19 21:47:32 swildner Exp $ # # Note: dev_mkdb is required for 'ps' to work without complaining. # 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, which is deleted by mountcritlocal # but can't be recreated by it because install and chown may # not be available then (possibly no /usr). # egrep '^utmp:' /etc/group > /dev/null if [ $? ]; then install -c -m 644 -g wheel /dev/null /var/run/utmp else install -c -m 664 -g utmp /dev/null /var/run/utmp fi } load_rc_config $name run_rc_command "$1"