[comp.sys.sun] Sun-Spots Digest, v6n186

Sun-Spots-Request@RICE.EDU (William LeFebvre) (08/16/88)

SUN-SPOTS DIGEST         Monday, 15 August 1988       Volume 6 : Issue 186

Today's Topics:
                     Re: Tape Drive Allocator program
                       Re: Misery loves company...
                     Re: YA4.0B (yet another 4.0 bug)
        Re: getting your login environment in command(shell)tools 
                       Re: Inaccuracy of Sun clocks
                           Re: RPC help needed
             Re: Neurocomputing software/hardware for Sun 3's
                   Re: gnuemacs and keypad bindings (3)
                       A pox on thee, screenblank!
                   Running screenblank on a color 3/60
                      Excessive login time on a 3/50
                       anybody know if ncheck works

Send contributions to:  sun-spots@rice.edu
Send subscription add/delete requests to:  sun-spots-request@rice.edu
Bitnet readers can subscribe directly with the CMS command:
    TELL LISTSERV AT RICE SUBSCRIBE SUNSPOTS My Full Name
Recent backissues are available via anonymous FTP from "titan.rice.edu".
For volume X, issue Y, "get sun-spots/vXnY".  They are also accessible
through the archive server:  mail the request "send sun-spots vXnY" to
"archive-server@rice.edu" or mail the word "help" to the same address
for more information.

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

Date:    Wed, 10 Aug 88 10:34:20 PDT
From:    dougf@wega.caltech.edu (Doug Freyburger)
Subject: Re: Tape Drive Allocator program

There is a tape drive allocator program at Caltech that was originally
used on a VAX and now ported to our Suns called /etc/tpmount.  Our remote
and local backup scripts use it.

I'll send you a copy if you want it.

dougf@wega.caltech.edu

Douglas J Freyburger
Caltech 206-49
Pasadena, CA 91125

(818)356-2913

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

Date:    Wed, 10 Aug 88 11:03:43 PDT
From:    chessin@sun.com (Steve Chessin)
Subject: Re: Misery loves company...

>In article <1988.07.29.11.44.14.892.27239@rice.edu> you write:
>>From:    bzs%bu-cs.bu.edu@bu-it.bu.edu (Barry Shein)
>>> ...
>>>    ----- Transcript of session follows -----
>>> ld.so: swap space exhausted for mmap data of /usr/lib/libc.so.0.10
>>> 554 xxx@xxx... unknown mailer error 127
>
>Stop me if I'm wrong, but doesn't this imply that memory is full yet
>nothing else in memory is using /usr/lib/libc.so?

