HP3000-L Archives

December 2000, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Donna Garverick <[log in to unmask]>
Reply To:
Donna Garverick <[log in to unmask]>
Date:
Tue, 5 Dec 2000 16:18:51 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
Mark Bixby wrote:

> :SHOWJOB is close, but I'd actually compare it to :SHOWPROC.

much better answer....

> It would also normally be an exercise for the reader to use the shell to obtain
> pids without using ps for things that don't write their pids to disk files, but
> since I have some time today to explain, here's the magic shell incantation:
>
>         serverprogram serverparms &; echo $! >/tmp/server.pid; wait

hmmmm.....  ok, let's pick on the two samba jobs.  they log on a mgr.samba and run
<blah>.samba.pub -D (from the ci).  since mark's example has to be done in the
shell...type-it-ty, type-it-ty, we quickly come up with....

!if bound(tz) then
!  if finfo('./smbd.pid','exists')
!    purge ./smbd.pid
!  endif
!  sh.hpbin.sys "-c '/SYS/SAMBA/SMBD -D&; echo $! >./smbd.pid; wait'"
!else
!  tellop Proper TZ recommended for Samba
!endif

the smbd.pid file (and nmbd.pid) both live in /SAMBA/PUB since mgr.samba can't seem
to write into /tmp (at least on my system....  but maybe it's better for these
files to not be in /tmp...?).  stream the job and viola :-)  another quick hack of
my httpstop job and i get....

!xeq sh.hpbin.sys "-c 'kill `cat ./smbd.pid`'"

...and it works too :-)  how about that :-)

does it mean that a batch-enable ps is no longer an issue?  i don't think so (of
course, i'm probably biased :-)  if nothing else, i'm now looking at custom 'stop'
jobs for each daemon.  i really had in mind a more generic 'thing' based on the
results of ps.        - d

--
Donna Garverick     Sr. System Programmer
925-210-6631        [log in to unmask]

"Unix _is_ user friendly.
It's just very selective about who its friends are.
And sometimes even best friends have fights."

>>>MY opinions, not Longs Drug Stores'<<<

ATOM RSS1 RSS2