FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Problem running getlists from cron
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Problem running getlists from cron [message #33040] Wed, 09 August 2006 14:34 Go to next message
billnot is currently offline  billnot   Spain
Messages: 28
Registered: August 2006
Location: Spain
Karma: 0
Junior Member
Sorry to be a nuisance again, but I'm trying hard to integrate my existing maillists (using Arrow) into FUDforum. In another topic, you're helping me with the NNTP aspect. I'm very nearly there doing it with e-mail, but I've fallen at the last hurdle.

In case you haven't heard of Arrow, it's a Windows mailing list system which I've been using for some years and it's very reliable; I'm not going to change it! But members are asking for a web interface, hence FUDforum.

Mail from the forum is going to the mailing list perfectly. Using the getlists.php script, mail from the mailing list is also going into the forum correctly - if I run getlists.php manually. If I try to run it as a cron job, including using the built-in pseudo-cron, I get an error:

Warning: popen(/home/costabla/www/www/FUDforum/scripts/maillist.php 5,w) [function.popen]: Resource temporarily unavailable in /home/costabla/www/www/FUDforum/scripts/getlists.php on line 140
0.05s: Failed opening pipe for forum:

Line 140 of getlists.php reads:

$pipe = popen($this->config['posting_script'] . ' ' . $f['id'] , "w");

I don't understand why it won't run as a cronjob; I suspect a permission problem, but I don't know where to start.

BTW, I've tried with Forum files both locked and unlocked with the same result.

FUDforum itself is up and running well; what a versatile system (I've tried a few others and this is by far the best); it's just this last integration hurdle that I need to beat!


--
Bill Hayles
El Inglés Loco
Re: Problem running getlists from cron [message #33053 is a reply to message #33040] Wed, 09 August 2006 23:51 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You probably need to execute the command via php
ala
popen("php /home/costabla/www/www/FUDforum/scripts/maillist.php 5","w");


FUDforum Core Developer
Re: Problem running getlists from cron [message #33060 is a reply to message #33053] Thu, 10 August 2006 09:54 Go to previous messageGo to next message
billnot is currently offline  billnot   Spain
Messages: 28
Registered: August 2006
Location: Spain
Karma: 0
Junior Member
Ilia wrote on Thu, 10 August 2006 01:51

You probably need to execute the command via php
ala
popen("php /home/costabla/www/www/FUDforum/scripts/maillist.php 5","w");



Unfortunately, that gives exactly the same result.


--
Bill Hayles
El Inglés Loco
Re: Problem running getlists from cron [message #33061 is a reply to message #33060] Thu, 10 August 2006 11:18 Go to previous messageGo to next message
Howie is currently offline  Howie   Spain
Messages: 1
Registered: August 2006
Location: Spain
Karma: 0
Junior Member

Hi Bill, i have finnaly found a message from you on "FUDform"

Adios, Howie.
Re: Problem running getlists from cron [message #33062 is a reply to message #33060] Thu, 10 August 2006 13:23 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Is the php binary in the path?

FUDforum Core Developer
Re: Problem running getlists from cron [message #33065 is a reply to message #33062] Thu, 10 August 2006 15:19 Go to previous messageGo to next message
billnot is currently offline  billnot   Spain
Messages: 28
Registered: August 2006
Location: Spain
Karma: 0
Junior Member
Ilia wrote on Thu, 10 August 2006 15:23

Is the php binary in the path?


Yes, it is. If it weren't, many of the other scripts I use would fall over.

I have also passed this on to the support guys at my hosts (ICDSoft) who suggested changing the line for posting_script from absolute to relative. That removed some of the errors, but still resulted in the mail going into the getlists_mainforum.txt file rather than the forum.



--
Bill Hayles
El Inglés Loco
Re: Problem running getlists from cron [message #33069 is a reply to message #33065] Thu, 10 August 2006 17:51 Go to previous messageGo to next message
billnot is currently offline  billnot   Spain
Messages: 28
Registered: August 2006
Location: Spain
Karma: 0
Junior Member
An update. ICDSoft support has given up on this, and thrown it back in my (your) court.

To summarise (if it helps)
If I run the script from the built-in cron support (which allows one execution daily!) or from the manual "run" button attached to it, the script works perfectly every time. Whatever I do, however, if I try to run it inside another script (as an include to ma e a psuedo-cron) it falls down, equally reliably.


--
Bill Hayles
El Inglés Loco
Re: Problem running getlists from cron [message #33072 is a reply to message #33069] Thu, 10 August 2006 20:28 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
If you are running it via PHP, why not just modify maillist.php to be a callable PHP function, certainly would be faster for one.

Another try could be to execute it like this:

<?php
shell_exec
("cat message | php /home/costabla/www/www/FUDforum/scripts/maillist.php 5");
?>


FUDforum Core Developer
Re: Problem running getlists from cron [message #33075 is a reply to message #33072] Fri, 11 August 2006 09:21 Go to previous messageGo to next message
billnot is currently offline  billnot   Spain
Messages: 28
Registered: August 2006
Location: Spain
Karma: 0
Junior Member
Ilia wrote on Thu, 10 August 2006 22:28

If you are running it via PHP, why not just modify maillist.php to be a callable PHP function, certainly would be faster for one.


Could you tell me how I'd do that, please

Another try could be to execute it like this:

<?php
shell_exec
("cat message | php /home/costabla/www/www/FUDforum/scripts/maillist.php 5");
?>
[/quote]

Getlists.php gives me the (same old) message:
2.09s: Failed opening pipe for forum:

I really do appreciate what you're doing to help me; you're probably finding me as frustrating as I find the problem. What bugs me is that I can sit at my website control panel and run the script manually and it runs perfectly every time. But any attempt at running getlists.php other than that results in it not communicating with maillists.php.

Other than going the same way as Homer Simpson and getting a mechanical bird to peck every 10 minutes at my keyboatd, I'm fast running out of ideas!



--
Bill Hayles
El Inglés Loco
Re: Problem running getlists from cron [message #33081 is a reply to message #33075] Fri, 11 August 2006 14:58 Go to previous messageGo to next message
billnot is currently offline  billnot   Spain
Messages: 28
Registered: August 2006
Location: Spain
Karma: 0
Junior Member
I've ound out the answer! It's something weird about my hosts. I have to put the path to a special PHP executable in the popen:

$pipe = popen("/usr/local/bin/php4.cli /home/costabla/www/www/FUDforum/scripts/maillist.php 5","w");

on the appropriate line of getlists.php sovlve severything.

So, on this topic, just one more question:
the original line was
$pipe = popen($this->config['posting_script'] . ' ' . $f['id'] , "w");

I must have something wrong in the syntax, as if I make this
$pipe = popen("/usr/local/bin/php4.cli" $this->config['posting_script'] . ' ' . $f['id'] , "w");

it doesn't work. Could somebody, after calling me a clueless newbie, give me the correct syntax for the generic call?

Thanks!!


--
Bill Hayles
El Inglés Loco
Re: Problem running getlists from cron [message #33085 is a reply to message #33081] Fri, 11 August 2006 15:35 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
<?php
shell_exec
("cat message | php /home/costabla/www/www/FUDforum/scripts/maillist.php 5");
?>


Would be the most generic way to execute the command from PHP.

P.S. Change the path to the php binary as needed.


FUDforum Core Developer
Re: Problem running getlists from cron [message #33090 is a reply to message #33040] Fri, 11 August 2006 15:51 Go to previous message
billnot is currently offline  billnot   Spain
Messages: 28
Registered: August 2006
Location: Spain
Karma: 0
Junior Member
Thanks for persevering with me on this one, Ilia. The method you suggest works; now all I have to do is to adapt it for multiple forums, (multiple getlist*.php files is the obvious answer) but I think I can manage that on my own.


--
Bill Hayles
El Inglés Loco

[Updated on: Fri, 11 August 2006 15:52]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Lock / Unlock and file permissions
Next Topic: Mailman Integration!
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 12:27:22 GMT 2024

Total time taken to generate the page: 0.03008 seconds