Subject: Install script for Solaris 2

From: Vidiot <[email-masked]>
Date: Tue, 21 Jan 1997 17:41:24 -0600 (CST)

In the past I posted an install script for SunOS 4.1.3.  Well, now I am
changing my CPU to a Sun Ultra 1 140, which means Solaris 2.5.1.

I've upgraded the script for Solaris 2 and have attached it below.  This
definately helps set up the required files and directories.  The only thing
I am not positive about is the timezone information, since it operates a
little differently under Solaris 2, i.e., there isn't a localtime file in
the main Solaris 2 installation.

In any event, the script works for me and the ls/dir command errors is not
there after using this script.

Enjoy.

MB
-- 
System Administrator - Finnigan FT/MS - Madison WI. <URL:http://www.ftms.com/>
e-mail: [email-masked]
phone: (608) 273-8262 ext: 612  fax: (608) 273-8719
Visit - <URL:http://www.cdsnet.net/vidiot/>  (Your link to Star Trek and UPN)

#!/bin/sh

# Set this to whoever will maintain your ftp site. root is probably a good bet.
# Your username is another possibility.  ftp is NOT!  No directories or files
# inside ~ftp should be owned by ftp.
YOU=root

# Change time info later in script

# Get the UID of YOU and ftp
YOUUID=`grep "^$YOU:" /etc/passwd | cut -d: -f3`
if [ "x" = "x$YOUUID" ]; then
  echo User $YOU not found
  exit
fi
FTPDIR=`grep "^ftp:" /etc/passwd | cut -d: -f6`
if [ "x" = "x$FTPDIR" ]; then
  echo ftp home directory not found
  exit
fi

# Find the correct libc.so and libdl.so
LIBC=`ls /usr/lib/libc.so.* | tail -1`
LIBDL=`ls /usr/lib/libdl.so.* | tail -1`

install -d -u $YOU -g other -m 755 $FTPDIR
cd $FTPDIR
install -d -u root -g other -m 555 bin
install -c bin -u root -g other -m 111 /usr/bin/ls
install -d -u root -g other -m 555 dev
install -d -u root -g other -m 555 etc
install -d -u $YOU -g other -m 722 incoming
install -d -u $YOU -g other -m 755 pub
install -d -u root -g other -m 555 usr
install -d -u root -g other -m 555 usr/lib
install -c usr/lib -u root -g other -m 555 /usr/lib/ld.so
install -c usr/lib -u root -g other -m 555 $LIBC
if [ "x" != "x$LIBDL" ]; then
install -c usr/lib -u root -g other -m 555 $LIBDL
fi
install -d -u root -g other -m 555 usr/share
install -d -u root -g other -m 555 usr/share/lib
install -d -u root -g other -m 555 usr/share/lib/zoneinfo
#
# Change the timezone info for your area
#
install -c usr/share/lib/zoneinfo -u root -g other -m 444 /usr/share/lib/zoneinfo/CST6CDT
mv usr/share/lib/zoneinfo/CST6CDT usr/share/lib/zoneinfo/localtime

mknod dev/zero c 3 12
chown root:other dev/zero
chmod 444 dev/zero

mknod dev/tcp c 11 42
chown root:other dev/tcp
chmod 444 dev/tcp

echo "other:*:0:" >etc/group
chown root:other etc/group
chmod 444 etc/group

echo "root:*:0:0:::" >etc/passwd
if [ $YOUUID != 0 ]; then
echo "ftpadmin:*:$YOUUID:0:::" >>etc/passwd
fi
chown root:other etc/passwd
chmod 444 etc/passwd

exit

---

From: Tom Lojewski <[email-masked]>
Date: Tue, 21 Jan 1997 16:48:42 -0800 (PST)

Vidiot writes:
> 
> The only thing
> I am not positive about is the timezone information...
> 

> install -c usr/lib -u root -g other -m 555 $LIBDL

