http://qs1969.pair.com?node_id=792683


in reply to root unable to unlink files

A program running as www-data can't easily create a file in the outbound spool owned by root.dialer. There may be some error in your assumption about the web server process or which process is creating the file in the outbound spool.

When unlink and rename fail, they return error indications. What is the return value and what is $! set to immediately after the calls to these functions? What are the values of "$queue/$call_file" when these functions are called?

I usually call these functions as follows.

unlink($path) or die "unlink: $path: $!"; rename($oldpath,$newpath) or die "rename($oldpath,$newpath): $!";

Can you do similarly? Are errors reported?

update: What makes you think that unlink and rename were executed?

Maybe you can call them as follows:

unlink($path) or die "unlink($path): $!"; warn "unlike($path) succeeded"; rename($oldpath,$newpath) or die "rename($oldpath,$newpath): $!"; warn "rename($oldpath,$newpath) succeeded";

Then check your error output: you should have either an error indication that specifies the cause of the error or a positive indication that the function call was successful.