SUMMARY: Problem with /usr/ucb/installB

From: Thomas Walter (tbw@katahdin.hunter.cuny.edu)
Date: Wed Jan 14 1998 - 10:08:22 CST


HERE IS THE ORIGINAL QUESTION................

I am trying to run the following shell program that uses /usr/ucb/install;

---------------------------------------------------------------
#!/bin/sh
#
# Script that will copy a file in every home directory
# with the correct ownership and permissions.
#
# Make sure the script is executed from a machine where
# - NIS is available
# - HOMEDIRS are available
# - FILE is available
#
# NOTE: The script won't overwite the file

# First some variable
HOMEDIRS=/home/everest # Location of all Home dirs
FILE=/usr/dt/config/sys.dtprofile # The file to copy
DEST=.dtprofile # Name of the destination
MODEID=0600 # Mode of the new file

for DIR in $HOMEDIRS/*
do
        USERID=`ypcat passwd | grep $DIR | awk -F: '{ print $3 }'`
        GROUPID=`ypcat passwd | grep $DIR | awk -F: '{ print $4 }'`
        /usr/ucb/install -c -g $GROUPID -m $MODEID -o $USERID $FILE $DIR/$DEST
done

exit 0
------------------------------------------------------------------

When executed the program loops and produces the following error messages;

install: unknown group 30 (30 is our staff group)
or
install: unknown group 10 (10 is our student group)

If I eliminate the GROUPID line and the -g option on the /usr/ucb/install line the
program loops and gives the following error message for every userid;

install: unknown user 111 (or whatever the userid is).

----------------------------------------------------------------------------

I'm running the script on my NIS server, a SPARC 1000E running Solaris 2.4, that has
all home directories on local disks.

If I use the chown command and the numerical userid or the chgrp and numerical
group id I have no problems. ypcat passwd produces normal output.

============================================================================================

THANK YOU TO TIM CARLSON, NICKY AYOUB, JIM HARMON, DAN PRITTS, CASPER DIK, David Thorburn-Gundlach,
AND Stephen J. LeClaire.

AND NOW FOR THE ANSWER;

Install had never worked with gid #'s or uid #'s. It has to have the name
of the group or user.

==================================================================================

Thomas Walter
Director
Spatial Analysis and Remote Sensing (SPARS) Laboratory
Geography Department
Hunter College of the City University of New York
695 Park Avenue
New York, NY 10021

(212)772-5457 Office
(212)772-5268 Fax
tbwalter@everest.hunter.cuny.edu



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:29 CDT