1 1.1 lukem #!/bin/sh 2 1.1 lukem # 3 1.14 mycroft # $NetBSD: sysdb,v 1.14 2004/08/13 18:08:03 mycroft 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.14 mycroft $_rc_subr_loaded . /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.13 ragge extra_commands="devdb utmp" 16 1.11 atatat devdb_cmd="build_devdb" 17 1.11 atatat utmp_cmd="build_utmp" 18 1.1 lukem 19 1.1 lukem sysdb_start() 20 1.1 lukem { 21 1.11 atatat echo "Building databases..." 22 1.12 atatat $devdb_cmd 23 1.12 atatat $utmp_cmd 24 1.11 atatat } 25 1.4 lukem 26 1.11 atatat build_devdb() 27 1.11 atatat { 28 1.11 atatat if [ /var/run/dev.db -nt /dev ]; then 29 1.11 atatat # it's fine 30 1.11 atatat else 31 1.11 atatat dev_mkdb 32 1.11 atatat fi 33 1.11 atatat } 34 1.11 atatat 35 1.11 atatat build_utmp() 36 1.11 atatat { 37 1.10 perry # Re-create /var/run/utmp and /var/run/utmpx, which are 38 1.10 perry # deleted by mountcritlocal but can't be recreated by it 39 1.10 perry # because install and chown may not be available then 40 1.10 perry # (possibly no /usr). 41 1.4 lukem # 42 1.4 lukem install -c -m 664 -g utmp /dev/null /var/run/utmp 43 1.10 perry install -c -m 664 -g utmp /dev/null /var/run/utmpx 44 1.1 lukem } 45 1.1 lukem 46 1.2 lukem load_rc_config $name 47 1.1 lukem run_rc_command "$1" 48