Re: CouchDB as a windows service.

2011-08-04 Thread Keith Gable
I see that your problem is now solved after I replied. Go Gmail :)

On Thu, Aug 4, 2011 at 3:11 PM, Keith Gable  wrote:
> On Thu, Aug 4, 2011 at 2:34 PM, Walter Torres  wrote:
>> sc.exe create CouchDBServer binPath=
>> "L:\etc\couchdb\erts-5.8.4\bin\erlsrv.exe" DisplayName= "CouchDB Server"
>
> erlsrv.exe is used on the command line to install services. You
> probably need to install the service and then figure out what command
> line it tries to call. In particular, Erlang needs to know what to
> start and some settings. Erlang's command line is pretty verbose.
>
> I would bet that erlsrv.exe is attempting to access parts of the
> registry that can't be accessed by LocalService/NetworkService users,
> because erlsrv.exe isn't what would execute the Erlang interpeter
> anyways.
>
>
>> The GitHub that I pulled the installer from has a non-installer version;
>> meaning it is a simple 7z file. I am using that in my experiments.
>
> Erlang, or CouchDB?
>
> I would imagine both are available as binary archives, but they're not
> the same thing. CouchDB runs on top of Erlang; Erlang is used by tons
> of other stuff. Think of the relationship between Ruby and Ruby on
> Rails - Rails runs on Ruby and won't run without some sort of Ruby
> interpeter. CouchDB is executed within Erlang.
>
>>  3)  deep understanding of system, how it works, how to modify/config it,
>> upgrade it.
>>       * 100% there, with what I have. It took me 10 minutes to add SSL to
>> my Apache. Took another 5 for Vhosts. You can't say the same with Xxamp or
>> WAMP installers.
>
> FWIW, I don't like the "WAMP" installers. Apache and MySQL are easy
> enough to install properly on their own (or not install; they check
> relative locations for their configuration). You're just describing
> the standard way of configuring things in Apache/MySQL/etc. Nothing
> wrong with that, just saying that "industry standard" *nix apps are
> all pretty much the same.
>
>>
>> Anyway, the info you gave (THANK YOU very much BTW) will keep me busy for a
>> bit of time. No matter how much I  think I know, too many times I feel like
>> I know nothing at all.
>>
>
> I'm thinking you just need to extract Erlang into a folder, CouchDB
> into a different folder (or keep the structure you have, whichever),
> then use erlsrv.exe to install the service (like the installer does),
> and then it'll all work.
>


Re: CouchDB as a windows service.

2011-08-04 Thread Keith Gable
On Thu, Aug 4, 2011 at 2:34 PM, Walter Torres  wrote:
> sc.exe create CouchDBServer binPath=
> "L:\etc\couchdb\erts-5.8.4\bin\erlsrv.exe" DisplayName= "CouchDB Server"

erlsrv.exe is used on the command line to install services. You
probably need to install the service and then figure out what command
line it tries to call. In particular, Erlang needs to know what to
start and some settings. Erlang's command line is pretty verbose.

I would bet that erlsrv.exe is attempting to access parts of the
registry that can't be accessed by LocalService/NetworkService users,
because erlsrv.exe isn't what would execute the Erlang interpeter
anyways.


> The GitHub that I pulled the installer from has a non-installer version;
> meaning it is a simple 7z file. I am using that in my experiments.

Erlang, or CouchDB?

I would imagine both are available as binary archives, but they're not
the same thing. CouchDB runs on top of Erlang; Erlang is used by tons
of other stuff. Think of the relationship between Ruby and Ruby on
Rails - Rails runs on Ruby and won't run without some sort of Ruby
interpeter. CouchDB is executed within Erlang.

>  3)  deep understanding of system, how it works, how to modify/config it,
> upgrade it.
>       * 100% there, with what I have. It took me 10 minutes to add SSL to
> my Apache. Took another 5 for Vhosts. You can't say the same with Xxamp or
> WAMP installers.

FWIW, I don't like the "WAMP" installers. Apache and MySQL are easy
enough to install properly on their own (or not install; they check
relative locations for their configuration). You're just describing
the standard way of configuring things in Apache/MySQL/etc. Nothing
wrong with that, just saying that "industry standard" *nix apps are
all pretty much the same.

>
> Anyway, the info you gave (THANK YOU very much BTW) will keep me busy for a
> bit of time. No matter how much I  think I know, too many times I feel like
> I know nothing at all.
>

I'm thinking you just need to extract Erlang into a folder, CouchDB
into a different folder (or keep the structure you have, whichever),
then use erlsrv.exe to install the service (like the installer does),
and then it'll all work.


Re: CouchDB as a windows service.

2011-08-04 Thread Walter Torres
Dave,

I was just about to reply to the list based upon your suggestions and
pointers.

I read the URLS given, twice, and then it finally clicked!

It works!

I unpacked the NON-installer (7z) pacakge to my desired location.

Updated the INI files

Ran the ERLSRV command to create a service.

And now it works!

{

   - couchdb: "Welcome"
   - version: "1.1.0"

}

I was barking up the wrong tree! Crap, I was in he wrong forest!

Thank you Dave, and the others who replied on and off list. I appreciate
your patience and I really do appreciate you making me defend myself and
explain better.

