Bring in some miscellaneous changes from OpenBSD and point to an
[dragonfly/port-amd64.git] / etc / rc.d / sysdb
blob24b9292dfcdabdc0afc2a40f4479b4e56cd83367
1 #!/bin/sh
3 # $NetBSD: sysdb,v 1.9 2002/03/22 04:34:00 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/sysdb,v 1.2 2002/06/13 22:14:36 gordon Exp $
5 # $DragonFly: src/etc/rc.d/sysdb,v 1.4 2005/11/19 21:47:32 swildner Exp $
7 # Note: dev_mkdb is required for 'ps' to work without complaining.
9 # PROVIDE: sysdb
10 # REQUIRE: mountcritremote
11 # BEFORE: DAEMON
13 . /etc/rc.subr
15 name="sysdb"
16 start_cmd="sysdb_start"
17 stop_cmd=":"
19 sysdb_start()
21 # Build ps databases. If this kernel supports
22 # machdep.booted_kernel, use that to build the KVM db so dmesg
23 # will run work when we boot /netbsd.new, etc.
25 echo "Building databases..."
26 booted_kernel=`sysctl -n machdep.booted_kernel 2>/dev/null`
27 #kvm_mkdb "${booted_kernel:-/netbsd}"
28 dev_mkdb
30 # Re-create /var/run/utmp, which is deleted by mountcritlocal
31 # but can't be recreated by it because install and chown may
32 # not be available then (possibly no /usr).
34 egrep '^utmp:' /etc/group > /dev/null
35 if [ $? ]; then
36 install -c -m 644 -g wheel /dev/null /var/run/utmp
37 else
38 install -c -m 664 -g utmp /dev/null /var/run/utmp
42 load_rc_config $name
43 run_rc_command "$1"