[daip] Re: Fwd: rc.local addition here

Eric Greisen egreisen at nrao.edu
Tue Oct 19 16:00:18 EDT 2004


I think Pat is confused and something interesting and dangerous is
going on.

These files exist and have done so for many years.  Whan an AIPS
process starts, it creates a null file of name

/tmp/TASKn.pppppp

where TASK is the task name (AIPS, IMAGR, etc), n is a POPS number
(1-9,A-Z are possible), and pppppp is the process number.  AIPS has a
Z routine to determine whether a task is running.  If it already knows
the process number it does a 

kill (procid, 0)

If it does not know the process number then it attempts to read the
directory of /tmp to get the file names and then parses the name and
does the kill.  If the kill fails then it unlinks the file so that
dead files do not remain behind cluttering up the landscape.  The
actual code is
               if ((procid > 1) &&
                  ((kill (procid, 0) == 0) || (errno == EPERM))) {
                  *ierr = 0;
                  *pid = procid;
                  break;
                  }
                                        /* Remove dead process lockfil*/
               else {
                  unlink(pathname);
                  }

If the task ends normally it also does an unlink

                                       /* get process id number       */
   mypid = getpid ();
                                       /* make file name              */
   sprintf (lockname, "/tmp/%s.%d", procname, mypid);
                                       /* delete file                 */
   unlink (lockname);

Juan was finding that his tasks were running but that the /tmp files
were not present.  That is the opposite of the "cure" suggested of
deleting these files when rebooting.  The files should be there and
they are not - meaning someone is doing the kill and having it fail
for something other than EPERM and expunging the files.

The computer is a public one so I suspect we are having some sort of
group and user id complexity and some error other than EPERM.

I do not know why this is happening in CV and not here.

Eric Greisen




More information about the Daip mailing list