Remove building with NOCRYPTO option
[minix.git] / etc / rc.d / sysdb
blob2e3003c0d6a76bb39fc333733d720c5021cc5300
1 #!/bin/sh
3 # $NetBSD: sysdb,v 1.24 2012/06/03 21:42:45 joerg Exp $
6 # PROVIDE: sysdb
7 # REQUIRE: mountcritremote
8 # BEFORE: DAEMON
10 $_rc_subr_loaded . /etc/rc.subr
12 name="sysdb"
13 rcvar=$name
14 start_cmd="sysdb_start"
15 stop_cmd=":"
16 extra_commands="devdb utmp services netgroup password"
17 devdb_cmd="build_devdb"
18 utmp_cmd="build_utmp"
19 services_cmd="build_services"
20 netgroup_cmd="build_netgroup"
21 password_cmd="build_password"
22 echo=:
24 sysdb_start()
26 echo -n "Building databases:"
27 echo=echo
28 comma=" "
29 $devdb_cmd
30 $utmp_cmd
31 $services_cmd
32 $netgroup_cmd
33 $password_cmd
34 echo "."
37 check_file()
39 local src="$1"
40 local db="$2"
42 shift 2
43 if [ ! -e "$src" ]; then
44 return
46 if [ \( ! -f "$db" \) -o \( "$src" -nt "$db" \) ]; then
47 $echo -n "$comma$(basename "$src")"
48 comma=", "
49 "$@"
53 build_services()
55 check_file /etc/services /var/db/services.cdb services_mkdb -q
58 build_netgroup()
60 check_file /etc/netgroup /var/db/netgroup.db netgroup_mkdb
63 build_devdb()
65 check_file /dev /var/run/dev.db dev_mkdb
66 check_file /dev /var/run/dev.cdb dev_mkdb
69 build_password()
71 local p=/etc/master.passwd
72 check_file $p /etc/spwd.db pwd_mkdb -w $p
75 build_utmp()
77 # Re-create /var/run/utmp and /var/run/utmpx, which are
78 # deleted by mountcritlocal but can't be recreated by it
79 # because install and chown may not be available then
80 # (possibly no /usr).
82 local i
83 for i in "" x; do
84 if [ ! -f /var/run/utmp$i ]; then
85 $echo -n "${comma}utmp$i"
86 comma=", "
87 install -c -m 664 -g utmp /dev/null /var/run/utmp$i
89 done
92 load_rc_config $name
93 run_rc_command "$1"