* SUMMARY: find out one's own PID when running from cron
@ 2006-05-19 16:28 Cohen, Andy
2006-05-24 8:31 ` accessing DISK_SPECIFIC structure Dave Simmonds
0 siblings, 1 reply; 2+ messages in thread
From: Cohen, Andy @ 2006-05-19 16:28 UTC (permalink / raw)
I've already got a summary:
If your script is sh or ksh, so $$ will contain the PID of your
running script.
So I just did a:
export MY_PID=$$
And it worked PERFECTLY!
Thanks to Jean-Marc Vincent at HP.
Andy
ORIGINAL QUESTION
=================
Hi,
I have a shell script that runs from cron. It needs to check if there
are still previous runs of itself still running and if so it needs to
kill them (but not kill itself). I can get the shell script to find all
currently running copies of this script but the list includes the
current one but I only want to kill the previous ones. How do I get the
shell script to find out its own PID? I can do it at the command line
but when I try to do it when the script runs from cron I get an error
message:
ps: no controlling terminal
Thanks,
Andy
^ permalink raw reply [flat|nested] 2+ messages in thread
* accessing DISK_SPECIFIC structure
2006-05-19 16:28 SUMMARY: find out one's own PID when running from cron Cohen, Andy
@ 2006-05-24 8:31 ` Dave Simmonds
0 siblings, 0 replies; 2+ messages in thread
From: Dave Simmonds @ 2006-05-24 8:31 UTC (permalink / raw)
I am trying to access the kernel structure DISK_SPECIFIC for each disk in my
V5.1 system.
I can get the SCSI_DIDARR structures via calls to nlist for
_camdb_didarr_ptr and _camdb_did_high.
I then look for dev_type == ALL_DTYPE_DIRECT to find the hard disks.
Under V4.0X, I used cam_ptr to find a PDRV_DEVICE3 structure which contained
an element pd_spec_list, but under V5.1 pd_spec_list is actually contained
in the SCSI_DIDARR structure.
I search down this list.
Under V4.0X I looked for spec_reg_no == 1 and spec_ptr pointed at a
DISK_SPECIFIC structure.
Under V5.1 I don't get any records with spec_reg_no == 1, I get a record
with spec_reg_no == 2, which has a spec_size of 1440. I don't know what type
of structure this is, and I get stuck at this point.
Does anyone know what this record with spec_reg_no == 2 is, or have any
other ideas about finding DISK_SPECIFIC structures.
I can't find any documentation on this anywhere - I feel I've done quite
well to work out as much as I have on my own!
Thanks,
Dave Simmonds
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-24 8:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-19 16:28 SUMMARY: find out one's own PID when running from cron Cohen, Andy
2006-05-24 8:31 ` accessing DISK_SPECIFIC structure Dave Simmonds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox