Search code examples
ruby-on-railsprocmail

Weirdness with running a ruby-on-rails program from procmail


I am trying to run a ruby program that is part of a RoR project from .procmailrc. From the command line the entire .procmailrc action line works fine, but when a real email message is processed through Procmail I'm getting the following error:

/bin/sh: line 1: 12625 File size limit exceeded(core dumped) /usr/bin/rails r test.rb

test.rb is just a simple script that copies from STDIN to a temp file.

My .procmailrc is

:0: $HOME/alerts.lock
* ^X-mailer: X-System Alert Info
| cd /usr/local/src/Alert; /usr/bin/rails r ./test.rb

Anyone have any idea what's going on?

EDIT: I should note that replacing /usr/bin/rails r ./test.rb in .procmailrc with a perl program that does the same thing (as test.rb) works.


Solution

  • It seems, as with all the other "File size limit exceeded" questions out there, it was indeed a large file. What threw me was that

    1. I am running a 64-bit Fedora and thought the 2G file size limit did not apply to 64-bit OS's, and
    2. The size of the culprit file was not even over 1G!!

    Found this by changing the action line of the .procmailrc recipe to run the same program out of another RoR project and that worked. To make a long story short, in the end it turned out to be the development.log file in the project's log/ directory. As I said in 2. above, the file was only 192M, but as soon as I emptied it the .procmailrc recipe started working.