From: Jamie C. <jca...@we...> - 2003-06-10 03:57:08
|
You should display the return value from backquote_logged, which is the output from the program - it may contain some error message explaining what went wrong. Also, check the exit status in the $? variable, which if non-zero indicates failure. - Jamie Larry Gilson <Li...@IS...> wrote .. > Jamie, > > Thanks for the reply! > > > This may be a path problem - make sure that whatever is in > > $bin is a full path like '/usr/local/bin/foo' instead of just 'foo', > > which may not be in webmin's program search path. > > > > - Jamie > > > &backquote_logged("$bin -C $_[0] 2>&1 </dev/null"); > > Both $bin and $_[0] are absolute paths. I can cat the file that > the above command was echoed into, copy and paste at the command > line, execute, and obtain a successful db file. The result is: > > /usr/bin/squidGuard -C /var/lib/squidguard/blacklists/ads/domains > /usr/bin/squidGuard -C /var/lib/squidguard/blacklists/ads/urls > > Just for kicks, I modified the &get_binary_path() so the binary is > found rather than the symlink. Still nothing. Permissions seem to > be correct, execute is allowed. I just don't get it. It should work. > Any other suggestions? > > Thanks, > Larry > > > > > > ========================================= > Previous post -- > > > > I hope I am posting this question to the correct list! I have been > > trying to work on a couple of problems I am having with the squidguard > > (third party) module. I have resolved all but one problem. Creating > > the blacklist db files. Below is the subroutine from squidguard-lib.pl > > which is called from enable_blacklist.cgi to create a new db file from > > the blacklist. For some reason I just can't create the db file if > > executed from the enable CGI script via miniserv. However, if I > > simulate the subroutine via a Perl script from the command line, it > > works. You will be able to see that I have echoed the command to a > > text file just to make sure variables are being passed correctly, > > which they are. > > > > #---------------------------- > > # squidguard-lib.pl > > # rebuild_db($file) > > # Rebuild the dbfile $file with squidguard -C > > sub rebuild_db { > > my $bin = &get_binary_path(); > > &terror('lib_nobin') if (! -x $bin); > > > > if (-e $_[0]) { > > `echo "$bin -C $_[0]" > /var/lib/squidguard/blacklists/ads/xxx.txt`; > > &backquote_logged("$bin -C $_[0] 2>&1 </dev/null"); > > &webmin_log('rebuild', 'dbfile', $_[0]); > > &sgchown($_[0]); > > &sgchown("$_[0].db"); > > } > > > > if (! -e $_[0]) { > > `echo "$bin -C $_[0]" > /var/lib/squidguard/blacklists/ads/yyy.txt`; > > } > > > > &reload_squid(); > > } > > #---------------------------- > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The best > thread debugger on the planet. Designed with thread debugging features > you've never dreamed of, try TotalView 6 free at www.etnus.com. > - > Forwarded by the Webmin development list at web...@we... > To remove yourself from this list, go to > http://lists.sourceforge.net/lists/listinfo/webadmin-devel |