I'm surprised this works.  But it's great if it does.  You're sure
you're not picking up SUNOS versions of the above files?  Is this the
machine that's currently ftp.ftms.com?  Or is the current one your
SunOS machine?  That machine is running SunOS libs.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Tom Lojewski  ([email-masked])   =+=     ProNet Consulting  Alameda, CA +
+                                   =+=                                    +
+ phone: (510)864-8633              =+=                  fax:(510)864-8637 +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

---

From: Vidiot <[email-masked]>
Date: Tue, 21 Jan 1997 20:27:31 -0600 (CST)

Tom Lojewski said:

<Vidiot writes:
<> 
<> The only thing
<> I am not positive about is the timezone information...
<> 
<> In any event, the script works for me and the ls/dir command errors is not
<> there after using this script.
<
<> install -c bin -u root -g other -m 111 /usr/bin/ls
<> install -c usr/lib -u root -g other -m 555 /usr/lib/ld.so
<> install -c usr/lib -u root -g other -m 555 $LIBC
<> install -c usr/lib -u root -g other -m 555 $LIBDL
<
<I'm surprised this works.  But it's great if it does.  You're sure
<you're not picking up SUNOS versions of the above files?  Is this the
<machine that's currently ftp.ftms.com?  Or is the current one your
<SunOS machine?  That machine is running SunOS libs.

The new machine is not on line yet.  I'm still using the SPARCstation 20
as the main machine.  The Ultra 1 140 is connected to the internal network
and stuff is being installed on it.  So, if you connect to ftms.com right
now, you will definately see SunOS stuff.

MB

---

From: [email-masked] (Koos van den Hout _U nix and we all_)
Date: Wed, 22 Jan 1997 09:26:09 +0100 (MET)

> now, you will definately see SunOS stuff.

Do a check with 'which install' to see which one you're running. Solaris
fresh installs have this annoying habit of putting /usr/ucb a bit
early in your path giving you the most horrid yes/no sunos compatibility.

And /usr/ucb/install and /usr/sbin/install differ.

					     Grtx KH

-- 
  Koos van den Hout,     Internetter, Unix freak, ISFJ and BBS SysOp at large
  [email-masked] (Work)  <-- finger -l for PGPkey      Fax: +31-30-2586290
  [email-masked] (Home)                      Workphone: +31-30-2586287
  http://www.cetis.hvu.nl/~koos/   Looking for a license plate with "RFC 822"

---

From: Vidiot <[email-masked]>
Date: Wed, 22 Jan 1997 09:20:45 -0600 (CST)

Koos van den Hout said:
<Quoting Vidiot, who wrote :
<
<> <> install -c bin -u root -g other -m 111 /usr/bin/ls
<> <> install -c usr/lib -u root -g other -m 555 /usr/lib/ld.so
<> <> install -c usr/lib -u root -g other -m 555 $LIBC
<> <> install -c usr/lib -u root -g other -m 555 $LIBDL
<> <
<> <I'm surprised this works.  But it's great if it does.  You're sure
<> <you're not picking up SUNOS versions of the above files?  Is this the
<> <machine that's currently ftp.ftms.com?  Or is the current one your
<> <SunOS machine?  That machine is running SunOS libs.
<> 
<> The new machine is not on line yet.  I'm still using the SPARCstation 20
<> as the main machine.  The Ultra 1 140 is connected to the internal network
<> and stuff is being installed on it.  So, if you connect to ftms.com right
<> now, you will definately see SunOS stuff.
<
<Do a check with 'which install' to see which one you're running. Solaris
<fresh installs have this annoying habit of putting /usr/ucb a bit
<early in your path giving you the most horrid yes/no sunos compatibility.

picard.ZROOT <177> which install
/usr/sbin/install

<And /usr/ucb/install and /usr/sbin/install differ.

You are correct.  Keep in mind that running the wrong install will cause
it to fail with an error.  Early in the game the PATH was changed to move
/usr/ucb/ after /usr/sbin/.

I will change my copy of the script so that it only uses the /usr/ucb/
install.

Nice catch.

MB