various local changes. Notes: Mon Feb 13 09:01:56 EST 2006 rsc I don't understand the part about setting SCHED to generic. The only sched is still called FIFO on my system. The sleep 5 might be shortened, but it is there to make give the spooler time to die. UNLOCK removes the file, but the lock process might take up to a second to notice that the lock file is gone and send a kill note to the daemon already running. Mon Feb 13 09:06:36 EST 2006 rsc I did apply the comment fixes. Reference: /n/sources/patch/sorry/lp-local Date: Mon Feb 13 01:52:39 CET 2006 Reviewed-by: rsc --- /sys/src/cmd/lp/lp.rc Mon Feb 13 01:52:26 2006 +++ /sys/src/cmd/lp/lp.rc Mon Feb 13 01:52:24 2006 @@ -1,6 +1,7 @@ #!/bin/rc -# This program enqueues the file to be printed and starts the daemon, when necessary. -# Make changes to /sys/src/cmd/lp/lp.rc. Changes made directly to /rc/bin/lp will be lost. +# lp - enqueues the file to be printed and starts the daemon, when necessary. +# Make changes to /sys/src/cmd/lp/lp.rc; +# changes made directly to /rc/bin/lp will be lost. rfork en # so that environment and name space are not polluted # @@ -52,7 +53,6 @@ -y y page offset in inches ' -# umask 000 # this doesn't work in plan 9 if (~ $#sysname 0) THIS_HOST=plan9 if not { @@ -138,6 +138,8 @@ LPLOC=`{echo $LPDEST|sed 's/^(.*)\/(.*)/\1/'} LPDEST=`{echo $LPDEST|sed 's/^(.*)\/(.*)/\2/'} } + +# parse devices LPDLINE=`{grep '^'$LPDEST'[ ]' $LPLIB/devices} if (! ~ $status '') { echo 'device '$LPDEST' is not in '$LPLIB'/devices' >[1=2] @@ -154,6 +156,11 @@ KILL=$LPDLINE(10) DAEMON=$LPDLINE(11) SCHED=$LPDLINE(12) + +# supply defaults +if (~ $#SCHED 0 || ~ $SCHED '') + SCHED=generic # was FIFO + if (~ $KILLFLAG 1) switch ($KILL) { case -; echo kill option not available on $LPDEST >[1=2] @@ -189,7 +196,9 @@ if not { echo restarting daemon for printer $LPDEST >[1=2] UNLOCK $LPSPOOL/$LPDEST - sleep 5 + # this *may* be to give rm of the queue dir a chance, + # but that won't work anyway, due to presence of .seqno file. +# sleep 5 } # run daemon