Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Apr 1995 01:39:33 -0700
From:      asami@cs.berkeley.edu (Satoshi Asami | =?ISO-2022-JP?B?GyRCQHUbKEI=?= =?ISO-2022-JP?B?GyRCOCsbKEIgGyRCOC0bKEI=?=)
To:        rgrimes@gndrsh.aac.dev.com
Cc:        adam@FreeBSD.org, pst@FreeBSD.org, ports@FreeBSD.org
Subject:   Re: cnews fails if user "news" doesn't exist
Message-ID:  <199504180839.BAA03357@silvia.HIP.Berkeley.EDU>
In-Reply-To: <199504180818.BAA11997@gndrsh.aac.dev.com> (rgrimes@gndrsh.aac.dev.com)

next in thread | previous in thread | raw e-mail | index | archive | help
 * > But a "make world" doesn't update master.passwd, so we still need to
 * > do something about this from the ports standpoint (for people who did
 * > a source upgrade).  Any ideas?
 * 
 * Use grep -q to find out if the user and the group exists, if it does not
 * fail the make and tell the user to add the news accounts???

I was thinking more about using "id".  The grep idea (I assume you are
saying we should search /etc/passwd, right?) may fail when the site is
using NIS.

I guess we can put this in the pre-fetch target for all our news ports 
(so the user can solve the problem first).  Something like:

#!/bin/sh
if ! id -u news > /dev/null 2>&1; then
  echo "You need an account \"news\" to install this package."
  if [ `id -u` != 0 ]; then
    echo "Please become root and either use \"adduser\" or try \"make\" again."
    exit 1
  fi
  echo "Let me start an adduser for you...."
  sleep 5
  adduser
  if ! id -u news > /dev/null 2>&1; then
    echo "Hey!  I told you to add an account \"news\"!"
    echo "Well, I'm giving up now, but please try again, okay."
    exit 1
  fi
fi

What do you guys think?

Satoshi



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