And FUTON looks great!

Thank's again Dave, and all of you.

Walter


Re: CouchDB as a windows service.

2011-08-04 Thread Dave Cottlehuber
Hi Walter,

Just reposting my response to the list + a few more bits after seeing
the thread. This is not difficult to do. However I'm currently moving
home & continents so not much spare time.

TL;DR
1. install accompanying vcredist.
2. change local.ini as required.
3. read couchdb.bat and use erl.exe  + same parameters as a service, not erlsrv.


lean.7z was created to allow people to integrate minimal couch into
their apps without the service or installer crud.
CouchDB runs just fine using couchdb.bat without *any* reg keys, just
updating the 3 relevant ini files.  No need for more smarts. Or just
create a service as erl.exe or werl.exe with the same parameters as
used in couchdb.bat and it will work fine.
Finally, you can't "just" add erlsrv.exe as a service; it stores its
configuration for auto-restart & other functionality in
HKLM/Software/ This is erlang stuff & when you understand why its
built like that it is pretty useful.

Some homework - read:

http://wiki.apache.org/couchdb/Quirks_on_Windows especially "How is
CouchDB deployed on Windows?" and "Integrating CouchDB into your
Windows Applications"

also http://www.erlang.org/doc/man/erl.html erl and werl are
functionally equivalent apart from werl having better scroll bars and
copynpaste.

the lean build referred to in
https://issues.apache.org/jira/browse/COUCHDB-1181 is here
https://github.com/dch/couchdb/downloads (tested) and a more beta-y
couch 1.2.x are in here - some bits don't work (snappy) others should
(coffeescript), https://www.dropbox.com/s/jeifcxpbtpo78ak/Snapshots/

In my experience this is a really helpful & open community; I
certainly have benefited from it. The questions you're seeing are not
rude, nor inflammatory; just bewilderment when seeing somebody trying
very hard to make windows look like unix. There are a lot of people
here, myself included, who have spent a long time futzing this! Relax,
we're just trying to understand where you are coming from.

One can climb Mt Everest walking from sea-level, but 95% of people
doing so don't. There's probably something in that. Maybe you're one
of those lone buddhist monks in an orange robe :-)

A+
Dave

On 5 August 2011 05:55, Walter Torres  wrote:
> Thanks for this tool!
>
> It may help, but it looks promising.
>
> Thank you
>
> On Thu, Aug 4, 2011 at 6:01 PM, Chad Cross  wrote:
>
>> Walter,
>>
>> Have you tried using procmon to watch the executable(s)?  It will record
>> registry access, though I'm not sure if it will record that the app was
>> attempting to access a key that does not exist, but it's definitely worth a
>> shot!
>>
>> http://technet.microsoft.com/en-us/sysinternals/bb896645
>>
>> -Chad
>>
>> On Thu, Aug 4, 2011 at 12:28 PM, Dennis Redfield <
>> dennis.lee.redfi...@gmail.com> wrote:
>>
>> > You really are at the mercy of the folks who wrote the installer, perhaps
>> > they will chime in.  The Registry system is quite complex and is a
>> > combination of keys required by the system: security, uninstall, service
>> > installation and keys which are set uniquely by the application (I assume
>> > this is what you intended when you said APP REG KEYS).  So your best bet
>> is
>> > to go back to the couchdb installation source, talk to the installation
>> > authors and hit the books.
>> >
>> > BTW: The reason I asked your intent (i.e. your goal) was what you are
>> > attempting to do is going to require some real effort - if do-able at all
>> > and I was hoping that if I knew what you were trying to accomplish there
>> > might be another way to achieve the goal.
>> >
>> > Question:  I understand (from the Wiki) that mySQL does NOT run as a
>> > windows
>> > service but as a process within the hosting application (e.g. as a linked
>> > lib).  Is this not correct?
>> >
>> > thanks
>> >
>> > dlr
>> >
>> >
>> > On Thursday, August 4, 2011, Walter Torres  wrote:
>> > > Ok, ok. I guess I should be very specific
>> > >
>> > > When I refer to REG KEYS, I do not include KEYS that windows creates
>> > > when a SERVICE is installed. To my referring to APP REG KEYS, not
>> > > windows SERVICE REG KEYS
>> > >
>> > > Am I splitting hairs? I don't think so. SERVICE REG KEYS are not used
>> > > by the app.
>> > >
>> > > When I installed "erlsrv.exe" as a SERVICE, windows created the
>> > > SERVICE REG KEYS. It appears in the  SERVICES control and it allows me
>> > > to attempt to start it.
>> > >
>> > > I believe that the error I am getting is because the app is trying to
>> > > access an APP KEY of some kind.
>> > >
>> > > As for reading the installer code; well I did that for about an hour
>> > > and nothing jumped out at me. But than, I'm not that  experiences with
>> > > windows installer.
>> > >
>> > > That's why I asked in here. I was hoping someone who had experience
>> > > with the windows would know about keys and might know a work around.
>> > >
>> > > I was really hoping that this group would be a bit different than
>> > > other open source groups. I don't know why I w

Re: CouchDB as a windows service.

2011-08-04 Thread Walter Torres
On Thu, Aug 4, 2011 at 6:39 PM, Keith Gable wrote:

