Hi,
If HylaFax is chrooted to /var/spool/hylafax, wouldn't that mean even
if I did copy of the faxrcvd.php script to /var/spool/hylafax/bin, the
script itself wouldn't be able to reference any of the files in my
intranet directory structure located elsewhere on the file system? If
this is the case, is this a recent change to HylaFax because in the
previous version of HylaFax (v4.2.0) that I was running, the script
worked fine. Also, what does this mean for others who want to
integrate HylaFax into their own intranet via the notification scripts?
If someone could suggest an alternate way of knowing when HylaFax has
sent and received a fax, I would gladly rewrite my scripts.
Thanks guys for what ever help you can give.
marthter wrote:
Richard Morris wrote on 19/10/05 06:46 PM:
Hello all,
I have a situation that maybe someone can help me solve.
I am setting up our new server and just finished installing HylaFax
4.2.2. I can send and receive without a problem. On our old system I
had written a replacement script for faxrcvd so that faxes that HylaFax
received would be added to our intranet's database. That worked fine.
Now I am trying to get it to work on the new system and it isn't
working.
The actual script is located at /intranet/serverscripts/fax/faxrcvd.php
and so I originally edited the /var/spool/hylafax/etc/config.ttyS0 to
have FaxRcvdCmd: /intranet/serverscripts/fax/faxrcvd.php. The script
worked right when I called it from the command line but when I faxed a
test document to the server, HylaFax didn't call the script. After
some research I found that the *Cmd options paths are relative to the
spool directory so I created a symbolic link called
/var/spool/hylafax/bin/faxrcvd.php that pointed to the proper script.
I tested the script on the command line and it worked fine but when I
sent a fax to the server, it didn't call the script again.
Not only are the paths relative to the spool directory, but the Hylafax
processes are "chrooted" (a security precaution) so that they can't
even see anything outside the /var/spool/hylafax directory. From their
running environment, the /var/spool/hylafax directory IS / (the root
directory). So my guess is that if you changed your symbolic link to
just be a copy of the faxrcvd.php file, it would work. (This also
explains why it works from the command line, because you are running it
from your user perspective and that user can see outside of the
/var/spool/hylafax directory.)
Regards.
Martin
I have checked the syslog and see
that it is calling the script:
Oct 19 11:43:20 server1 FaxGetty[3478]: RECV FAX: bin/faxrcvd.php
"recvq/fax000000011.tif" "ttyS0" "000000016" ""
but for some reason the script isn't being executed by HylaFax. The
script's file permissions are:
-rwxrwxr-x 1 root apache 6.0K Oct 19 11:37 faxrcvd.php
I am not sure why the script isn't being called. Can anyone suggest
something for me to try? Can I change the ServerTracing to something
to see if an error is returned from the script? Like I said, the
faxrcvd.php works fine from command line. The faxrcvd.php has
#!/usr/local/bin/php at the top of the file so I don't need to specify
the interpreter.
I am assuming that if I can get this to work, the NotifyCmd would be
the same way to receive notice of faxes that have been sent (either
successfully or requeued)?
Thanks for any help.
|