1 1.1 lukem #!/bin/sh 2 1.1 lukem # 3 1.5 lukem # $NetBSD: sysdb,v 1.5 2000/09/19 13:04:39 lukem Exp $ 4 1.1 lukem # 5 1.1 lukem 6 1.5 lukem # PROVIDE: sysdb 7 1.3 lukem # REQUIRE: mountcritremote 8 1.1 lukem 9 1.1 lukem . /etc/rc.subr 10 1.1 lukem 11 1.1 lukem name="sysdb" 12 1.1 lukem start_cmd="sysdb_start" 13 1.1 lukem stop_cmd=":" 14 1.1 lukem 15 1.1 lukem sysdb_start() 16 1.1 lukem { 17 1.1 lukem # Build ps databases. If this kernel supports 18 1.1 lukem # machdep.booted_kernel, use that to build the KVM db so dmesg 19 1.1 lukem # will run work when we boot /netbsd.new, etc. 20 1.1 lukem # 21 1.1 lukem echo "Building databases..." 22 1.1 lukem sysctl machdep 2>/dev/null | grep -q booted_kernel 23 1.1 lukem if [ $? -eq 0 ] ; then 24 1.1 lukem kvm_mkdb `sysctl -n machdep.booted_kernel` || kvm_mkdb /netbsd 25 1.1 lukem else 26 1.1 lukem kvm_mkdb /netbsd 27 1.1 lukem fi 28 1.1 lukem dev_mkdb 29 1.4 lukem 30 1.4 lukem # Re-create /var/run/utmp, which is deleted by mountcritlocal 31 1.4 lukem # but can't be recreated by it because install and chown may 32 1.4 lukem # not be available then (possibly no /usr). 33 1.4 lukem # 34 1.4 lukem install -c -m 664 -g utmp /dev/null /var/run/utmp 35 1.1 lukem } 36 1.1 lukem 37 1.2 lukem load_rc_config $name 38 1.1 lukem run_rc_command "$1" 39