> On Thu, Aug 4, 2011 at 10:31 AM, Walter Torres 
> wrote:
>
> > When I installed "erlsrv.exe" as a SERVICE, windows created the
> > SERVICE REG KEYS. It appears in the  SERVICES control and it allows me
> > to attempt to start it.
> >
>
> Did *you* create the service, or did you copy and paste the code the
> installer uses? I think this may be the issue if the former.


sc.exe create CouchDBServer binPath=
"L:\etc\couchdb\erts-5.8.4\bin\erlsrv.exe" DisplayName= "CouchDB Server"



> erlsrv.exe is
> used to start/stop/install/remove Erlang services from what I can tell. You
> wouldn't want to add it yourself as a service to start; you'd want to use
> it
> in cmd.exe to add a service and then start whatever it put in there.
>
> Here's the config file for the installer (which I think is InnoSetup):
> https://github.com/dch/couchdb/blob/trunk/etc/windows/couchdb.iss.tpl
>
> You should have installed the service by running erlsrv.exe with these
> parameters (I filled in the variables from the ISS file, so change as
> needed):
> add "CouchDB" -workdir "X:\CouchDB\bin" -onfail restart_always -args "-sasl
> errlog_type error -s couch +A 4 +W w" -comment "CouchDB 1.x.x"
>
> Then you can either net start CouchDB, or the installer does erlsrv.exe
> start "CouchDB".
>

oh. Must read more. Must read more! ;)



> I checked out the source for the Windows fork and grepped it for both
> "hkey"
> and "hk", and nothing Windows-specific came out. I don't think that CouchDB
> is your problem here. I think it's that Erlang is refusing to start because
> it is not installed properly (and it may well depend on some sort of
> registry entries). There might be a standalone version of Erlang that you
> can extract to a folder and use, and then once that worked, you could use
> that to install CouchDB as a service and run it.
>

The GitHub that I pulled the installer from has a non-installer version;
meaning it is a simple 7z file. I am using that in my experiments.

I really don't know if this is a standalone Erlang.



> It sounds to me like you're trying to make a version of CouchDB that is
> batch file installable and survives a nuke and pave.

But that's a guess;


Almost. BAT file is one stepdown from INSTALLER. But yes one of the positive
aspects of this system is a "nuke and pave" solution. My solution is not so
much BAT based, but gZip the entire structure and place on network or CD for
safe keeping.



> you could be hooking up CouchDB to a missile defense system.


Oh! You had to say that! Now we have have to kill you! ;)



> In any event, help
> us help you - try to explain why you can't use the installer in silent mode
> and why you can't use registry entries.
>

My rational for this method:
  1) Linux like - as much as possible on a windows box
   * I am 96% there
  2) nuke and pave capability
   * 100% there
  3)  deep understanding of system, how it works, how to modify/config it,
upgrade it.
   * 100% there, with what I have. It took me 10 minutes to add SSL to
my Apache. Took another 5 for Vhosts. You can't say the same with Xxamp or
WAMP installers.

On a irrational level
  1) hatred of windows "rules"
  2) dread of windows failures - not if, but when
  3) despise REG KEYS
  4) deplore files in WINDOWS dir
  5) don't not knowing whee things are (control freak!)

I would like to place files in some rational/logical locations in my "linux"
tree, add a service, add ENV VAR (if needed) and just begin development.



> P.S. In Windows, when you remove a service, you'll have to reboot to fully
> be rid of its security descriptors and whatnot. Definitely don't try
> removing/adding the service without restarting or you may be compounding
> the
> problem by having incorrect SDs.
>

Yes, thank you. That I have been doing.

Anyway, the info you gave (THANK YOU very much BTW) will keep me busy for a
bit of time. No matter how much I  think I know, too many times I feel like
I know nothing at all.

Thank you.

Walter


Re: CouchDB as a windows service.

2011-08-04 Thread Walter Torres
Thanks for this tool!

It may help, but it looks promising.

Thank you

On Thu, Aug 4, 2011 at 6:01 PM, Chad Cross  wrote:

