June 18, 2019

Grinder - Weird issues with IRAF and users

I have been doing some things rearranging user identities on a system running IRAF and encountering nasty problems.

I had a user "fred" who could run IRAF just fine -- but I wanted to change his user name to "tom" while not changing the uid. Never mind why, but this is (or should be) straightforward enough -- edit the /etc/passwd file on a linux system, and rename the home directory from fred to tom.

After doing this, I try to start the cl and get:

Warning: Cannot delete file (uparm$tbthen.fits)
Warning: Attempt to delete a nonexistent file (uparm$tbthen.fits)
ERROR: cannot open `uparm$pipe12655' for writing
     called as: `cl ()'
Error while reading login.cl file - may need to rebuild with mkiraf
Fatal startup error.  CL dies.
I look in the uparm directory and there are no files with name "pipe*".

However, for some reason, I got the idea of looking in those mysterious world write-able directories in /iraf.

cd cache
ls -al
drwxrwxr-x. 2 tom   tom   4096 Jun 18 13:48 fred
drwxrwxr-x. 2 pilot pilot 4096 Jun 18 12:43 pilot
drwxrwxr-x. 2  1000  1000 4096 Jun 14 16:29 tom
Here we see at least part of the problem. IRAF had created named directories under the old uid scheme, but those directories are no longer owned by the uid that name now corresponds to. The same mess is going on over in "imdirs"
cd imdirs
ls -l
drwxrwxr-x. 2 1000 1000 4096 Jun 14 16:29 tom
Things look OK for user pilot, but tom and fred will never be able to create files in these directories. For that matter, user fred does not exist anymore (at least not with the name fred). The easy fix is to just delete these bogus directories, they are empty. Fred is long gone, his directory may as well be too.
su
cd /iraf/imdirs
rmdir tom
cd /iraf/cache
rmdir fred tom
After this, user "tom" needs to run mkiraf again, but after that everything is fine.


Have any comments? Questions? Drop me a line!

Tom's home page / [email protected]