head 1.26; access; symbols netbsd-10-0-RELEASE:1.25 netbsd-10-0-RC6:1.25 netbsd-10-0-RC5:1.25 netbsd-10-0-RC4:1.25 netbsd-10-0-RC3:1.25 netbsd-10-0-RC2:1.25 netbsd-10-0-RC1:1.25 netbsd-10:1.25.0.26 netbsd-10-base:1.25 netbsd-9-3-RELEASE:1.25 cjep_sun2x-base1:1.25 cjep_sun2x:1.25.0.24 cjep_sun2x-base:1.25 cjep_staticlib_x-base1:1.25 netbsd-9-2-RELEASE:1.25 cjep_staticlib_x:1.25.0.22 cjep_staticlib_x-base:1.25 netbsd-9-1-RELEASE:1.25 phil-wifi-20200421:1.25 phil-wifi-20200411:1.25 is-mlppp:1.25.0.20 is-mlppp-base:1.25 phil-wifi-20200406:1.25 netbsd-8-2-RELEASE:1.25 netbsd-9-0-RELEASE:1.25 netbsd-9-0-RC2:1.25 netbsd-9-0-RC1:1.25 phil-wifi-20191119:1.25 netbsd-9:1.25.0.18 netbsd-9-base:1.25 phil-wifi-20190609:1.25 netbsd-8-1-RELEASE:1.25 netbsd-8-1-RC1:1.25 pgoyette-compat-merge-20190127:1.25 pgoyette-compat-20190127:1.25 pgoyette-compat-20190118:1.25 pgoyette-compat-1226:1.25 pgoyette-compat-1126:1.25 pgoyette-compat-1020:1.25 pgoyette-compat-0930:1.25 pgoyette-compat-0906:1.25 netbsd-7-2-RELEASE:1.24 pgoyette-compat-0728:1.25 netbsd-8-0-RELEASE:1.25 phil-wifi:1.25.0.16 phil-wifi-base:1.25 pgoyette-compat-0625:1.25 netbsd-8-0-RC2:1.25 pgoyette-compat-0521:1.25 pgoyette-compat-0502:1.25 pgoyette-compat-0422:1.25 netbsd-8-0-RC1:1.25 pgoyette-compat-0415:1.25 pgoyette-compat-0407:1.25 pgoyette-compat-0330:1.25 pgoyette-compat-0322:1.25 pgoyette-compat-0315:1.25 netbsd-7-1-2-RELEASE:1.24 pgoyette-compat:1.25.0.14 pgoyette-compat-base:1.25 netbsd-7-1-1-RELEASE:1.24 matt-nb8-mediatek:1.25.0.12 matt-nb8-mediatek-base:1.25 perseant-stdc-iso10646:1.25.0.10 perseant-stdc-iso10646-base:1.25 netbsd-8:1.25.0.8 netbsd-8-base:1.25 prg-localcount2-base3:1.25 prg-localcount2-base2:1.25 prg-localcount2-base1:1.25 prg-localcount2:1.25.0.6 prg-localcount2-base:1.25 pgoyette-localcount-20170426:1.25 bouyer-socketcan-base1:1.25 pgoyette-localcount-20170320:1.25 netbsd-7-1:1.24.0.18 netbsd-7-1-RELEASE:1.24 netbsd-7-1-RC2:1.24 netbsd-7-nhusb-base-20170116:1.24 bouyer-socketcan:1.25.0.4 bouyer-socketcan-base:1.25 pgoyette-localcount-20170107:1.25 netbsd-7-1-RC1:1.24 pgoyette-localcount-20161104:1.25 netbsd-7-0-2-RELEASE:1.24 localcount-20160914:1.25 netbsd-7-nhusb:1.24.0.16 netbsd-7-nhusb-base:1.24 pgoyette-localcount-20160806:1.25 pgoyette-localcount-20160726:1.25 pgoyette-localcount:1.25.0.2 pgoyette-localcount-base:1.25 netbsd-7-0-1-RELEASE:1.24 netbsd-7-0:1.24.0.14 netbsd-7-0-RELEASE:1.24 netbsd-7-0-RC3:1.24 netbsd-7-0-RC2:1.24 netbsd-7-0-RC1:1.24 netbsd-5-2-3-RELEASE:1.20 netbsd-5-1-5-RELEASE:1.20 netbsd-6-0-6-RELEASE:1.22.4.2 netbsd-6-1-5-RELEASE:1.22.4.2 netbsd-7:1.24.0.12 netbsd-7-base:1.24 yamt-pagecache-base9:1.24 yamt-pagecache-tag8:1.22.2.2 netbsd-6-1-4-RELEASE:1.22.4.2 netbsd-6-0-5-RELEASE:1.22.4.2 tls-earlyentropy:1.24.0.10 tls-earlyentropy-base:1.24 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.24 riastradh-drm2-base3:1.24 netbsd-6-1-3-RELEASE:1.22.4.2 netbsd-6-0-4-RELEASE:1.22.4.2 netbsd-5-2-2-RELEASE:1.20 netbsd-5-1-4-RELEASE:1.20 netbsd-6-1-2-RELEASE:1.22.4.2 netbsd-6-0-3-RELEASE:1.22.4.2 netbsd-5-2-1-RELEASE:1.20 netbsd-5-1-3-RELEASE:1.20 netbsd-6-1-1-RELEASE:1.22.4.2 riastradh-drm2-base2:1.24 riastradh-drm2-base1:1.24 riastradh-drm2:1.24.0.4 riastradh-drm2-base:1.24 netbsd-6-1:1.22.4.2.0.6 netbsd-6-0-2-RELEASE:1.22.4.2 netbsd-6-1-RELEASE:1.22.4.2 khorben-n900:1.24.0.8 netbsd-6-1-RC4:1.22.4.2 netbsd-6-1-RC3:1.22.4.2 agc-symver:1.24.0.6 agc-symver-base:1.24 netbsd-6-1-RC2:1.22.4.2 netbsd-6-1-RC1:1.22.4.2 yamt-pagecache-base8:1.24 netbsd-5-2:1.20.0.28 netbsd-6-0-1-RELEASE:1.22.4.2 yamt-pagecache-base7:1.24 netbsd-5-2-RELEASE:1.20 netbsd-5-2-RC1:1.20 matt-nb6-plus-nbase:1.22.4.2 yamt-pagecache-base6:1.24 netbsd-6-0:1.22.4.2.0.4 netbsd-6-0-RELEASE:1.22.4.2 netbsd-6-0-RC2:1.22.4.2 tls-maxphys:1.24.0.2 tls-maxphys-base:1.24 matt-nb6-plus:1.22.4.2.0.2 matt-nb6-plus-base:1.22.4.2 netbsd-6-0-RC1:1.22.4.2 yamt-pagecache-base5:1.23 yamt-pagecache-base4:1.23 netbsd-6:1.22.0.4 netbsd-6-base:1.22 netbsd-5-1-2-RELEASE:1.20 netbsd-5-1-1-RELEASE:1.20 yamt-pagecache-base3:1.22 yamt-pagecache-base2:1.22 yamt-pagecache:1.22.0.2 yamt-pagecache-base:1.22 cherry-xenmp:1.21.0.4 cherry-xenmp-base:1.21 bouyer-quota2-nbase:1.21 bouyer-quota2:1.21.0.2 bouyer-quota2-base:1.21 matt-mips64-premerge-20101231:1.21 matt-nb5-mips64-premerge-20101231:1.20 matt-nb5-pq3:1.20.0.26 matt-nb5-pq3-base:1.20 netbsd-5-1:1.20.0.24 netbsd-5-1-RELEASE:1.20 netbsd-5-1-RC4:1.20 matt-nb5-mips64-k15:1.20 netbsd-5-1-RC3:1.20 netbsd-5-1-RC2:1.20 netbsd-5-1-RC1:1.20 netbsd-5-0-2-RELEASE:1.20 matt-nb5-mips64-premerge-20091211:1.20 matt-premerge-20091211:1.21 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.20 matt-nb4-mips64-k7-u2a-k9b:1.20 matt-nb5-mips64-u1-k1-k5:1.20 matt-nb5-mips64:1.20.0.22 netbsd-5-0-1-RELEASE:1.20 jym-xensuspend-nbase:1.20 netbsd-5-0:1.20.0.20 netbsd-5-0-RELEASE:1.20 netbsd-5-0-RC4:1.20 netbsd-5-0-RC3:1.20 netbsd-5-0-RC2:1.20 jym-xensuspend:1.20.0.18 jym-xensuspend-base:1.20 netbsd-5-0-RC1:1.20 mjf-devfs2-base2:1.20 netbsd-5:1.20.0.16 netbsd-5-base:1.20 matt-mips64-base2:1.20 matt-mips64:1.19.0.4 netbsd-4-0-1-RELEASE:1.15 wrstuden-revivesa-base-3:1.20 wrstuden-revivesa-base-2:1.20 wrstuden-fixsa-newbase:1.15 wrstuden-revivesa-base-1:1.20 yamt-pf42-base4:1.20 yamt-pf42-base3:1.20 hpcarm-cleanup-nbase:1.20 yamt-pf42-baseX:1.20 yamt-pf42-base2:1.20 wrstuden-revivesa:1.20.0.14 wrstuden-revivesa-base:1.20 yamt-pf42:1.20.0.12 yamt-pf42-base:1.20 mjf-devfs2:1.20.0.10 mjf-devfs2-base:1.20 keiichi-mipv6:1.20.0.8 keiichi-mipv6-base:1.20 mjf-devfs:1.20.0.6 mjf-devfs-base:1.20 matt-armv6-nbase:1.20 matt-armv6-prevmlocking:1.20 wrstuden-fixsa-base-1:1.15 netbsd-4-0:1.15.0.14 netbsd-4-0-RELEASE:1.15 cube-autoconf:1.20.0.4 cube-autoconf-base:1.20 netbsd-4-0-RC5:1.15 netbsd-4-0-RC4:1.15 netbsd-4-0-RC3:1.15 netbsd-4-0-RC2:1.15 netbsd-4-0-RC1:1.15 matt-armv6:1.20.0.2 matt-armv6-base:1.20 matt-mips64-base:1.19 hpcarm-cleanup:1.19.0.2 hpcarm-cleanup-base:1.20 netbsd-3-1-1-RELEASE:1.15 netbsd-3-0-3-RELEASE:1.15 wrstuden-fixsa:1.15.0.12 wrstuden-fixsa-base:1.15 abandoned-netbsd-4-base:1.15 abandoned-netbsd-4:1.15.0.6 netbsd-3-1:1.15.0.8 netbsd-3-1-RELEASE:1.15 netbsd-3-0-2-RELEASE:1.15 netbsd-3-1-RC4:1.15 netbsd-3-1-RC3:1.15 netbsd-3-1-RC2:1.15 netbsd-3-1-RC1:1.15 netbsd-4:1.15.0.10 netbsd-4-base:1.15 netbsd-3-0-1-RELEASE:1.15 netbsd-3-0:1.15.0.4 netbsd-3-0-RELEASE:1.15 netbsd-3-0-RC6:1.15 netbsd-3-0-RC5:1.15 netbsd-3-0-RC4:1.15 netbsd-3-0-RC3:1.15 netbsd-3-0-RC2:1.15 netbsd-3-0-RC1:1.15 netbsd-2-0-3-RELEASE:1.13 netbsd-2-1:1.13.4.1.0.2 netbsd-2-1-RELEASE:1.13.4.1 netbsd-2-1-RC6:1.13.4.1 netbsd-2-1-RC5:1.13.4.1 netbsd-2-1-RC4:1.13.4.1 netbsd-2-1-RC3:1.13.4.1 netbsd-2-1-RC2:1.13.4.1 netbsd-2-1-RC1:1.13.4.1 netbsd-2-0-2-RELEASE:1.13 netbsd-3:1.15.0.2 netbsd-3-base:1.15 netbsd-2-0-1-RELEASE:1.13 netbsd-2:1.13.0.4 netbsd-2-base:1.13 netbsd-2-0-RELEASE:1.13 netbsd-2-0-RC5:1.13 netbsd-2-0-RC4:1.13 netbsd-2-0-RC3:1.13 netbsd-2-0-RC2:1.13 netbsd-2-0-RC1:1.13 netbsd-2-0:1.13.0.2 netbsd-2-0-base:1.13 netbsd-1-6-PATCH002-RELEASE:1.9 netbsd-1-6-PATCH002:1.9 netbsd-1-6-PATCH002-RC4:1.9 netbsd-1-6-PATCH002-RC3:1.9 netbsd-1-6-PATCH002-RC2:1.9 netbsd-1-6-PATCH002-RC1:1.9 netbsd-1-6-PATCH001:1.9 netbsd-1-6-PATCH001-RELEASE:1.9 netbsd-1-6-PATCH001-RC3:1.9 netbsd-1-6-PATCH001-RC2:1.9 netbsd-1-6-PATCH001-RC1:1.9 fvdl_fs64_base:1.11 netbsd-1-6-RELEASE:1.9 netbsd-1-6-RC3:1.9 netbsd-1-6-RC2:1.9 netbsd-1-6-RC1:1.9 netbsd-1-6:1.9.0.2 netbsd-1-6-base:1.9 netbsd-1-5-PATCH003:1.2.4.2 netbsd-1-5-PATCH002:1.2.4.2 netbsd-1-5-PATCH001:1.2.4.2 netbsd-1-5-RELEASE:1.2.4.2 netbsd-1-5-BETA2:1.2.4.2 netbsd-1-5-BETA:1.2.4.2 netbsd-1-5-ALPHA2:1.2.4.1 netbsd-1-5:1.2.0.4 netbsd-1-5-base:1.2 minoura-xpg4dl:1.2.0.2 minoura-xpg4dl-base:1.2 rc-d-2000-03-10:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.26 date 2023.12.25.08.38.32; author kre; state Exp; branches; next 1.25; commitid mLgInfYjFpPz7PRE; 1.25 date 2016.04.23.21.24.31; author dholland; state Exp; branches; next 1.24; commitid aDiVkaNmTW2zqN3z; 1.24 date 2012.06.03.21.42.45; author joerg; state Exp; branches; next 1.23; 1.23 date 2012.02.21.12.30.32; author nakayama; state Exp; branches; next 1.22; 1.22 date 2011.09.02.07.13.28; author mbalmer; state Exp; branches 1.22.2.1 1.22.4.1; next 1.21; 1.21 date 2009.06.18.22.00.04; author christos; state Exp; branches; next 1.20; 1.20 date 2007.08.26.23.55.50; author dyoung; state Exp; branches; next 1.19; 1.19 date 2007.05.16.01.24.42; author christos; state Exp; branches; next 1.18; 1.18 date 2007.05.13.17.23.56; author christos; state Exp; branches; next 1.17; 1.17 date 2007.05.10.17.45.50; author christos; state Exp; branches; next 1.16; 1.16 date 2007.05.08.20.33.59; author christos; state Exp; branches; next 1.15; 1.15 date 2004.10.12.13.23.44; author lukem; state Exp; branches; next 1.14; 1.14 date 2004.08.13.18.08.03; author mycroft; state Exp; branches; next 1.13; 1.13 date 2003.05.11.18.17.30; author ragge; state Exp; branches 1.13.4.1; next 1.12; 1.12 date 2003.02.24.01.04.45; author atatat; state Exp; branches; next 1.11; 1.11 date 2002.10.08.16.21.52; author atatat; state Exp; branches; next 1.10; 1.10 date 2002.09.16.02.23.31; author perry; state Exp; branches; next 1.9; 1.9 date 2002.03.22.04.34.00; author thorpej; state Exp; branches; next 1.8; 1.8 date 2001.04.16.01.38.15; author lukem; state Exp; branches; next 1.7; 1.7 date 2000.10.14.07.33.39; author nisimura; state Exp; branches; next 1.6; 1.6 date 2000.10.09.05.02.14; author nisimura; state Exp; branches; next 1.5; 1.5 date 2000.09.19.13.04.39; author lukem; state Exp; branches; next 1.4; 1.4 date 2000.07.27.13.58.49; author lukem; state Exp; branches; next 1.3; 1.3 date 2000.07.26.00.11.49; author lukem; state Exp; branches; next 1.2; 1.2 date 2000.05.13.08.45.09; author lukem; state Exp; branches 1.2.4.1; next 1.1; 1.1 date 2000.03.10.11.53.24; author lukem; state Exp; branches 1.1.1.1; next ; 1.22.2.1 date 2012.04.17.00.02.59; author yamt; state Exp; branches; next 1.22.2.2; 1.22.2.2 date 2012.10.30.18.49.10; author yamt; state Exp; branches; next ; 1.22.4.1 date 2012.02.23.18.25.51; author riz; state Exp; branches; next 1.22.4.2; 1.22.4.2 date 2012.06.23.22.54.56; author riz; state Exp; branches; next ; 1.13.4.1 date 2005.05.08.13.42.29; author riz; state Exp; branches; next ; 1.2.4.1 date 2000.08.09.19.09.48; author lukem; state Exp; branches; next 1.2.4.2; 1.2.4.2 date 2000.10.02.01.09.27; author lukem; state Exp; branches; next ; 1.1.1.1 date 2000.03.10.11.53.24; author lukem; state Exp; branches; next ; desc @@ 1.26 log @ Stop using the obsolete test(1) -o operator, use sh || instead. Prefer sh ! over test's ! (though that one is not completely obsolete). @ text @#!/bin/sh # # $NetBSD: sysdb,v 1.25 2016/04/23 21:24:31 dholland Exp $ # # PROVIDE: sysdb # REQUIRE: mountcritremote # BEFORE: DAEMON $_rc_subr_loaded . /etc/rc.subr name="sysdb" rcvar=$name start_cmd="sysdb_start" stop_cmd=":" extra_commands="devdb utmp services netgroup password" devdb_cmd="build_devdb" utmp_cmd="build_utmp" services_cmd="build_services" netgroup_cmd="build_netgroup" password_cmd="build_password" echo=: sysdb_start() { echo -n "Building databases:" echo=echo comma=" " $devdb_cmd $utmp_cmd $services_cmd $netgroup_cmd $password_cmd echo "." } check_file() { local src="$1" local db="$2" shift 2 if ! [ -e "$src" ]; then return fi if ! [ -f "$db" ] || [ "$src" -nt "$db" ]; then $echo -n "$comma${src##*/}" comma=", " "$@@" fi } build_services() { check_file /etc/services /var/db/services.cdb services_mkdb -q } build_netgroup() { check_file /etc/netgroup /var/db/netgroup.db netgroup_mkdb } build_devdb() { check_file /dev /var/run/dev.db dev_mkdb check_file /dev /var/run/dev.cdb dev_mkdb } build_password() { local p=/etc/master.passwd check_file $p /etc/spwd.db pwd_mkdb -w $p } 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). # local i for i in "" x; do if ! [ -f /var/run/utmp$i ]; then $echo -n "${comma}utmp$i" comma=", " install -c -m 664 -g utmp /dev/null /var/run/utmp$i fi done } load_rc_config $name run_rc_command "$1" @ 1.25 log @Avoid unnecessary use of basename(1). From Jukka Salmi a long, long time ago on a tech-kern far, far away. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.24 2012/06/03 21:42:45 joerg Exp $ d43 1 a43 1 if [ ! -e "$src" ]; then d46 1 a46 1 if [ \( ! -f "$db" \) -o \( "$src" -nt "$db" \) ]; then d84 1 a84 1 if [ ! -f /var/run/utmp$i ]; then @ 1.24 log @Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to depend on new devname_r(3) as heart. Add /dev/pts magic directly to devname(3). While it can lead to returning non-existing paths, the behavior is more consistent that way. Drop caching layer in devname(3), it doesn't buy anything for the common case of having access to the database. Teach devname(3) proper fallback behavior of scanning /dev. Create both old-style and new-style database for now in /etc/rc.d/sysdb. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.23 2012/02/21 12:30:32 nakayama Exp $ d47 1 a47 1 $echo -n "$comma$(basename "$src")" @ 1.23 log @Avoid rebuilding services database every boot time. The database has been renamed since the default was changed to CDB format. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.22 2011/09/02 07:13:28 mbalmer Exp $ d66 1 @ 1.22 log @Terminate line with a '.', not the word 'done', for consistency with other startup scripts. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.21 2009/06/18 22:00:04 christos Exp $ d55 1 a55 1 check_file /etc/services /var/db/services.db services_mkdb -q @ 1.22.2.1 log @sync with head @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.22 2011/09/02 07:13:28 mbalmer Exp $ d55 1 a55 1 check_file /etc/services /var/db/services.cdb services_mkdb -q @ 1.22.2.2 log @sync with head @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.22.2.1 2012/04/17 00:02:59 yamt Exp $ a65 1 check_file /dev /var/run/dev.cdb dev_mkdb @ 1.22.4.1 log @Pull up following revision(s) (requested by nakayama in ticket #27): etc/rc.d/sysdb: revision 1.23 Avoid rebuilding services database every boot time. The database has been renamed since the default was changed to CDB format. @ text @d3 1 a3 1 # $NetBSD$ d55 1 a55 1 check_file /etc/services /var/db/services.cdb services_mkdb -q @ 1.22.4.2 log @Pull up following revision(s) (requested by joerg in ticket #328): lib/libc/gen/devname.c: revision 1.22 distrib/sparc64/instfs/dot.profile: revision 1.7 distrib/i386/cdroms/install.sh: revision 1.3 tests/lib/libcurses/director/director.c: revision 1.10 lib/libc/include/reentrant.h: revision 1.15 distrib/amd64/cdroms/install.sh: revision 1.3 tests/include/t_paths.c: revision 1.12 share/man/man7/hier.7: revision 1.101 etc/rc.d/sysdb: revision 1.24 include/stdlib.h: revision 1.99 tests/lib/libcurses/Makefile: revision 1.3 distrib/sparc64/cdroms/installcd/install.sh: revision 1.3 distrib/i386/cdroms/Makefile.cdrom: revision 1.27 lib/libc/gen/ttyname.c: revision 1.25 usr.bin/tic/Makefile: revision 1.2 tools/compat/Makefile: revision 1.57 lib/libterminfo/compile.c: revision 1.7 lib/libc/gen/ttyname.c: revision 1.26 lib/libterminfo/compile.c: revision 1.8 tools/compat/Makefile: revision 1.59 tools/compat/cdbw.h: revision 1.1 distrib/i386/installimage/install.sh: revision 1.2 lib/libc/include/namespace.h: revision 1.154 usr.bin/tic/tic.c: revision 1.13 usr.bin/tic/tic.c: revision 1.14 usr.bin/tic/tic.c: revision 1.15 distrib/sets/lists/base/mi: revision 1.996 usr.bin/tic/tic.c: revision 1.16 usr.sbin/dev_mkdb/dev_mkdb.8: revision 1.13 usr.bin/tic/tic.c: revision 1.17 usr.bin/tic/tic.c: revision 1.18 tools/compat/cdbr.h: revision 1.1 distrib/sparc64/instfs/list: revision 1.25 usr.bin/tic/tic.c: revision 1.19 lib/libc/cdb/cdbw.c: revision 1.4 lib/libc/cdb/cdbw.3: revision 1.4 lib/libc/cdb/cdbw.3: revision 1.5 share/terminfo/Makefile: revision 1.3 usr.sbin/dev_mkdb/dev_mkdb.c: revision 1.29 usr.sbin/dev_mkdb/Makefile: revision 1.8 lib/libc/gen/ttyname.3: revision 1.23 lib/libc/gen/ttyname.3: revision 1.24 lib/libc/cdb/cdbr.c: revision 1.3 include/cdbw.h: revision 1.2 distrib/sparc64/cdroms/installcd/Makefile: revision 1.15 lib/libc/gen/devname.3: revision 1.12 tools/compat/compat_defs.h: revision 1.85 tools/compat/compat_defs.h: revision 1.86 lib/libterminfo/term_private.h: revision 1.10 lib/libterminfo/term.c: revision 1.14 usr.bin/tic/tic.1: revision 1.10 lib/libterminfo/term.c: revision 1.15 lib/libterminfo/Makefile.hash: revision 1.5 lib/libterminfo/term.c: revision 1.16 distrib/amd64/installimage/install.sh: revision 1.2 share/man/man5/rc.conf.5: revision 1.152 distrib/sets/lists/tests/mi: revision 1.472 distrib/amd64/cdroms/Makefile.cdrom: revision 1.7 include/paths.h: revision 1.41 bin/ps/ps.1: revision 1.101 lib/libterminfo/terminfo.5.in: revision 1.16 usr.bin/tic/tic.c: revision 1.20 lib/libterminfo/terminfo.5.in: revision 1.17 Prefer __printflike. Use queue(3) Replace linear lookup with hash table, reducing runtime by 60%. Use e* from util.h. One more strdup -> estrdup. Maintain nalias and nterm on the fly. Add void for ttyslot prototype. Use memcmp in place of strncmp, since length is known to no longer than either of the arguments. Fix a number of memory leaks. Keep final loop of the cleanup in tic(1) under #ifdef __VALGRIND__ though. Add __predict_true / __predict_false definitions. Add a special seeder for cdbw_output that gives stable results. Hook up cdbw(3) for the tool build. Prototype for cdbw_stable_seeder. Provide a usable thr_once for !_REENTRANT Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to depend on new devname_r(3) as heart. Add /dev/pts magic directly to devname(3). While it can lead to returning non-existing paths, the behavior is more consistent that way. Drop caching layer in devname(3), it doesn't buy anything for the common case of having access to the database. Teach devname(3) proper fallback behavior of scanning /dev. Create both old-style and new-style database for now in /etc/rc.d/sysdb. Switch terminfo(3) to cdb(5). Fix typos. Make Alan Barrett happy and add (). Add cdbr(3) support to tools/compat. Bump date for previous. Relax consistency to make it possible to match valid entries. Prefix devname's buffer with /dev/ as ttyname is supposed to return the full path. Reported by Dave Huang. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.22.4.1 2012/02/23 18:25:51 riz Exp $ a65 1 check_file /dev /var/run/dev.cdb dev_mkdb @ 1.21 log @now that pwd_mkdb does not change the version, warn if we still have version 0 databases. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.20 2007/08/26 23:55:50 dyoung Exp $ d34 1 a34 1 echo " done" @ 1.20 log @Let an rc variable, sysdb=YES|NO, control the building of the system databases. Defaults to YES. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.19 2007/05/16 01:24:42 christos Exp $ d71 1 a71 1 check_file $p /etc/spwd.db pwd_mkdb $p @ 1.19 log @check if the source exists, not that it is a file. Reported by Blair Sadewitz @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.18 2007/05/13 17:23:56 christos Exp $ d13 1 @ 1.18 log @don't attempt to build the db file if the src file does not exist. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.17 2007/05/10 17:45:50 christos Exp $ d42 1 a42 1 if [ ! -f "$src" ]; then @ 1.17 log @Move .db files for services and netgroup to /var/db per gimpy's request. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.16 2007/05/08 20:33:59 christos Exp $ d40 1 d42 3 @ 1.16 log @- don't trash utmp{,x} needlessly - also support netgroup services and password - pretty print @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.15 2004/10/12 13:23:44 lukem Exp $ d50 1 a50 1 check_file /etc/services /etc/services.db services_mkdb -q d55 1 a55 1 check_file /etc/netgroup /etc/netgroup.db netgroup_mkdb @ 1.15 log @Fix for /bin/ksh, from Jukka Salmi in PR 27232. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.14 2004/08/13 18:08:03 mycroft Exp $ d15 1 a15 1 extra_commands="devdb utmp" d18 4 d25 3 a27 1 echo "Building databases..." d30 26 d60 7 a66 5 if [ /var/run/dev.db -nt /dev ]; then : # it's fine else dev_mkdb fi d76 8 a83 2 install -c -m 664 -g utmp /dev/null /var/run/utmp install -c -m 664 -g utmp /dev/null /var/run/utmpx @ 1.14 log @Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this for a speedup by doing: $_rc_subr_loaded . /etc/rc.subr @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.13 2003/05/11 18:17:30 ragge Exp $ d29 1 a29 1 # it's fine @ 1.13 log @Remove kvm_mkdb, it's not used anymore. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.12 2003/02/24 01:04:45 atatat Exp $ d10 1 a10 1 . /etc/rc.subr @ 1.13.4.1 log @Pull up revision 1.15 (requested by lukem in ticket #1266): Fix for /bin/ksh, from Jukka Salmi in PR 27232. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.13 2003/05/11 18:17:30 ragge Exp $ d29 1 a29 1 : # it's fine @ 1.12 log @Execute the actual command as it's set instead of calling the sh routine directly. This allows one to to override a specific command via the use of /etc/rc.conf.d/sysdb. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.11 2002/10/08 16:21:52 atatat Exp $ d15 1 a15 2 extra_commands="kvmdb devdb utmp" kvmdb_cmd="build_kvmdb" a21 1 $kvmdb_cmd a23 10 } build_kvmdb() { # Build ps databases. If this kernel supports # machdep.booted_kernel, use that to build the KVM db so dmesg # will run work when we boot /netbsd.new, etc. # booted_kernel=`sysctl -n machdep.booted_kernel 2>/dev/null` kvm_mkdb "${booted_kernel:-/netbsd}" @ 1.11 log @Reorganize the sysdb script so that lkm{1,2,3} can request that the dev database be rebuilt after loading modules. Loading modules might create new nodes in /dev, but the dev database is being initialized too soon for lkm2 and lkm3. This means that, eg, /dev/xf86 (typically marked AFTERMOUNT and loaded by lkm2) will show up properly. Reviewed by lukem. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.10 2002/09/16 02:23:31 perry Exp $ d23 3 a25 3 build_kvmdb build_devdb build_utmp @ 1.10 log @create a utmpx with the same permissions as utmp Solves pr 18282, although very differently. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.9 2002/03/22 04:34:00 thorpej Exp $ d15 4 d22 8 a33 1 echo "Building databases..." d36 1 a36 1 dev_mkdb d38 11 @ 1.9 log @Correct the "direction" of the barrier dependencies (DAEMON, LOGIN, NETWORKING, and SERVERS) by specifying that certain things should come BEFORE a given barrier, rather than having the barrier REQUIRE a service. This allows scripts to be removed without having to edit the barrier dependencies. As discussed on tech-userlevel, and approved by Luke. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.8 2001/04/16 01:38:15 lukem Exp $ d27 4 a30 3 # Re-create /var/run/utmp, which is deleted by mountcritlocal # but can't be recreated by it because install and chown may # not be available then (possibly no /usr). d33 1 @ 1.8 log @wrap kvm_mkdb arg in "s. from adam laurie in pr 12664 @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.7 2000/10/14 07:33:39 nisimura Exp $ d8 1 @ 1.7 log @Add missing -n option of sysctl(8) booted_kernel name retrival. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.6 2000/10/09 05:02:14 nisimura Exp $ d23 1 a23 1 kvm_mkdb ${booted_kernel:-/netbsd} @ 1.6 log @- avoid -a or -o logical operator of test command as possible. They would introduce syntaxical ambiguousity, and having concatenation with && or || costs nothing because our sh(1) has test(1) builtin. - use elif construct to avoid dungling else-ifs. - while-read construct does not need enclosed by a sub-shell. - variable detection could be done in eval args=\$ifconfig_$int - smart variable substitution occationally saves lines and extra command invocations. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.5 2000/09/19 13:04:39 lukem Exp $ d22 1 a22 1 booted_kernel=`sysctl machdep.booted_kernel 2>/dev/null` @ 1.5 log @- only perform the checkyesno on the variable named in $rcvar (rather than implicitly using $name if $rcvar isn't set), and always perform this check, even when using start_cmd (et al). this check is performed before the pidcmd is run, speeding up scripts that weren't going to be run anyway. this should speed up booting slow systems. - take advantage of the above and remove start_precmd="checkyesno foo" in scripts that use start_cmd. - explicitly set rcvar=foo in the rc.d/foo scripts which have an equivalent rc.conf entry - fix `rcvar' and `restart' when $rcvar isn't set. these above changes fix PR [bin/11027]. - when doing `force*', ignore the return value of *_precmd. this fixes PR [bin/10781]. - rename what sysdb provides from `databases' to `sysdb', to reflect the name of the script. - improve the comments in rc.subr @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.4 2000/07/27 13:58:49 lukem Exp $ d22 2 a23 6 sysctl machdep 2>/dev/null | grep -q booted_kernel if [ $? -eq 0 ] ; then kvm_mkdb `sysctl -n machdep.booted_kernel` || kvm_mkdb /netbsd else kvm_mkdb /netbsd fi @ 1.4 log @move recreating /var/run/utmp from mountcritlocal (where /var/run is purged but /usr/bin/install is not available) to sysdb. problem noted by Matthias Drochner. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.3 2000/07/26 00:11:49 lukem Exp $ d6 1 a6 1 # PROVIDE: databases @ 1.3 log @* add new dummy dependancy `NETWORK' to be REQUIREd by services which need networking to be operational before starting, and use as appropriate. NETWORK depends upon network and dhclient. * move the guts of systemfs into mountcritlocal * replace the dependancy on systemfs with mountcritremote, and remove the former. * SERVERS now also depends upon ppp Notes: * dhclient (and others) needs /var to be a $critical_filesystem_beforenet * dhclient now starts before syslogd (because the latter needs /usr, and /usr might need dhclient to be mounted) Should fix PRs: [install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641] @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.2 2000/05/13 08:45:09 lukem Exp $ d29 6 @ 1.2 log @Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf. This allows us or a user to change the configuration file method in one place - rc.subr - without having to edit all of the rc.d/* files. @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.1.1.1 2000/03/10 11:53:24 lukem Exp $ d7 1 a7 1 # REQUIRE: systemfs @ 1.2.4.1 log @pull up the following approved by: thorpej etc/rc.d/DAEMON 1.3 etc/rc.d/LOGIN 1.3 etc/rc.d/NETWORK 1.1 etc/rc.d/SERVERS 1.2 etc/rc.d/cron 1.4 etc/rc.d/dhclient 1.6 etc/rc.d/dmesg 1.4 etc/rc.d/inetd 1.5 etc/rc.d/lkm1 1.3 etc/rc.d/lkm2 1.3 etc/rc.d/lkm3 1.4 etc/rc.d/motd 1.3 etc/rc.d/mountcritlocal 1.3-1.4 etc/rc.d/mountcritremote 1.3 etc/rc.d/mountd 1.7 etc/rc.d/network 1.12 1.14 etc/rc.d/ntpdate 1.4 etc/rc.d/ppp 1.3-1.4 etc/rc.d/pwcheck 1.3 etc/rc.d/rpcbind 1.4 etc/rc.d/sshd 1.3-1.5 etc/rc.d/swap1 1.5 etc/rc.d/swap2 1.4 etc/rc.d/sysdb 1.3-1.4 etc/rc.d/syslogd 1.5-1.6 etc/rc.d/systemfs REMOVE etc/rc.d/virecover 1.3 etc/rc.d/wscons 1.4 etc/rc.d/xdm 1.5 summary: * reword descriptions * add '# KEYWORD: shutdown' to some of these scripts so that only they get run at shutdown time. now, only scripts with the keyword `shutdown' will be run by /etc/rc.shutdown, which speeds up shutdown and makes it more robust * add new dummy dependancy `NETWORK' to be REQUIREd by services which need networking to be operational before starting, and use as appropriate. NETWORK depends upon network and dhclient. * move the guts of systemfs into mountcritlocal * replace the dependancy on systemfs with mountcritremote, and remove the former. * SERVERS now also depends upon ppp * move recreating /var/run/utmp from mountcritlocal (where /var/run is purged but /usr/bin/install is not available) to sysdb. problem noted by Matthias Drochner. * share the same load_rc_config between the lkm* scripts * network: Don't warn that $hostname isn't set if the hostname is already set. * network: reenable stop_cmd now that network doesn't get run at shutdown * add sshd startup script * use "load_rc_config swap" for swap1 and swap2 * syslog requires databases from sysdb which creates /var/run/utmp. Should fix PRs: [install/9853] [bin/10002] [misc/10349] [port-i386/10633] [misc/10641] @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.4 2000/07/27 13:58:49 lukem Exp $ d7 1 a7 1 # REQUIRE: mountcritremote a28 6 # Re-create /var/run/utmp, which is 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 @ 1.2.4.2 log @pull up rev 1.5 (approved by thorpej): - always use $rcvar to determine the name of the var to checkyesno - fix force* @ text @d3 1 a3 1 # $NetBSD: sysdb,v 1.5 2000/09/19 13:04:39 lukem Exp $ d6 1 a6 1 # PROVIDE: sysdb @ 1.1 log @Initial revision @ text @d3 1 a3 1 # $NetBSD$ a9 1 . /etc/rc.conf d31 1 @ 1.1.1.1 log @rc.d scripts derived from /etc/rc @ text @@