> Walter,
>
> Have you tried using procmon to watch the executable(s)?  It will record
> registry access, though I'm not sure if it will record that the app was
> attempting to access a key that does not exist, but it's definitely worth a
> shot!
>
> http://technet.microsoft.com/en-us/sysinternals/bb896645
>
> -Chad
>
> On Thu, Aug 4, 2011 at 12:28 PM, Dennis Redfield <
> dennis.lee.redfi...@gmail.com> wrote:
>
> > You really are at the mercy of the folks who wrote the installer, perhaps
> > they will chime in.  The Registry system is quite complex and is a
> > combination of keys required by the system: security, uninstall, service
> > installation and keys which are set uniquely by the application (I assume
> > this is what you intended when you said APP REG KEYS).  So your best bet
> is
> > to go back to the couchdb installation source, talk to the installation
> > authors and hit the books.
> >
> > BTW: The reason I asked your intent (i.e. your goal) was what you are
> > attempting to do is going to require some real effort - if do-able at all
> > and I was hoping that if I knew what you were trying to accomplish there
> > might be another way to achieve the goal.
> >
> > Question:  I understand (from the Wiki) that mySQL does NOT run as a
> > windows
> > service but as a process within the hosting application (e.g. as a linked
> > lib).  Is this not correct?
> >
> > thanks
> >
> > dlr
> >
> >
> > On Thursday, August 4, 2011, Walter Torres  wrote:
> > > Ok, ok. I guess I should be very specific
> > >
> > > When I refer to REG KEYS, I do not include KEYS that windows creates
> > > when a SERVICE is installed. To my referring to APP REG KEYS, not
> > > windows SERVICE REG KEYS
> > >
> > > Am I splitting hairs? I don't think so. SERVICE REG KEYS are not used
> > > by the app.
> > >
> > > When I installed "erlsrv.exe" as a SERVICE, windows created the
> > > SERVICE REG KEYS. It appears in the  SERVICES control and it allows me
> > > to attempt to start it.
> > >
> > > I believe that the error I am getting is because the app is trying to
> > > access an APP KEY of some kind.
> > >
> > > As for reading the installer code; well I did that for about an hour
> > > and nothing jumped out at me. But than, I'm not that  experiences with
> > > windows installer.
> > >
> > > That's why I asked in here. I was hoping someone who had experience
> > > with the windows would know about keys and might know a work around.
> > >
> > > I was really hoping that this group would be a bit different than
> > > other open source groups. I don't know why I would have that
> > > expectation. I ran into the same "resistance", the same "bewilderment"
> > > at the idea of not using an installer when I started working on apache
> > > and on nearly every Linux based app that has a windows binary.
> > >
> > > Maybe these replies are thinking they are helping, but read the
> > > replies again. Do they really help with the scenario given? Not from
> > > my POV. They read to me as just questioning my logic not addressing
> > > the issue.
> > >
> > > Does anyone gave any experience with windows? With how the app uses
> KEYS,
> > etc.
> > >
> > > I don't have the experience to correct any code and recompile a
> > > binary. And I think that is what will have to happen. I don't believe
> > > there is any reason, none, for the need of a REG KEY, and I'm not
> > > talking about any SERVICE REG KEYS.
> > >
> > > Anyone have any ideas or anyone with the bandwidth to look into this?
> > >
> > >
> > > ---
> > > Walter
> > >
> > > On Aug 4, 2011, at 9:28 AM, Keith Gable 
> > wrote:
> > >
> > >> On Aug 4, 2011 9:22 AM, "Walter Torres"  wrote:
> > >>>
> > >>> I have Apache and mySQL running, as a SERVICE, without REG KEYS.
> > >>
> > >> Impossible. You still have to have the service keys in the registry
> that
> > >> tell Windows how to start/stop services. Maybe CouchDB is attempting
> to
> > >> install this for you or expects to read settings from those keys. I'd
> > check
> > >> the source for the installer code and go from there.
> > >
> >
> > --
> > Trust No One
> >
>


Re: CouchDB as a windows service.

2011-08-04 Thread Keith Gable
Euphemism for format and reinstall. :)
On Aug 4, 2011 12:49 PM, "Dennis Redfield" 
wrote:
> nuke and pave?
>
> On Thursday, August 4, 2011, Keith Gable 
wrote:
>> On Thu, Aug 4, 2011 at 10:31 AM, Walter Torres 
> wrote:
>>
>>> When I installed "erlsrv.exe" as a SERVICE, windows created the
>>> SERVICE REG KEYS. It appears in the SERVICES control and it allows me
>>> to attempt to start it.
>>>
>>
>> Did *you* create the service, or did you copy and paste the code the
>> installer uses? I think this may be the issue if the former. erlsrv.exe
is
>> used to start/stop/install/remove Erlang services from what I can tell.
> You
>> wouldn't want to add it yourself as a service to start; you'd want to use
> it
>> in cmd.exe to add a service and then start whatever it put in there.
>>
>> Here's the config file for the installer (which I think is InnoSetup):
>> https://github.com/dch/couchdb/blob/trunk/etc/windows/couchdb.iss.tpl
>>
>> You should have installed the service by running erlsrv.exe with these
>> parameters (I filled in the variables from the ISS file, so change as
>> needed):
>> add "CouchDB" -workdir "X:\CouchDB\bin" -onfail restart_always -args
> "-sasl
>> errlog_type error -s couch +A 4 +W w" -comment "CouchDB 1.x.x"
>>
>> Then you can either net start CouchDB, or the installer does erlsrv.exe
>> start "CouchDB".
>>
>> I checked out the source for the Windows fork and grepped it for both
> "hkey"
>> and "hk", and nothing Windows-specific came out. I don't think that
> CouchDB
>> is your problem here. I think it's that Erlang is refusing to start
> because
>> it is not installed properly (and it may well depend on some sort of
>> registry entries). There might be a standalone version of Erlang that you
>> can extract to a folder and use, and then once that worked, you could use
>> that to install CouchDB as a service and run it.
>>
>> It sounds to me like you're trying to make a version of CouchDB that is
>> batch file installable and survives a nuke and pave. But that's a guess;
> you
>> could be hooking up CouchDB to a missile defense system. In any event,
> help
>> us help you - try to explain why you can't use the installer in silent
> mode
>> and why you can't use registry entries.
>>
>> P.S. In Windows, when you remove a service, you'll have to reboot to
fully
>> be rid of its security descriptors and whatnot. Definitely don't try
>> removing/adding the service without restarting or you may be compounding
> the
>> problem by having incorrect SDs.
>>
>
> --
> Trust No One


