[BACK]Return to sysdb CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

File: [cvs.NetBSD.org] / src / etc / rc.d / sysdb (download)

Revision 1.15, Tue Oct 12 13:23:44 2004 UTC (19 years, 6 months ago) by lukem
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.14: +2 -2 lines

Fix for /bin/ksh, from Jukka Salmi in PR 27232.

#!/bin/sh
#
# $NetBSD: sysdb,v 1.15 2004/10/12 13:23:44 lukem Exp $
#

# PROVIDE: sysdb
# REQUIRE: mountcritremote
# BEFORE:  DAEMON

$_rc_subr_loaded . /etc/rc.subr

name="sysdb"
start_cmd="sysdb_start"
stop_cmd=":"
extra_commands="devdb utmp"
devdb_cmd="build_devdb"
utmp_cmd="build_utmp"

sysdb_start()
{
	echo "Building databases..."
	$devdb_cmd
	$utmp_cmd
}

build_devdb()
{
	if [ /var/run/dev.db -nt /dev ]; then
		: # it's fine
	else
		dev_mkdb
	fi
}

build_utmp()
{
	#	Re-create /var/run/utmp and /var/run/utmpx, which are
	#	deleted by mountcritlocal but can't be recreated by it
	#	because install and chown may not be available then
	#	(possibly no /usr).
	#
	install -c -m 664 -g utmp /dev/null /var/run/utmp
	install -c -m 664 -g utmp /dev/null /var/run/utmpx
}

load_rc_config $name
run_rc_command "$1"