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