Re: CouchDB as a windows service.

2011-08-04 Thread Dennis Redfield
 nuke and pave?

On Thursday, August 4, 2011, Keith Gable  wrote:
> On Thu, Aug 4, 2011 at 10:31 AM, Walter Torres 
wrote:
>
>> When I installed "erlsrv.exe" as a SERVICE, windows created the
>> SERVICE REG KEYS. It appears in the  SERVICES control and it allows me
>> to attempt to start it.
>>
>
> Did *you* create the service, or did you copy and paste the code the
> installer uses? I think this may be the issue if the former. erlsrv.exe is
> used to start/stop/install/remove Erlang services from what I can tell.
You
> wouldn't want to add it yourself as a service to start; you'd want to use
it
> in cmd.exe to add a service and then start whatever it put in there.
>
> Here's the config file for the installer (which I think is InnoSetup):
> https://github.com/dch/couchdb/blob/trunk/etc/windows/couchdb.iss.tpl
>
> You should have installed the service by running erlsrv.exe with these
> parameters (I filled in the variables from the ISS file, so change as
> needed):
> add "CouchDB" -workdir "X:\CouchDB\bin" -onfail restart_always -args
"-sasl
> errlog_type error -s couch +A 4 +W w" -comment "CouchDB 1.x.x"
>
> Then you can either net start CouchDB, or the installer does erlsrv.exe
> start "CouchDB".
>
> I checked out the source for the Windows fork and grepped it for both
"hkey"
> and "hk", and nothing Windows-specific came out. I don't think that
CouchDB
> is your problem here. I think it's that Erlang is refusing to start
because
> it is not installed properly (and it may well depend on some sort of
> registry entries). There might be a standalone version of Erlang that you
> can extract to a folder and use, and then once that worked, you could use
> that to install CouchDB as a service and run it.
>
> It sounds to me like you're trying to make a version of CouchDB that is
> batch file installable and survives a nuke and pave. But that's a guess;
you
> could be hooking up CouchDB to a missile defense system. In any event,
help
> us help you - try to explain why you can't use the installer in silent
mode
> and why you can't use registry entries.
>
> P.S. In Windows, when you remove a service, you'll have to reboot to fully
> be rid of its security descriptors and whatnot. Definitely don't try
> removing/adding the service without restarting or you may be compounding
the
> problem by having incorrect SDs.
>

-- 
Trust No One


Re: CouchDB as a windows service.

2011-08-04 Thread Walter Torres
Dennis,

Yes, I am at the mercy of the original developer who forked couchDB for
windows. I just sent him a message - from GitHub.

I understand the REG system is VERY complex. Many things/levels require
KEYS, but applications don't really *have* to utilize KEYS. Case input is
the copy of Apache and mySQL running on my local PC. I did not run an
installer, did not add REG KEYS (yes, environmental variables are
technically KEYS, as is a SERVICE identifier,but I classify these as WINDOWS
KEYS)

My goal is ZERO application level REG KEYS. I would like to insert couchDB
into my pseudo-Linux structure that I have running on my Windows
development environment,

As for mySQL, I've read similar wikis and blogs. I have been told by many
"experts" fo many years that I can not run a WAMP stack the way I would like
to. WALTERS-WAY wiki  shows anyone who would
like to see how to create a LAMP-like stack on a windows
box. Completely configurable. If you can configure a Linux Apache, you can
configure my version of a WAMP stack. The files are (almost) in the same
place, nothing in the WINDOWS directory, nothing in the REGISTRY.

I have both Apache and mySQL running as SERVICES. This method works on
everything from NT on up. On 95 you have to manually start. But that's
really old! ;)

Thanks for making me clarify my request.

Walter


On Thu, Aug 4, 2011 at 5:28 PM, Dennis Redfield <
dennis.lee.redfi...@gmail.com> wrote:

> You really are at the mercy of the folks who wrote the installer, perhaps
> they will chime in.  The Registry system is quite complex and is a
> combination of keys required by the system: security, uninstall, service
> installation and keys which are set uniquely by the application (I assume
> this is what you intended when you said APP REG KEYS).  So your best bet is
> to go back to the couchdb installation source, talk to the installation
> authors and hit the books.
>
> BTW: The reason I asked your intent (i.e. your goal) was what you are
> attempting to do is going to require some real effort - if do-able at all
> and I was hoping that if I knew what you were trying to accomplish there
> might be another way to achieve the goal.
>
> Question:  I understand (from the Wiki) that mySQL does NOT run as a
> windows
> service but as a process within the hosting application (e.g. as a linked
> lib).  Is this not correct?
>
> thanks
>
> dlr
>
>


Re: CouchDB as a windows service.

2011-08-04 Thread Keith Gable
On Thu, Aug 4, 2011 at 10:31 AM, Walter Torres  wrote:

> When I installed "erlsrv.exe" as a SERVICE, windows created the
> SERVICE REG KEYS. It appears in the  SERVICES control and it allows me
> to attempt to start it.
>