Too late to stop you, but you are incorrect.  Other processes can be using
libc.so.  The text segment is mapped read-only and private, so pages are
backed by the original file, and no swap space is required.  The data
segment is mapped read-write and private, so pages (once dirtied) must be
written to the swap area, and each process needs its own swap space for
that purpose.  (Bss is mapped from /dev/zero as read-write and private,
and must also be backed by swap space, but ld.so didn't get that far.
Besides, I don't think libc.so requires any bss.)

Each process that maps lib.so must reserve enough swap space to back its
data and bss portions.  The operating system doesn't allow swap space to
be overcommitted, even though not all processes may dirty all of their
data and bss pages.

It seems that the machine in question needs more swap space (which can be
a file; use mkfile(8) to make it and swapon(8) to tell the system about
it).

--Steve Chessin
chessin@sun.com or ...!sun!chessin

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

Date:    Wed, 10 Aug 88 10:04:20 PDT
From:    Brent Chapman <capmkt!brent@cogsci.berkeley.edu>
Subject: Re: YA4.0B (yet another 4.0 bug)
Reference: v6n175

In v6n175, Mike Smithwick writes:

# Can any explain this for me?? We just got 4.0 installed a couple of weeks
# ago. . .
# 
# I am in a sub-directory which has an executable called, "foo". My home
# directory also has "foo". When I go to execute it from the cwd, it runs
# home/foo instead. Using "which" sez that the other copy should run.
# ...
# Furthermore, this behavior is inconsistant, sometimes it seems to work,
# sometimes not.

I assume you are using csh for your shell, and that "~" (or $HOME, or some
other reference to your home directory) appears somewhere in your PATH,
and further, that "~" appears _before_ "." in your PATH. 

Unlike the Bourne shell (/bin/sh), the C shell (/bin/csh) doesn't actually
look at the directories in your search path when looking for a command to
run.  Instead, when csh starts up (or when you tell it "rehash"), it looks
through all of the directories in your PATH and builds a table of what
commands are where.  I suppose it actually builds two tables: one of the
commands in directories that appear _before_ "." in your PATH, and one of
the commands in directories that appear _after_ "." in your PATH.  When
you call for a command, it searches the "pre-." table, then actually scans
through the current directory, and finally looks through the "post-."
table.

-Brent
--
Brent Chapman					Capital Market Technology, Inc.
Computer Operations Manager			1995 University Ave., Suite 390
brent@capmkt.com				Berkeley, CA  94704
{lll-tis,uunet}!capmkt!brent			Phone:  415/540-6400

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

Date:    Wed, 10 Aug 88 15:21:18 -0400
From:    mesard@bbn.com
Subject: Re: getting your login environment in command(shell)tools 
Phone:   617-873-1878

> I always want my login environment in all command(shell)tools, yet I've
> never liked putting all my aliases and initialization into ~/.cshrc,
> because this tends to slow down (or break) C-shell scripts.

IMHO [[ "In My Humble Opinion"  --wnl ]], any shell script that
reads ~/.cshrc is already broken.  The first line of a C-shell script
should be 

	#! /bin/csh -f

The "-f" means "fast start".  It won't read ~/.cshrc or ~/.login.

You can also protect yourself against poorly written scripts by testing to
see if the current shell is interactive in ~/.cshrc and skipping
unnecessary commands:

	#### Only needed in interactive shells.
	if ($?prompt) then
		set prompt="`basename $cwd`> "
		alias cd 'chdir \!*;set prompt="`basename $cwd`> "'
		alias popd 'popd \!*;set prompt="`basename $cwd`> "'
		alias pushd 'pushd \!*;set prompt="`basename $cwd`> "'
		set history=25
		set filec=1
	endif

>From csh(1):

	Noninteractive shells leave the prompt variable unset.  Aliases and
	other commands in the .cshrc file that are only useful interactively,
	can be placed after the following test: if ($?prompt == 0) exit, to
	reduce startup time for noninteractive shells.

> I wrote the following program, 'start_sh'....

Sounds like reinventing the wheel to me.

> (Earlier
> issues of 'sun-spots' discussed the `which' command breaking because of
> commands placed in ~/.cshrc ).

If you're not happy with the standard which there are several others
floating around.  Enclosed is one that came off of Usenet recently which I
modified slightly.  It doesn't check your aliases which I considered more
of a nuisance than a feature.

-- 
unsigned *Wayne_Mesard();        MESARD@BBN.COM           BBN, Cambridge, MA

  "We cannot risk the peace and national security of this country on
  something as unexperienced as the Governor of Massachusetts."

                                                         -George Bush

=<>==<>==<>==<>==<>==<>==<snip>==<>==<>==<>==<>==<>==<>=
#! /bin/sh
#
# A faster version of which, that also prints ALL versions in your PATH,
# if you give the -a option.
# Accepts wildcards, e.g.: which '*uu*'. Silent if nothing found.
# Only works if test -x works...

if [ "$1" = "-a" ] 
then 
        shift
else
	firstonly='y'
fi

dirs=`echo $PATH|sed 's/^:/. /
     s/:$/ ./
     s/::/ . /g
     s/:/ /g'`

for cmd
do
   for d in $dirs
   do
      for file in $d/$cmd
      do
         if [ -x $file -a ! -d $file ]
         then 
	      echo $file
	      if [ $firstonly ] 
	        then break 2; fi
         fi
      done
   done
done

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

Date:    Tue, 9 Aug 88 18:35:28 EDT
From:    attcan!utzoo!henry@uunet.uu.net
Subject: Re: Inaccuracy of Sun clocks

>The sad fact is that the Sun-3 (and Sun-4) clock chips aren't too
>accurate...

No, they are fairly accurate (i.e. they keep good time), but they are
imprecise (i.e. their resolution is low).  (Okay, so I'm being picky...)

[[ Well: without semantics, we wouldn't understand each other.  --wnl ]]

>If someone comes up with a way to do better (i.e., if the chip supports
>better resolution, and the Sun structure declaration for its registers
>just doesn't mention it), I'd love to hear about it...

Alas, I fear you are out of luck.  100 Hz (10 ms) is the best that the
Intersil 7170 will do -- that is the highest resolution it will display to
the outside world.  It actually uses a 4 kHz tick internally, but that is
not brought out to an external interface, at least not one that's
mentioned in the datasheet.

The 7170 is actually an excellent timekeeping chip, considerably better
than the alternatives, but it's designed as a date-and-time box, not a
high-resolution interval timer.

	Henry Spencer @ U of Toronto Zoology
	uunet!attcan!utzoo!henry henry@zoo.toronto.edu

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

Date:    Wed, 10 Aug 88 13:58:16 PDT
From:    sxn@sun.com (Stephen X. Nahm)
Subject: Re: RPC help needed

Unfortuantely, you can't modify the timeout on broadcasts (non-broadcasts
can be modified with clnt_cntl() under SunOS 4.0 or RPCSRC 3.9).

If you want to change things, get a copy of RPCSRC 3.9 (the sun-spots
archive has it, as does various comp.sources.unix archives).  In the file
pmap_rmt.c there's a loop for doing the broadcast:

      /*
       * Basic loop: broadcast a packet and wait a while for response(s).
       * The response timeout grows larger per iteration.
       */
      for (t.tv_sec = 4; t.tv_sec <= 14; t.tv_sec += 2) {

As you can see, the total timeout will be about 40 seconds.  You can
change this on your copy of RPCSRC and build your own rpclib.a.  Link this
in with your application, and it will supercede the version from SunOS's
libc.

Steve Nahm

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

Date:    Wed, 10 Aug 88 11:02:47 EDT
From:    gotham!marine!fish@sun.com (Lorenz Fish)
Subject: Re: Neurocomputing software/hardware for Sun 3's

There has been a flurry of articles pertaining to neural network hardware
and software solutions recently.  The July 25 issue of
_Electronic_Engineering_Times_ mentions many vendors. The Anza Plus/VME
card for Sun3s is offered by Hecht-Nielson Neurocomputer in San Diego.
This comes with a five model application builder called Neurosoft.  Nestor
Inc (Providence RI) offers an application builder based on the work of its
founder Nobel laureate Leon Cooper using the Restricted Coulomb Energy
network model.  NeuralWare Inc. offers NeuralWorks Professional II for Sun
workstations with a sophisticated debugger.  The August 1 edition of
_Electronic_Products_ backs up most of this information and adds some good
background on the principles and history of neural network.  This is only
a sampler list of neural network product vendors but should get you off to
a start.

note- I have no affiliation with any of the above mentioned companies or
publications and the information and recommendations above are strictly
personal and not those of my employer.

	Lorenz Fish		uucp: ...sun!gotham!marine!fish
	Technical Analysis Group
	Marine Midland Bank
	Manhattan

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

Date:    Wed, 10 Aug 88 13:58:10 EDT
From:    suneast!rahthum!ppk@sun.com (Pravin Kumar)
Subject: Re: gnuemacs and keypad bindings (1)
Reference: v6n175

>From:    salt!pepper!gerber@uunet.uu.net (Andrew Gerber)
>
>How would one set up a .emacs file to bind the sun keyboard arrow keys
>([C [A [B [D) to move the cursor around in Emacs?

Here's some code from my .emacs file.  By the way, I work on a
Roadrunner (a sun386i).

;
; Set some keys
;
; Delete current map of ESC-[
(global-unset-key "\e[")
;
(global-set-key "\e[214z" 'beginning-of-buffer)
(global-set-key "\e[215z" 'previous-line)
(global-set-key "\e[216z" 'scroll-down)
(global-set-key "\e[217z" 'backward-char)
(global-set-key "\e[219z" 'forward-char)
(global-set-key "\e[220z" 'end-of-buffer)
(global-set-key "\e[221z" 'next-line)
(global-set-key "\e[222z" 'scroll-up)

pk

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

Date:    Wed, 10 Aug 88 09:05:54 EDT
From:    flynn@pixel.cps.msu.edu (Patrick Flynn)
Subject: Re: gnuemacs and keypad bindings (2)

Put "(setq sun-esc-bracket t)" in your .emacs file.  This disables the M-[
command and lets the Sun arrow keys work.

BTW, we're running gnuemacs 18.51.

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

Date:    Thu, 11 Aug 88 01:01:55 EDT
From:    Peter G. Ford <pgf@space.mit.edu>
Subject: Re: gnuemacs and keypad bindings (3)

Here is a sample ~/.emacs. Add other "((string-equal term-type ))" clauses
to handle other keyboards. Don't forget to global-unset-key substrings
that are already legal GnuEmacs commands, e.g. ESC-[ below.

(setq term-type (getenv "TERM"))
(cond
	((string-equal term-type "sun")
		(global-unset-key	"\e[")
		(global-set-key		"\e[A"		'previous-line)
		(global-set-key		"\e[B"		'next-line)
		(global-set-key		"\e[C"		'forward-char)
		(global-set-key		"\e[D"		'backward-char)
		(global-set-key		"\e[222z"	'scroll-up)
		(global-set-key		"\e[216z"	'scroll-down)
		(global-set-key		"\e[214z"	'beginning-of-buffer)
		(global-set-key		"\e[220z"	'end-of-buffer))
)

We put this file in a central location, "/usr/local/lib/emacs.init") on
NFS. All users load it via the following command in their ~/.emacs files.

(load "/usr/local/lib/emacs_init")

Peter G. Ford 			Inet:	pgf@space.mit.edu>
MIT Center for Space Research	Bitnet:	csrpgf@harvarda
Cambridge, MA 02139		Span:	MITCCD::PGF
+1 617 253 6485			Gte:	[PFORD/NASA] NASAMAIL/USA

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

Date:    Wed, 10 Aug 88 13:09:24 CDT
From:    chicken@shell.UUCP (Roy Johnson)
Subject: A pox on thee, screenblank!

1. Setting the -e parameter in screenblank to be LONGER than the -d
   parameter makes it very difficult (dare I say, impossible?) to recover.
   Even L1-a followed by k2 at the > prompt doesn't overcome it: you have to
   cycle power.  Avoid.

2. Is there a way to set the machine to resist remote screenblanks,
   clear_colormaps, et. al.?  These can get real ugly.

Remember, "A day with screenblank is a day without Sun-shine." ;^)

- Chickenman
(Roy Johnson)

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

Date:    Wed, 10 Aug 88 15:28:53 EDT
From:    mike@ninja.cc.umich.edu (Michael Nowak)
Subject: Running screenblank on a color 3/60

Ah, that's the ticket!  When I ran screenblank, I just said:

        screenblank >/dev/console

When I use

        screenblan </dev/console >/dev/console

It no longer freezes up under Suntools.  Thanks Joe!

-- Mike Nowak.

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

Date:    Wed, 10 Aug 88 13:57:57 pdt
From:    quintus!gregg@sun.com (W. Gregg Stefancik)
Subject: Excessive login time on a 3/50

I currently have 3 diskless 3/50's which are booted from a SUN 4/260 and
run SUN OS 3.5.  Ever since I started booting these machines from the
4/260, I have found that it takes 3-4 minutes to login to any of the
3/50's when the machine is completely idle.  Has anyone experienced this
problem?  Is there a solution?

Gregg Stefancik
Quintus Computer Systems
UUCP:     sun!quintus!gregg
Internet: gregg%quintus.com@sun.com

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

Date:    Wed, 10 Aug 88 11:18:46 PDT
From:    rusty@violet.berkeley.edu
Subject: anybody know if ncheck works

> From:    era@bierstadt.ucar.edu (Ed Arnold)
> 
> I'm on a 3/280 running 3.5.  My personal home directory resides in
> /dev/xy0d and my .cshrc file is inode 34910.  When (as root) I type in the
> command "ncheck -i 34910 /dev/xy0d", ncheck belches back the line
> "/dev/xy0d:" at me, then just sits there ... FOREVER.

Last time I tried it (about a month ago, on 3.5) it worked for me.  Yes,
it is slow, but it is even slower when you use the block device instead of
the raw device; try "ncheck -i 34910 /dev/rxy0d".  It will also blow up on
you if you try to run it on a disk that has more than HSIZE (I think)
inodes, where HSIZE is wired into the code.  (The 4.3 or 4.2 ncheck ports
to 3.5 easily so you can bump up HSIZE that way if you have the 4bsd vax
sources.)

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

End of SUN-Spots Digest
***********************