[Top][All Lists]

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

Re: Gnatsweb without root access

From: Robert Inder
Subject: Re: Gnatsweb without root access
Date: 23 Nov 2006 12:08:53 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

>>>>> Chad Walstrom writes:
    > To: Robert Inder <address@hidden>
    > Cc: address@hidden
    > Subject: Re: Gnatsweb without root access 
    >    message dated "22 Nov 2006 18:21:09 +0000."
    > Date: Wed, 22 Nov 2006 12:48:01 -0600

    > Robert Inder <address@hidden>  wrote:
    >> When I came to install gnatsweb on the new server, I noticed that it
    >> seems to need to have gnatsd running from inetd.  And I don't have
    >> access to inetd.

    > Yes, this is a problem.  The only work-around I can see right now is
    > to hack up a wrapper in to execute the gnatsd via a
    > read/writeable pipe with the option --no-inetd.  

Good idea!

I've done roughly that, albeit involving slightly more mutilation of

Page 345 of the Camel book suggested a neat method using "".
Alas, it failed on this server with a permissions problems, and I
suddenly found myself faced with having to learn an awful lot more
about Linux sockets than I wanted to.

But then I noticed that Page 344 had an example using

So I replaced "client_init" in, which opens the socket to
gnatsd, with this....

    sub client_init
      use FileHandle;
      use IPC::Open2;
      my ($pid) = open2(\*Reader, \*Writer, "$gnatsd -n");

where $gnatsd points to the gnatsd binary.

Then I replaced each access to the socket (via "SOCK") with either Reader or
Writer, as appropriate.  That sounds pretty drastic, but there are
only four of them.  So even allowing time to run a couple of
experiments to check that the open2 stuff would work, 
it was all done and dusted in about half an hour!

And, so far at least, it seems to go! 

Thanks for the prompt response.

    > The correct answer
    > would be to add legitimate UNIX style forking and make a real daemon
    > out of it.  That'll be a post 4.2 feature, however.

Or to fold my hack into properly: if the gnats host
is "localhost", look to see whether gnatsweb-local has set
$gnatsd to the demon, and if it has, use it directly in roughly the
way I have.


Robert Inder            Tel: 0131 229 1052        Interactive Information Ltd,
Director                Mobile: 07808 492 213            3, Lauriston Gardens,
                                                           Edinburgh   EH3 9HH
Interactions speak louder than words                               SCOTLAND UK

reply via email to

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