Did *you* create the service, or did you copy and paste the code the
installer uses? I think this may be the issue if the former. erlsrv.exe is
used to start/stop/install/remove Erlang services from what I can tell. You
wouldn't want to add it yourself as a service to start; you'd want to use it
in cmd.exe to add a service and then start whatever it put in there.

Here's the config file for the installer (which I think is InnoSetup):
https://github.com/dch/couchdb/blob/trunk/etc/windows/couchdb.iss.tpl

You should have installed the service by running erlsrv.exe with these
parameters (I filled in the variables from the ISS file, so change as
needed):
add "CouchDB" -workdir "X:\CouchDB\bin" -onfail restart_always -args "-sasl
errlog_type error -s couch +A 4 +W w" -comment "CouchDB 1.x.x"

Then you can either net start CouchDB, or the installer does erlsrv.exe
start "CouchDB".

I checked out the source for the Windows fork and grepped it for both "hkey"
and "hk", and nothing Windows-specific came out. I don't think that CouchDB
is your problem here. I think it's that Erlang is refusing to start because
it is not installed properly (and it may well depend on some sort of
registry entries). There might be a standalone version of Erlang that you
can extract to a folder and use, and then once that worked, you could use
that to install CouchDB as a service and run it.

It sounds to me like you're trying to make a version of CouchDB that is
batch file installable and survives a nuke and pave. But that's a guess; you
could be hooking up CouchDB to a missile defense system. In any event, help
us help you - try to explain why you can't use the installer in silent mode
and why you can't use registry entries.

P.S. In Windows, when you remove a service, you'll have to reboot to fully
be rid of its security descriptors and whatnot. Definitely don't try
removing/adding the service without restarting or you may be compounding the
problem by having incorrect SDs.


Re: CouchDB as a windows service.

2011-08-04 Thread Chad Cross
Walter,

Have you tried using procmon to watch the executable(s)?  It will record
registry access, though I'm not sure if it will record that the app was
attempting to access a key that does not exist, but it's definitely worth a
shot!

http://technet.microsoft.com/en-us/sysinternals/bb896645

-Chad

On Thu, Aug 4, 2011 at 12:28 PM, Dennis Redfield <
dennis.lee.redfi...@gmail.com> wrote:

> You really are at the mercy of the folks who wrote the installer, perhaps
> they will chime in.  The Registry system is quite complex and is a
> combination of keys required by the system: security, uninstall, service
> installation and keys which are set uniquely by the application (I assume
> this is what you intended when you said APP REG KEYS).  So your best bet is
> to go back to the couchdb installation source, talk to the installation
> authors and hit the books.
>
> BTW: The reason I asked your intent (i.e. your goal) was what you are
> attempting to do is going to require some real effort - if do-able at all
> and I was hoping that if I knew what you were trying to accomplish there
> might be another way to achieve the goal.
>
> Question:  I understand (from the Wiki) that mySQL does NOT run as a
> windows
> service but as a process within the hosting application (e.g. as a linked
> lib).  Is this not correct?
>
> thanks
>
> dlr
>
>
> On Thursday, August 4, 2011, Walter Torres  wrote:
> > Ok, ok. I guess I should be very specific
> >
> > When I refer to REG KEYS, I do not include KEYS that windows creates
> > when a SERVICE is installed. To my referring to APP REG KEYS, not
> > windows SERVICE REG KEYS
> >
> > Am I splitting hairs? I don't think so. SERVICE REG KEYS are not used
> > by the app.
> >
> > When I installed "erlsrv.exe" as a SERVICE, windows created the
> > SERVICE REG KEYS. It appears in the  SERVICES control and it allows me
> > to attempt to start it.
> >
> > I believe that the error I am getting is because the app is trying to
> > access an APP KEY of some kind.
> >
> > As for reading the installer code; well I did that for about an hour
> > and nothing jumped out at me. But than, I'm not that  experiences with
> > windows installer.
> >
> > That's why I asked in here. I was hoping someone who had experience
> > with the windows would know about keys and might know a work around.
> >
> > I was really hoping that this group would be a bit different than
> > other open source groups. I don't know why I would have that
> > expectation. I ran into the same "resistance", the same "bewilderment"
> > at the idea of not using an installer when I started working on apache
> > and on nearly every Linux based app that has a windows binary.
> >
> > Maybe these replies are thinking they are helping, but read the
> > replies again. Do they really help with the scenario given? Not from
> > my POV. They read to me as just questioning my logic not addressing
> > the issue.
> >
> > Does anyone gave any experience with windows? With how the app uses KEYS,
> etc.
> >
> > I don't have the experience to correct any code and recompile a
> > binary. And I think that is what will have to happen. I don't believe
> > there is any reason, none, for the need of a REG KEY, and I'm not
> > talking about any SERVICE REG KEYS.
> >
> > Anyone have any ideas or anyone with the bandwidth to look into this?
> >
> >
> > ---
> > Walter
> >
> > On Aug 4, 2011, at 9:28 AM, Keith Gable 
> wrote:
> >
> >> On Aug 4, 2011 9:22 AM, "Walter Torres"  wrote:
> >>>
> >>> I have Apache and mySQL running, as a SERVICE, without REG KEYS.
> >>
> >> Impossible. You still have to have the service keys in the registry that
> >> tell Windows how to start/stop services. Maybe CouchDB is attempting to
> >> install this for you or expects to read settings from those keys. I'd
> check
> >> the source for the installer code and go from there.
> >
>
> --
> Trust No One
>


