IOError - cannot create file (linux daemon-invoked script)

Cameron Simpson cs at zip.com.au
Sat Jan 2 23:02:38 EST 2010


On 02Jan2010 15:21, cassiope <fpm at u.washington.edu> wrote:
| [...]  I want
| to save a copy of the email in a particular directory which is
| accessible to the Windows clients via samba.
| 
| The strange thing is that even with the right user-id, I cannot seem
| to write to the directory, getting an IOError exception.  Changing the
| directory to world-writable fixes this.  I can confirm the uid and gid
| for the script by having the script print these values just before
| trying to create/write the file.  Becoming the same lesser user, I
| have no problem writing a file to the same directory.

Can you show us:
  - the directory user and group ownership and permissions
  - the daemon's user and group values?

You can also strace your daemon:

  strace -f -e trace=file your-daemon your-daemon-args... 2>strace.out

and then examine the log for the precise UNIX-level failure.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Money won't buy happiness, but it will pay the salary of a large research
staff to study the problem. - Bill Vaughan



More information about the Python-list mailing list