SUMMARY: Printer setup with JumpStart

From: Andrew Watkins (andrew@dcs.bbk.ac.uk)
Date: Thu Jul 20 1995 - 01:47:36 CDT


----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 60

Thanks for all the replies:

I wrote:
>
> I have not cracked the timezone problem yet, but I will have
> another bash at that today.
>
> Question: What I am after is any good ways of setting up the
> printers on the new machine. At the moment the only way I can see
> is to modify the "/etc/lp/*" files manually.
>
> This should work but it a shame you can't use the correct lp commands.

Well the answers are to place a script in /etc/init.d which
is executed first time the New Machine is booted:

1) Make sure JumpStart puts a script in right location:
                /a/etc/init.d/buildprinters
2) link this in /a/etc/rc2.d/S99buildprinters

What then happens is this file is executed the first time the machine
is booted and then it deletes itself.
I have inclosed the following scripts:
i) printer install
ii) patch install

OR)
Create a finish script which uses the chroot command, therefore it is
then possible to use the true "lp commands".

Also, see inclosesed script "installprinters"

Thanks to the following:
David Lee <T.D.Lee@durham.ac.uk>
leclerc@austin.asc.slb.com
Michael.Bennett@mail.esrin.esa.it
aclarke@mpc-uk.com (Anthony Clarke)
checkedg@eee.bham.ac.uk (Dr. Dave Checketts)
root@wisdom.maf.nasa.gov (Mark Hargrave)
cbabcock@rsa.hisd.harris.com (Cary Babcock)
Al.Venz@seag.fingerhut.com (Al Venz)
john@starinc.com (John Malick)
"Douglas L. Acker" <dacker@sun84.aws.waii.com>
Stuart.Little@ssu.stcssl.co.uk

Cheers

Andrew

PS.
I solved the timezone problem:
Setup NIS 4.1.3 Server
#cat > /etc/timezone
GB <nis-domain>
^D

# make -n timezone
----------
X-Sun-Data-Type: text
X-Sun-Data-Name: S99patches
X-Sun-Content-Lines: 35
X-Sun-Content-Length: 1298
X-Sun-Charset: us-ascii

#!/bin/sh
###################################################################
# Program : S99patches
# Version : 1.0 Dated 3/23/95
# Purpose : install patches on client machines
# Author : Al Venz - Euler Solutions
#################################################################
PATH=/usr/bin:/usr/sbin:/etc
OS=`uname -r`

#################################################################
# Figure out which server to mount
#################################################################
PATCHSERVER="IP_OF_JUMPSTART_SERVER"

#################################################################
# Mount the patch server
#################################################################
mkdir -p /patch
mount $PATCHSERVER:/export1/patch /patch

#################################################################
# Run the installpatch program
#################################################################
/patch/install_patch

#################################################################
# Remove myself
#################################################################
rm $0

#################################################################
# Reboot with "-r" option for good measure
#################################################################
reboot -- -r
----------
X-Sun-Data-Type: default
X-Sun-Data-Name: buildprinters
X-Sun-Content-Lines: 54
X-Sun-Content-Length: 1394
X-Sun-Charset: us-ascii

#!/bin/sh

case "$1" in

'start')

        #
        # add all the commands to create the printers
        #
        #
        #
         lpsystem -t bsd <server>
         lpadmin -p <printer> -s <server>!<printer>
         lpadmin -p <printer> -T unknown -I any
         accept <printer>
         enable <printer>
        #
         cd /etc/lp/fd
         lpfilter -f download -F download.fd
         lpfilter -f dpost -F dpost.fd
         lpfilter -f postdaisy -F postdaisy.fd
         lpfilter -f postdmd -F postdmd.fd
         lpfilter -f postio -F postio.fd
         lpfilter -f postior -F postior.fd
         lpfilter -f postmd -F postmd.fd
         lpfilter -f postpages -F postpages.fd
         lpfilter -f postplot -F postplot.fd
         lpfilter -f postprint -F postprint.fd
         lpfilter -f postreverse -F postreverse.fd
         lpfilter -f posttek -F posttek.fd
         lpfilter -f pr -F pr.fd
        # start the printers
        /etc/init.d/lp start

        # this script is meant to be executed once for configuring the printers
        # remove the startup link after the first execution
        rm -f /etc/rc2.d/S99buildprinters
        ;;

'stop')
        #
        # add all the commands to stop the printers
        #
        #
         lpadmin -x <printer>
        ;;
*)
        echo "Usage: /etc/init.d/buildprinters.default { start | stop }"
        ;;
esac

----------
X-Sun-Data-Type: default
X-Sun-Data-Name: installprinters
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 26

#!/bin/sh
# printer_remote.fin
B=/a # base directory of all absolute paths (/a during installation)

cat <<DONE >$B/tmp/pr.$$
#!/bin/sh
 
/usr/lib/lpsched

# Repeat lpysystem, lpadmin, accept, and enable
# for each remote printer you want to set up.

lpsystem -t bsd machine1
lpsystem -t s5 machine2
lpadmin -p lp -s machine1 -I any
lpadmin -p sumo -s machine2 -I any
accept lp sumo
enable lp sumo
lpshut
DONE

chmod +x $B/tmp/pr.$$

chroot $B /tmp/pr.$$
rm $B/tmp/pr.$$



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