Subject: Re: /etc/services duplicates - suggestion for fixes
To: Thilo Jeremias <jeremias@optushome.com.au>
From: Thilo Jeremias <jeremias@optushome.com.au>
List: netbsd-users
Date: 06/20/2007 20:45:18
One more thought about the db business,
I believe there is a fallback (if no db available, use plain text file),
if that is so, it would definetly not hurt to do a time-stamp check and
if the /etc/services is newer than /var/db/services.db

a) log that the db might be out of sync in syslog
b) eventually even fallback in that case to use the plaintext

( something like that would have saved me a lot of pain)

Does this make sense?

:-)

thilo

Thilo Jeremias wrote:

> It also seems that the man-pages are partly wrong, ( the services.db 
> file is (on my system at least) not in /etc)
> so I would suggest to incorporate the patches below.
> As well as an indication in inetd.5 (if anyone feels the need for it)
>
> - sorry if the preveous tone was a bit harsh -
>
>
> cheers thilo
>
>
> Index: share/man/man5/services.5
> ===================================================================
> RCS file: /cvsroot/src/share/man/man5/services.5,v
> retrieving revision 1.8
> diff -u -r1.8 services.5
> --- share/man/man5/services.5    7 Aug 2003 10:31:17 -0000    1.8
> +++ share/man/man5/services.5    19 Jun 2007 12:10:59 -0000
> @@ -68,6 +68,11 @@
> Service names may contain any printable
> character other than a field delimiter, newline,
> or comment character.
> +.Pp
> +The database in /var/db/services.db +needs to be updated with +.Nm 
> services_mkdb
> +after changes to the services file have been applied.
> .Sh FILES
> .Bl -tag -width /etc/services -compact
> .It Pa /etc/services
> @@ -78,6 +83,7 @@
> .El
> .Sh SEE ALSO
> .Xr getservent 3
> +.Xr services_mkdb 8
> .Sh HISTORY
> The
> .Nm
> Index: usr.sbin/services_mkdb/services_mkdb.8
> ===================================================================
> RCS file: /cvsroot/src/usr.sbin/services_mkdb/services_mkdb.8,v
> retrieving revision 1.5
> diff -u -r1.5 services_mkdb.8
> --- usr.sbin/services_mkdb/services_mkdb.8    8 May 2007 20:14:59 
> -0000    1.5
> +++ usr.sbin/services_mkdb/services_mkdb.8    19 Jun 2007 12:10:59 -0000
> @@ -73,9 +73,9 @@
> exits zero on success, non-zero on failure.
> .Sh FILES
> .Bl -tag -width 24n -compact
> -.It Pa /etc/services.db
> +.It Pa /var/db/services.db
> The current services database.
> -.It Pa /etc/services.db.tmp
> +.It Pa /var/db/services.db.tmp
> A temporary file.
> .It Pa /etc/services
> The current services file.
>
>