Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jan 2002 12:55:23 +0200
From:      Sheldon Hearn <sheldonh@starjuice.net>
To:        arch@freebsd.org
Cc:        brian@FreeBSD.org
Subject:   Re: termcap versus terminfo 
Message-ID:  <23324.1011264923@axl.seasidesoftware.co.za>
In-Reply-To: Your message of "Thu, 17 Jan 2002 11:56:44 %2B0200." <22499.1011261404@axl.seasidesoftware.co.za> 

next in thread | previous in thread | raw e-mail | index | archive | help


On Thu, 17 Jan 2002 11:56:44 +0200, Sheldon Hearn wrote:

> Are there any objections to rebuilding termcap.db once a day from the
> periodic scripts?

I should know better than to ask questions like that on this list
without supporting patches.  See attached diff output for an idea of
what I'm proposing.

Brian, I've copied you on this because you're the periodic(8)
maintainer.

Ciao,
Sheldon.

Index: etc/defaults/periodic.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/periodic.conf,v
retrieving revision 1.18
diff -u -d -r1.18 periodic.conf
--- etc/defaults/periodic.conf	7 Dec 2001 23:57:38 -0000	1.18
+++ etc/defaults/periodic.conf	17 Jan 2002 10:48:30 -0000
@@ -64,6 +64,12 @@
 daily_clean_hoststat_days=3				# If not modified for
 daily_clean_hoststat_verbose="YES"			# Mention files deleted
 
+# 160.rebuild-db
+daily_rebuild_db_aliases="YES"
+daily_rebuild_db_login_conf="YES"
+daily_rebuild_db_passwd="YES"
+daily_rebuild_db_termcap="YES"
+
 # 200.backup-passwd
 daily_backup_passwd_enable="YES"			# Backup passwd & group
 
Index: etc/periodic/daily/Makefile
===================================================================
RCS file: /home/ncvs/src/etc/periodic/daily/Makefile,v
retrieving revision 1.8
diff -u -d -r1.8 Makefile
--- etc/periodic/daily/Makefile	1 Oct 2001 06:27:44 -0000	1.8
+++ etc/periodic/daily/Makefile	17 Jan 2002 10:48:30 -0000
@@ -6,6 +6,7 @@
 	130.clean-msgs \
 	140.clean-rwho \
 	150.clean-hoststat \
+	160.rebuild-db \
 	200.backup-passwd \
 	210.backup-aliases \
 	220.backup-distfile \
Index: etc/periodic/daily/160.rebuild-db
===================================================================
RCS file: etc/periodic/daily/160.rebuild-db
diff -N etc/periodic/daily/160.rebuild-db
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ etc/periodic/daily/160.rebuild-db	17 Jan 2002 10:48:30 -0000
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Rebuild db files in /etc that exist for performance reasons.
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+    . /etc/defaults/periodic.conf
+    source_periodic_confs
+fi
+
+rc=0
+
+for i in login.conf termcap; do
+    eval opt=\$daily_rebuild_db_`echo $i | tr . _`
+    case "$opt" in
+	[Yy][Ee][Ss])
+	    cap_mkdb /etc/$i
+	    if [ $? -ne 0 ]; then
+		    rc=1
+	    fi
+	    ;;
+	*)
+	    ;;
+    esac
+done
+
+case "$daily_rebuild_db_aliases" in
+    [Yy][Ee][Ss])
+	newaliases
+	if [ $? -ne 0 ]; then
+		rc=1
+	fi
+	;;
+    *)
+	;;
+esac
+
+case "$daily_rebuild_db_passwd" in
+    [Yy][Ee][Ss])
+	pwd_mkdb /etc/master.passwd
+	if [ $? -ne 0 ]; then
+		rc=1
+	fi
+	;;
+    *)
+	;;
+esac
+
+exit $rc
Index: share/man/man5/periodic.conf.5
===================================================================
RCS file: /home/ncvs/src/share/man/man5/periodic.conf.5,v
retrieving revision 1.39
diff -u -d -r1.39 periodic.conf.5
--- share/man/man5/periodic.conf.5	17 Jan 2002 10:35:48 -0000	1.39
+++ share/man/man5/periodic.conf.5	17 Jan 2002 10:48:32 -0000
@@ -334,6 +334,40 @@
 .Dq YES
 if you want to run
 .Pa /etc/news.expire .
+.It Va daily_rebuild_db_aliases
+.Pq Vt bool
+Set to
+.Dq YES
+to rebuild
+.Pa /etc/aliases.db
+from
+.Pa /etc/aliases .
+.It Va daily_rebuild_db_login_conf
+.Pq Vt bool
+Set to
+.Dq YES
+to rebuild
+.Pa /etc/login.conf.db
+from
+.Pa /etc/login.conf .
+.It Va daily_rebuild_db_passwd
+.Pq Vt bool
+Set to
+.Dq YES
+to rebuild
+.Pa /etc/pwd.db
+and
+.Pa /etc/spwd.db
+from
+.Pa /etc/master.passwd .
+.It Va daily_rebuild_db_termcap
+.Pq Vt bool
+Set to
+.Dq YES
+to rebuild
+.Pa /etc/termcap.db
+from
+.Pa /etc/termcap .
 .It Va daily_status_disks_enable
 .Pq Vt bool
 Set to

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?23324.1011264923>