Re: Help with Apache cgi



Ernest Ellingson wrote:
I'm trying to port a cgi program that runs fine under windows. But I can't seem to get what I want done under linux.

I want to send out emails to a list of subscribers. This program will take about 10 minutes to run.

In windows I've been using the start command. This actually starts a process and the cgi program continues to run a tells the user that emails are being sent. The start command lets the program run in the background. The cgi program doesn't have to wait for the mail program to finish.

I've tried
    z=fork do
        `mail progam`
    end
    Process.detatch(z)
    The program doesn't run.
I've tried writing a cronjobs file
    t=Time.now + 60
    File.open('/var/www/cronjobs'){|f| f.write("#{t.min} #{t.hour} etc")}
         `crontab /var/www/cronjobs`

crontab -u apache -l
lists the cron job at the right minute, hour, month, etc. but the cron job doesn't run.


The only thing I've seen in the Rubytalk archives is a suggestion to close stderr, stdin, and stdout in the child process when using fork. That didn't help either.

Does anyone have a clue how to do this using apache and ruby?

Thanks in advance.

Ernie
--
"Keep an open mind, but not so open that your brain falls out." (Richard Feynman)

I've figured it out.

Thanks to Thomas Uehlinger and the developers of daemons http://daemons.rubyforge.org/
It's really simple!!!


Thanks again

Ernie
.



Relevant Pages

  • Floods of Emails Coming In To /var/spool/mqueue
    ... It has two mailman lists running on it which are important to me. ... How can I put a stop to these emails -- do I need procmail recipes? ... Or is it best to upgrade to the latest version of Fedora and work on tightening up processing of incoming emails? ...
    (Fedora)
  • Re: Outlook should let me add domain to blocked sender list via ri
    ... Have you also noticed that you cannot add multiple emails to the 'Blocked' ... junk mail sender lists is removed from the context menu if multiple e-mails ... With all the junk email everyone receives we can't imagine ... multi-step procedure really hampers the usefulness of the blocked senders ...
    (microsoft.public.outlook.general)
  • Sendmail ACL ability (like squid ACLs)
    ... Allowed incoming mails ... user1 <TAB> LIST ... to his lists, all other is denied. ... to send emails, all other addresses for this "user" will be allowed. ...
    (comp.mail.sendmail)
  • Re: emails FROM me are considered Junk
    ... Gary VanderMolen, MS-MVP (Mail) ... Are you saying that list emails wind up in the "Junk E-mail" folder? ... But the reflected messages I send to the lists are put in limbo. ...
    (microsoft.public.windows.vista.mail)
  • RE: Formatting a spreadsheet
    ... eventually delete the rows with the entries where emails were copied up. ... Choose the sheet with the company/email lists on it. ... Dim columnOffset As Integer ... Dim outerLoop As Long ...
    (microsoft.public.excel.misc)

Loading