Re: CouchDB as a windows service.

2011-08-04 Thread Dennis Redfield
You really are at the mercy of the folks who wrote the installer, perhaps
they will chime in.  The Registry system is quite complex and is a
combination of keys required by the system: security, uninstall, service
installation and keys which are set uniquely by the application (I assume
this is what you intended when you said APP REG KEYS).  So your best bet is
to go back to the couchdb installation source, talk to the installation
authors and hit the books.

BTW: The reason I asked your intent (i.e. your goal) was what you are
attempting to do is going to require some real effort - if do-able at all
and I was hoping that if I knew what you were trying to accomplish there
might be another way to achieve the goal.

Question:  I understand (from the Wiki) that mySQL does NOT run as a windows
service but as a process within the hosting application (e.g. as a linked
lib).  Is this not correct?

thanks

dlr


On Thursday, August 4, 2011, Walter Torres  wrote:
> Ok, ok. I guess I should be very specific
>
> When I refer to REG KEYS, I do not include KEYS that windows creates
> when a SERVICE is installed. To my referring to APP REG KEYS, not
> windows SERVICE REG KEYS
>
> Am I splitting hairs? I don't think so. SERVICE REG KEYS are not used
> by the app.
>
> When I installed "erlsrv.exe" as a SERVICE, windows created the
> SERVICE REG KEYS. It appears in the  SERVICES control and it allows me
> to attempt to start it.
>
> I believe that the error I am getting is because the app is trying to
> access an APP KEY of some kind.
>
> As for reading the installer code; well I did that for about an hour
> and nothing jumped out at me. But than, I'm not that  experiences with
> windows installer.
>
> That's why I asked in here. I was hoping someone who had experience
> with the windows would know about keys and might know a work around.
>
> I was really hoping that this group would be a bit different than
> other open source groups. I don't know why I would have that
> expectation. I ran into the same "resistance", the same "bewilderment"
> at the idea of not using an installer when I started working on apache
> and on nearly every Linux based app that has a windows binary.
>
> Maybe these replies are thinking they are helping, but read the
> replies again. Do they really help with the scenario given? Not from
> my POV. They read to me as just questioning my logic not addressing
> the issue.
>
> Does anyone gave any experience with windows? With how the app uses KEYS,
etc.
>
> I don't have the experience to correct any code and recompile a
> binary. And I think that is what will have to happen. I don't believe
> there is any reason, none, for the need of a REG KEY, and I'm not
> talking about any SERVICE REG KEYS.
>
> Anyone have any ideas or anyone with the bandwidth to look into this?
>
>
> ---
> Walter
>
> On Aug 4, 2011, at 9:28 AM, Keith Gable 
wrote:
>
>> On Aug 4, 2011 9:22 AM, "Walter Torres"  wrote:
>>>
>>> I have Apache and mySQL running, as a SERVICE, without REG KEYS.
>>
>> Impossible. You still have to have the service keys in the registry that
>> tell Windows how to start/stop services. Maybe CouchDB is attempting to
>> install this for you or expects to read settings from those keys. I'd
check
>> the source for the installer code and go from there.
>

-- 
Trust No One


Re: CouchDB as a windows service.

2011-08-04 Thread Walter Torres
Ok, ok. I guess I should be very specific

When I refer to REG KEYS, I do not include KEYS that windows creates
when a SERVICE is installed. To my referring to APP REG KEYS, not
windows SERVICE REG KEYS

Am I splitting hairs? I don't think so. SERVICE REG KEYS are not used
by the app.

When I installed "erlsrv.exe" as a SERVICE, windows created the
SERVICE REG KEYS. It appears in the  SERVICES control and it allows me
to attempt to start it.

I believe that the error I am getting is because the app is trying to
access an APP KEY of some kind.

As for reading the installer code; well I did that for about an hour
and nothing jumped out at me. But than, I'm not that  experiences with
windows installer.

That's why I asked in here. I was hoping someone who had experience
with the windows would know about keys and might know a work around.

I was really hoping that this group would be a bit different than
other open source groups. I don't know why I would have that
expectation. I ran into the same "resistance", the same "bewilderment"
at the idea of not using an installer when I started working on apache
and on nearly every Linux based app that has a windows binary.

Maybe these replies are thinking they are helping, but read the
replies again. Do they really help with the scenario given? Not from
my POV. They read to me as just questioning my logic not addressing
the issue.

Does anyone gave any experience with windows? With how the app uses KEYS, etc.

I don't have the experience to correct any code and recompile a
binary. And I think that is what will have to happen. I don't believe
there is any reason, none, for the need of a REG KEY, and I'm not
talking about any SERVICE REG KEYS.

Anyone have any ideas or anyone with the bandwidth to look into this?


---
Walter

On Aug 4, 2011, at 9:28 AM, Keith Gable  wrote:

