[Win32utils-devel] win32 service

Daniel Berger djberg96 at yahoo.com
Sat Dec 10 14:39:46 EST 2005


Hi Ernest,

I'm cc'ing the win32utils-devel mailing list in case
anyone has any ideas.

--- Ernest Ellingson <erne at powernav.com> wrote:

> Daniel Berger wrote:
> 
> >Hi Ernest,
> >
> >Me again.  I just realized that it's just a bug in
> my
> >documentation (duh).  You can pass arguments to the
> >Service.start method.  I'll update the docs. 
> Anyway,
> >here's the relevant documentation:
> >
> >Service.start(service, host=nil, *args)
> >
> >    Starts the specified service on host, or the
> local
> >machine if no host is specified.  Any +args+ passed
> >here are passed as start parameters to the service.
> >
> >If you're interested in where that's happening in
> the
> >C code, take a look at rbArgs and
> lpServiceArgVectors
> >in the service_start() function.
> >
> >Regards,
> >
> >Dan
> >
> >--- Ernest Ellingson <erne at powernav.com> wrote:
> >
> >  
> >
> >>Hi dan:
> >>    I've been examining methods to create a secure
> >>(proxy or proxies)  
> >>using ssh on windows machines.  I've looked into
> >>net::ssh for ruby but I 
> >>run into some threading issues,  I haven't been
> able
> >>to decipher exactly 
> >>where these issues occur for a number of reasons. 
> I
> >>have turned to 
> >>using plink.exe (comes with putty.exe)  I can
> create
> >>a secure link with 
> >>a linux box running ssh and squid.  I then point
> my
> >>browser at the port 
> >>plink is listening on and voila, I have a secure
> >>tunnel to a proxy.
> >>
> >>    I want to run plink.exe (I'll have to run
> >>several instances of 
> >>plink, one for web, one for email, one for IM) as
> a
> >>service (as 
> >>services).  One of the things I have to do is set
> >>start up parameters on 
> >>the service.  After looking at the text file and
> at
> >>the c code (I'm not 
> >>a very good c programmer)  I see at least in the c
> >>code the possibility 
> >>of passing in start parameters.  However the text
> >>file doesn't seem o 
> >>provide for this in Service.start("service_name").
> 
> >>How does one pass in 
> >>the start up parameters?
> >>
> >>Thanks in advance
> >>
> >>Ernie
> >>
> >>    
> >>
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> >http://mail.yahoo.com 
> >  
> >
> Thanks for the response.
> I still can't get things operating properly with
> win32service.
> I have been able to get plink.exe running as a
> service with winserv.exe
> Here is the command line for setting up the service
> using winserve.exe
> 
> winserv install secureWebProxy -displayname "Secure
> Web Proxy" 
> -description "Tunnel through min.powernav.com proxy"
> -user PWRNAV\erne 
> -password mypword c:\rubyscripts\ssh\plink.exe
> 192.168.100.3 -i 
> c:\rubyscripts\ssh\private_rsa.key -l ellingson -ssh
> -L 
> 8080:192.168.100.3:3128 -N -T

Hm, well, I'm not really familiar with winserv.

> Notice I'm not running under the system account. I'm
> running as myself 
> qualified with a domain name.
> 
> I can't seem to get win32service to work with
> start_name="PWRNAV\\erne".

I'm not sure what you mean here.  Do you mean the
'-user PWRNAV\erne' switch is causing the problem? 
Otherwise, I'm not sure where you would be using
'start_name' to start a service.

> I can get it to accept start_name="erne".  However,
> win32 reports that 
> this user isn't known  and  since  I'm on a  domain,
>  that's correct.
> 
> When I create the service then manually change the
> log on to PWRNAV\erne 
> in the control panel  and try starting the service
> with.
> 
> Service.start("secureWebProxy",nil,"192.168.100.3 -i
> 
> c:\\rubyscripts\\ssh\private_rsa.key -l ellingson
> -ssh -L 8080:192.
> 168.100.3:3128 -N -T")
> 
> The service fails to start even though the start up
> parameters are the 
> same as I have for winserv. exe.
> 
> I'm not sure, that an any executable can be
> installed as a service with 
> win32service.  Nothing is wrapping the executable so
> that it will 
> respond to a start or stop signal.  I'm not even
> sure I'm right about that.
> 
> Ernie

We'll see if anyone on the list has any insight as I
don't think I entirely follow.

Regards,

Dan 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the win32utils-devel mailing list