Update: Alex showed me an example of using the -wait part in IRC so
the problem might be in the script itself, here it is:

(load "dbg.l" "lib/debug.l" "lib/http.l" "lib/misc.l")

(class +WordCount +Entity) #
(rel article   (+Ref +Number))
(rel word      (+Aux +Ref +Number) (article))
(rel count     (+Number))

(argv *IdxNum)

(setq *DbDir (pack "/opt/resources/index" *IdxNum "/") )

(unless (info *DbDir)
   (call 'mkdir *DbDir))

(setq *DbDir (pack *DbDir "db/") )

(unless (info *DbDir)
   (call 'mkdir *DbDir))

(pool (pack *DbDir "db"))

(de setArticleWords (Lst)
   (dbSync)
   (let Res
      (mapcar id
         (tail 20
            (by '((Wc)(; Wc count)) sort
               (make
                  (for Wc Lst
                     (link (request '(+WordCount) 'article (car Wc)
'word (cadr Wc) 'count (last Wc))))))))
      (commit 'upd)
      Res))

(de getArticles (W)
   (collect 'word '+WordCount W W 'article))

(de getCommon (Ws)
   (mapcar '((Wc)(cons (get (id Wc) 'word) (get (id Wc) 'count))) Ws))

(de go ()
   (task (port (+ (any *IdxNum) 4040))
      (let? Sock (accept @)
         (unless (fork)
            (in Sock
               (while (rd)
                  (sync)
                  (out Sock
                     (pr (eval @)))))
            (bye))
         (close Sock)))
   (forked))

On Sun, Feb 7, 2010 at 4:42 PM, Henrik Sarvell <hsarv...@gmail.com> wrote:
> It doesn't start at all, that's the problem, sorry for not being clearer.
>
> word_index.l is completely standalone, it will work properly when I do
>
> sh -c ./p projects/rss-reader/word_index.l - 1 -go -wait >> index.log 2>&1 &
>
> in the bash window.
>
> So therefore it shouldn't be a problem doing the same with (call) I think?
>
> I just tried:
>
> (call "sh" "-c" "./p projects/rss-reader/word_index.l - 1 -go")
>
> Which works but without the -wait part it terminates when the spawning
> script terminates.
>
> I hope this made the situation clearer for you because it didn't make
> it clearer for me :)
>
>
>
> On Sun, Feb 7, 2010 at 4:24 PM, Alexander Burger <a...@software-lab.de> wrote:
>> On Sat, Feb 06, 2010 at 09:42:58PM +0100, Henrik Sarvell wrote:
>>> This is weird (for me). When I do sh -c ./p
>>> projects/rss-reader/word_index.l - 1 -go -wait >> index.log 2>&1 & in
>>> a shell the server starts but when I do (call "sh" "-c" "./p
>>> projects/rss-reader/word_index.l - 1 -go -wait >> index.log 2>&1 &")
>>> it doesn't.
>>>
>>> I must be missing something fundamental?
>>
>> The 'call' to 'sh' looks perfectly OK. There must be some other problem.
>> Is it possible that "word_index.l" depend on some environment not
>> available from within the call? What exactly doesn't work?
>>
>> Cheers,
>> - Alex
>> --
>> UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
>>
>
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to