Subject: install/22070: postinstall doesn't check for /etc/services
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jthyttin@lce.hut.fi>
List: netbsd-bugs
Date: 07/06/2003 08:25:19
>Number:         22070
>Category:       install
>Synopsis:       postinstall doesn't check for /etc/services
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    install-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 06 08:26:02 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Juha Hyttinen
>Release:        -current (several computers & dates)
>Organization:
HUT/LCE
>Environment:
NetBSD tarantula.private.hyttinen.org 1.6U NetBSD 1.6U (TARANTULA) #1: Sat Jun 28 17:29:08 EEST 2003  jthyttin@tarantula.private.hyttinen.org:/cvs/obj/sys/arch/i386/compile/TARANTULA i386
>Description:
While running postinstall after system upgrade, it doesn't check for
file /etc/services being up-to-date. I'm using freshly updated
src/etc/postinstall:

# $NetBSD: postinstall,v 1.61 2003/05/15 05:25:24 lukem Exp $

I do realize, that etcupdate is the documented method:

http://www.netbsd.org/Documentation/current/#etcupdate

but it would still be kinda cool if postinstall did it for me. After
all, there's couple of lines in the beginning of the script:

# postinstall
#       check for or fix configuration changes that occur
#       over time as NetBSD evolves.

The current checks in postinstall seemed to be concerning more or less
critical resources, so it would suggest /etc/services doesn't need to
be checked. However, /etc/services is quite static data (no local mods)
on most systems (or is it?), so IMHO it would be reasonable to keep it
up-to-date when changes at CVS tree occur.

On the other hand, I understand that postinstall would get bloated if
each and every check would be included. So feel free to discard this ;)
>How-To-Repeat:
- install NetBSD system
- get the latest sources
- build kernel & world
- run /usr/src/etc/postinstall
- compare /etc/services against /usr/src/etc/services
>Fix:
I have a simple patch, which just checks for any changes and copies the
file over, if needed. I copy/pasted it from the do_postinstall() check
at the same script:

--- /usr/src/etc/postinstall    2003-07-06 11:11:13.000000000 +0300
+++ postinstall 2003-07-06 11:10:59.000000000 +0300
@@ -850,6 +850,23 @@
        return ${failed}
 }
 
+#
+#      services
+#
+additem services "/etc/services being up to date"
+do_services()
+{
+       [ -n "$1" ] || err 2 "USAGE: do_services  fix|check"
+       op=$1
+       failed=0
+
+       compare_dir ${op} ${SRC_DIR}/etc ${DEST_DIR}/etc 644 \
+               services
+       failed=$(( ${failed} + $? ))
+
+       return ${failed}
+}
+
 
 #
 #      end of items

>Release-Note:
>Audit-Trail:
>Unformatted: