[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: samizdat from the command line: no success so far :(

From: Dmitry Borodaenko
Subject: Re: samizdat from the command line: no success so far :(
Date: Sun, 20 May 2007 14:24:34 +0100

On 5/14/07, boud <address@hidden> wrote:
   # SAMIZDAT_SITE=samizdat SAMIZDAT_URI=/ ruby -r samizdat/engine -e 
i have never (so far) got this to work from the command line.

SAMIZDAT_SITE=samizdat SAMIZDAT_URI=/ USER=samizdat ruby -r samizdat/engine -e 

This is a valid solution, although not perfect. I would introduce some
priviledge separation here, that is, create a special user e.g.
smsgate, and add a line for this user to pg_ident.conf like "samizdat
smsgate smsgate", and then run the GRANT lines from grant-pgsql.sql
for this user. That would allow you to isolate this functionality from
whatever other sites you run from the same server, and to make sure
you execute shell scripts and .procmailrc recipes in a tightly
controlled environment.

and got:

/usr/lib/ruby/1.8/drb/drb.rb:1647:in `current_server': DRb::DRbServerNotFound 
         from /usr/lib/ruby/1.8/drb/drb.rb:1709:in `to_id'
         from /usr/lib/ruby/1.8/drb/drb.rb:1045:in `initialize'
         from /usr/lib/ruby/1.8/drb/drb.rb:639:in `new'
         from /usr/lib/ruby/1.8/drb/drb.rb:639:in `make_proxy'
         from /usr/lib/ruby/1.8/drb/drb.rb:556:in `dump'
         from /usr/lib/ruby/1.8/drb/drb.rb:602:in `send_request'
         from /usr/lib/ruby/1.8/drb/drb.rb:903:in `send_request'
         from /usr/lib/ruby/1.8/drb/drb.rb:1190:in `send_message'
          ... 14 levels...
         from /usr/lib/ruby/1.8/dbi/dbi.rb:671:in `execute'
         from /usr/lib/ruby/1.8/dbi/dbi.rb:671:in `select_all'
         from /usr/lib/ruby/1.8/samizdat/models/content.rb:195:in 
         from -e:1

I strongly suspect this has to do with absense of local DRb server
that is required for Cache#fetch_or_add to work. Such server is
defined in Request#initialize, but not when you try to access Samizdat
from command line.

I think it's about time we had a command-line interface to Samizdat,
something that would allow to invoke arbitrary controller actions on
behalf of a given user. Probably based on a subclass of Request.

Dmitry Borodaenko

reply via email to

[Prev in Thread] Current Thread [Next in Thread]