How to determine file in "Error opening file for reading" error

5,205

If it were me I would most likely use strace, as in:

$ strace aterm

That will print out all the system calls that aterm issues. It will be quite a lot of information. You may wish to limit it to just the open() system call like so:

$ strace -etrace=open aterm

though I suppose it is possible that this isn't the result of an open() syscall.

Share:
5,205

Related videos on Youtube

Mark Hildreth
Author by

Mark Hildreth

Updated on September 18, 2022

Comments

  • Mark Hildreth
    Mark Hildreth over 1 year

    Since Ubuntu 12.04, whenever I open aterm, I get the following error message:

    Error opening file for reading: Permission denied
    

    aterm still opens and runs correctly, but I get that error message. I'd like to figure out what all this is about.

    1. Is someone familiar with this specific error for aterm?
    2. Otherwise, is there some log that records files that are attempting to be opened so I can determine what file it's complaining about? I've grepped my log files for "aterm" without success.
    3. Other tips for determining what the issue is?
  • Mark Hildreth
    Mark Hildreth almost 12 years
    Exactly what I was looking for! Looks like it's /var/run/utmp and /var/log/wtmp that were giving the issues. Now I have something more to go on. Thanks!
  • grifferz
    grifferz almost 12 years
    Glad you found it. Terminal programs often have an option to disable the "add me to wtmp/utmp file" because (as you've found) that operation usually requires root access, so would need the program to be setuid.