List Info

Thread: cherokeeserv-0.1: A Windows service wrapper for Cherokee 0.60b700




cherokeeserv-0.1: A Windows service wrapper for Cherokee 0.60b700
country flaguser name
United States
2007-06-28 03:41:57
Hello,

I hacked up a Windows service wrapper for Cherokee 0.60b700
using MinGW.
I used the OpenVPN code to start, and it only took a few
hours.

Here's the syntax:

cherokeeserv -install          to install the service
cherokeeserv -start            to start the service
cherokeeserv -stop             to start the service
cherokeeserv -remove           to remove the service
cherokeeserv -debug <params>   to run as a console app
for debugging

It successfully installs, starts and removes.  The -stop
option will
stop the service, but it doesn't stop the web server. To do
that, we
need to add:

#ifdef _WIN32
  if (WaitForSingleObject('cherokee_exit_1', 0) !=
WAIT_OBJECT_0) {
    // start shuting down and exiting
  }
#endif

to the web server code. As I am brand new with this code
base, can
someone point out where this should go, or if it's even
doable?

The source, and binary, is available here:

htt
p://www.smithii.com/files/cherokeeserv-0.1.zip

-Ross


_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: cherokeeserv-0.1: A Windows service wrapper for Cherokee 0.60b700
country flaguser name
United States
2007-06-28 04:22:47
Ross Smith II wrote On 6/28/2007 1:41 AM -0800:
> 
> #ifdef _WIN32
>   if (WaitForSingleObject('cherokee_exit_1', 0) !=
WAIT_OBJECT_0) {

Er, that should obviously read:

    if (WaitForSingleObject('cherokee_exit_1', 0) ==
WAIT_OBJECT_0) {

>     // start shuting down and exiting
>   }
> #endif

_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: cherokeeserv-0.1: A Windows service wrapper for Cherokee 0.60b700
country flaguser name
United States
2007-06-28 04:22:47
Ross Smith II wrote On 6/28/2007 1:41 AM -0800:
> 
> #ifdef _WIN32
>   if (WaitForSingleObject('cherokee_exit_1', 0) !=
WAIT_OBJECT_0) {

Er, that should obviously read:

    if (WaitForSingleObject('cherokee_exit_1', 0) ==
WAIT_OBJECT_0) {

>     // start shuting down and exiting
>   }
> #endif

_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: cherokeeserv-0.1: A Windows service wrapper for Cherokee 0.60b700
country flaguser name
United States
2007-06-28 09:52:30
On 2007-06-28 02:41:57 -0600, Ross Smith II
<cherokeespamnetebb.com> said:

> Hello,
> 
> I hacked up a Windows service wrapper for Cherokee
0.60b700 using MinGW.
> I used the OpenVPN code to start, and it only took a
few hours.
> 
> Here's the syntax:
> 
> cherokeeserv -install          to install the service
> cherokeeserv -start            to start the service
> cherokeeserv -stop             to start the service
> cherokeeserv -remove           to remove the service
> cherokeeserv -debug <params>   to run as a
console app for debugging
> 
> It successfully installs, starts and removes.  The
-stop option will
> stop the service, but it doesn't stop the web server.
To do that, we
> need to add:
> 
> #ifdef _WIN32
>   if (WaitForSingleObject('cherokee_exit_1', 0) !=
WAIT_OBJECT_0) {
>     // start shuting down and exiting
>   }
> #endif
> 
> to the web server code. As I am brand new with this
code base, can
> someone point out where this should go, or if it's even
doable?
> 
> The source, and binary, is available here:
> 
> htt
p://www.smithii.com/files/cherokeeserv-0.1.zip
> 
> -Ross

That is very cool.  I don't think I will get too much of a
chance to 
look at this.  However I skimmed over the code and it looks
good for 
the most part... some styling I see now and a few comments
that still 
refer the code to OpenVPN ;)

I would vote to clean it up some and get it into the Windows
builds of 
Cherokee.
-- 
Brian Rosner
http://www.brosner.com/bl
og


_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )