Holden D has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I need to write a cgi perl script that needs to communicate with a another process on the system, for which I'm using the IO::Socket::UNIX library. Unfortuantely I keep getting "500 permission denied" errors despite the fact that the socket is created in the same folder as the script that's creating it. Are there are any special requirements for creating sockets within mod_perl, or is this a linux permissions issue? here's the code:
#!/usr/bin/perl use CGI; use IO::Socket::UNIX; use strict; my $socket_path="/var/www/perl/pwd"; my $dsocket=IO::Socket::UNIX->new( Type=>SOCK_STREAM, Local=>$socket_path, Listen=>SOMAXCONN, ) or die ("Error: $!\n");
this file is located in /var/www/perl and has the permissions
[root@sevan perl]# ls -lah /var/www/perl/ total 44K drwxr-xr-x. 3 root root 4.0K Sep 23 14:27 . drwxr-xr-x. 8 root root 4.0K Sep 23 11:11 ..

Replies are listed 'Best First'.
Re: mod_perl and IO::Socket::UNIX
by ikegami (Patriarch) on Sep 23, 2011 at 18:39 UTC

    This a linux permissions issue.

    Are you sure your web server runs as root?