> On Aug 4, 2011 9:22 AM, "Walter Torres"  wrote:
>>
>> I have Apache and mySQL running, as a SERVICE, without REG KEYS.
>
> Impossible. You still have to have the service keys in the registry that
> tell Windows how to start/stop services. Maybe CouchDB is attempting to
> install this for you or expects to read settings from those keys. I'd check
> the source for the installer code and go from there.


Re: CouchDB as a windows service.

2011-08-04 Thread Keith Gable
On Aug 4, 2011 9:22 AM, "Walter Torres"  wrote:
>
> I have Apache and mySQL running, as a SERVICE, without REG KEYS.

Impossible. You still have to have the service keys in the registry that
tell Windows how to start/stop services. Maybe CouchDB is attempting to
install this for you or expects to read settings from those keys. I'd check
the source for the installer code and go from there.


Re: CouchDB as a windows service.

2011-08-04 Thread Walter Torres
The reasons for this are too numerous to go into.

As for "can't do this because it is a SERVICE" doesn't hold water.

I have Apache and mySQL running, as a SERVICE, without REG KEYS. No security
issues to deal with, beyond the normal crappy Windows security. But then, I
am not using this for production, just development.

Thanks Dennis for your opinion. (I take it that you stated your opinion
since you used the words "I think").

Anybody know about this process. I would really appreciate it.

Walter


On Thu, Aug 4, 2011 at 2:43 PM, Dennis Redfield <
dennis.lee.redfi...@gmail.com> wrote:

> I am not sure why you want to go with this pain.  As I understand this you
> want to install Couchdb as a service on windows without using the installer
> and without using any registry keys.  Is this correct.  I believe this is
> going to be impossible. When dealing with services in Windows system you
> are
> working with the security core (think ring 0) of the system and to try this
> manually (and without setting registry keys correctly - including the
> security settings on these keys) just is NOT going to work.  QUESTION: why
> do you want to do this? Perhaps you can achieve your goals another way.
>
> dlr
>
> On Thursday, August 4, 2011, Walter  wrote:
> > I am trying to do this the hard way.
> >
> > No installer, not registry keys, etc.
> >
> > I pulled this:
> >
> > couchdb-1.1.0+COUCHDB-1152_otp_R14B03_lean.7z<
>
> https://github.com/downloads/dch/couchdb/couchdb-1.1.0+COUCHDB-1152_otp_R14B03_lean.7z
> >
> > —
> > Use for repackaging CouchDB in other apps - no installer, just bare bones
> > binaries of Apache CouchDB 1.1.0 with ICU 4.4.2 and Erlang/OTP R14B03
> >
> > I also pulled he installer, ran it, noted file locations and registry
> keys
> > (Yuck!) and then restored my system to the point before installation.
> This
> > removed all files from system, anything that might have been thrown in
> > WINDOWS directory and it cleaned the registry.
> >
> > I than "installed" the files from the .7z file on my secondary volume,
> with
> > all my other linux tools and tried to make it work from there.
> >
> > When I start the SERVICE I get this error
> >
> > Error 1012: The configuration registry key could not be read.
> >
> > Wonderful! (not) This needs a reg key.  :/
> >
> > Is there anyway around this? If not, what is the minimal key set this
> needs
> > to run?
> >
> > Also (if there is not a key workaround), is there anyone who can help
> > re-"make", from the source, a windows binary that does not need REG KEYS.
> >
> > Thanks for your help.
> >
> > Walter
> >
>
> --
> Trust No One
>


Re: CouchDB as a windows service.

2011-08-04 Thread Dennis Redfield
I am not sure why you want to go with this pain.  As I understand this you
want to install Couchdb as a service on windows without using the installer
and without using any registry keys.  Is this correct.  I believe this is
going to be impossible. When dealing with services in Windows system you are
working with the security core (think ring 0) of the system and to try this
manually (and without setting registry keys correctly - including the
security settings on these keys) just is NOT going to work.  QUESTION: why
do you want to do this? Perhaps you can achieve your goals another way.

dlr

On Thursday, August 4, 2011, Walter  wrote:
> I am trying to do this the hard way.
>
> No installer, not registry keys, etc.
>
> I pulled this:
>
> couchdb-1.1.0+COUCHDB-1152_otp_R14B03_lean.7z<
https://github.com/downloads/dch/couchdb/couchdb-1.1.0+COUCHDB-1152_otp_R14B03_lean.7z
>
> —
> Use for repackaging CouchDB in other apps - no installer, just bare bones
> binaries of Apache CouchDB 1.1.0 with ICU 4.4.2 and Erlang/OTP R14B03
>
> I also pulled he installer, ran it, noted file locations and registry keys
> (Yuck!) and then restored my system to the point before installation. This
> removed all files from system, anything that might have been thrown in
> WINDOWS directory and it cleaned the registry.
>
> I than "installed" the files from the .7z file on my secondary volume,
with
> all my other linux tools and tried to make it work from there.
>
> When I start the SERVICE I get this error
>
> Error 1012: The configuration registry key could not be read.
>
> Wonderful! (not) This needs a reg key.  :/
>
> Is there anyway around this? If not, what is the minimal key set this
needs
> to run?
>
> Also (if there is not a key workaround), is there anyone who can help
> re-"make", from the source, a windows binary that does not need REG KEYS.
>
> Thanks for your help.
>
> Walter
>

-- 
Trust No One