public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: cygrunsrv and .bat files ??
@ 2001-08-02  7:12 Glenn Mabbutt
  0 siblings, 0 replies; 7+ messages in thread
From: Glenn Mabbutt @ 2001-08-02  7:12 UTC (permalink / raw)
  To: cygwin

OK, I've verified that cygrunsrv does in fact work on my machine - I 
daemonized /bin/yes.exe just for kicks, and it runs properly.

I'm wondering, is there anything cygrunsrv doesn't like with native win32 
apps rather than cygwinized apps??  Would it be worth my while to say, 
rewrite my 2 line batch file in Perl (under cygwin), then run PerlApp to 
turn it into an executable??

>From: fred@ontosys.com
>To: Glenn Mabbutt <morebeans@hotmail.com>
>CC: cygwin@sources.redhat.com
>Subject: Re: cygrunsrv and .bat files ??
>Date: Wed, 1 Aug 2001 14:55:50 -0500
>
>cygrunsrv executes the controlled program via the execv() system call,
>which (AFAIK) doesn't understand win32 batch files.  You might try
>configuring your service to run cmd.exe as the program and give it the
>name of your batch file as an argument, so that cygrunsrv executes
>cmd.exe which then runs the batch file.
>
>On Wed, Aug 01, 2001 at 02:37:36PM -0500, Glenn Mabbutt wrote:
> > Hi. I've got a 2 line batch file that I'm trying to run as a service on
> > NT/2000 (starts a secure tunnel client which spawns vncviewer in listen
> > mode, then kills vncviewer process after secure tunnel client exits).
>
>--
>Fred Yankowski           fred@OntoSys.com      tel: +1.630.879.1312
>Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
>OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cygrunsrv and .bat files ??
@ 2001-08-01 15:08 Glenn Mabbutt
  0 siblings, 0 replies; 7+ messages in thread
From: Glenn Mabbutt @ 2001-08-01 15:08 UTC (permalink / raw)
  To: cygwin

OK, I've tried it again, this time using the syntax:

cygrunsrv -I VncControl -p c:\winnt\system32\cmd.exe -a "/c c:\vnc\vncv.bat"

Still no go - same scenario as before, it appears to install, but hangs and 
ultimately fails on start.

Also, just to run down some options, I found a bat2exe prog, which 
ironically only turns the batch file into a .com file, and then I found a 
com2exe prog, which takes my .com file and makes it into an executable 
(vncv.exe).  Executes fine stand-alone from the command prompt, but 
cygrunsrv is still having difficulties.

I'm beginning to think perhaps there's something else bolloxed in my setup.  
One of the examples in the readme related to passing a CYGWIN env. variable 
- although the machine I'm testing on already has that set, is this 
something I need to look at??

Next I'm going to try this with "normal" executables just to see if they're 
OK on my system...

Thanks,
Glenn

>From: fred@ontosys.com
>To: Glenn Mabbutt <morebeans@hotmail.com>
>CC: cygwin@sources.redhat.com
>Subject: Re: cygrunsrv and .bat files ??
>Date: Wed, 1 Aug 2001 14:55:50 -0500
>
>cygrunsrv executes the controlled program via the execv() system call,
>which (AFAIK) doesn't understand win32 batch files.  You might try
>configuring your service to run cmd.exe as the program and give it the
>name of your batch file as an argument, so that cygrunsrv executes
>cmd.exe which then runs the batch file.
>
>On Wed, Aug 01, 2001 at 02:37:36PM -0500, Glenn Mabbutt wrote:
> > Hi. I've got a 2 line batch file that I'm trying to run as a service on
> > NT/2000 (starts a secure tunnel client which spawns vncviewer in listen
> > mode, then kills vncviewer process after secure tunnel client exits).
>
>--
>Fred Yankowski           fred@OntoSys.com      tel: +1.630.879.1312
>Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
>OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cygrunsrv and .bat files ??
  2001-08-01 13:11 Glenn Mabbutt
@ 2001-08-01 13:34 ` Corinna Vinschen
  0 siblings, 0 replies; 7+ messages in thread
From: Corinna Vinschen @ 2001-08-01 13:34 UTC (permalink / raw)
  To: cygwin

On Wed, Aug 01, 2001 at 03:11:39PM -0500, Glenn Mabbutt wrote:
> Thanks, Fred, I'll try the cmd.exe option.  About the second part of my 
> post, is it possible to set the "interact with desktop" flag via a command 
> line switch??

Currently not, no. Patches gratefully accepted *duck*

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cygrunsrv and .bat files ??
@ 2001-08-01 13:11 Glenn Mabbutt
  2001-08-01 13:34 ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Mabbutt @ 2001-08-01 13:11 UTC (permalink / raw)
  To: cygwin

Thanks, Fred, I'll try the cmd.exe option.  About the second part of my 
post, is it possible to set the "interact with desktop" flag via a command 
line switch??

Thanks again,
Glenn

>From: fred@ontosys.com
>To: Glenn Mabbutt <morebeans@hotmail.com>
>CC: cygwin@sources.redhat.com
>Subject: Re: cygrunsrv and .bat files ??
>Date: Wed, 1 Aug 2001 14:55:50 -0500
>
>cygrunsrv executes the controlled program via the execv() system call,
>which (AFAIK) doesn't understand win32 batch files.  You might try
>configuring your service to run cmd.exe as the program and give it the
>name of your batch file as an argument, so that cygrunsrv executes
>cmd.exe which then runs the batch file.
>
>On Wed, Aug 01, 2001 at 02:37:36PM -0500, Glenn Mabbutt wrote:
> > Hi. I've got a 2 line batch file that I'm trying to run as a service on
> > NT/2000 (starts a secure tunnel client which spawns vncviewer in listen
> > mode, then kills vncviewer process after secure tunnel client exits).
>
>--
>Fred Yankowski           fred@OntoSys.com      tel: +1.630.879.1312
>Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
>OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* cygrunsrv and .bat files??
@ 2001-08-01 13:05 Glenn Mabbutt
  0 siblings, 0 replies; 7+ messages in thread
From: Glenn Mabbutt @ 2001-08-01 13:05 UTC (permalink / raw)
  To: cygwin

Hi, I'm attempting to turn a 2 line batch file of mine into a service on 
NT/2000.

The batch file runs as expected stand-alone.

I can daemonize it using FireDaemon, and it works as expected.  (I'd like to 
ultimately not use FireDaemon due to licencing reasons, however.)

Apparently it installs as a service using "cygrunsrv -I SomeService -p 
c:\path\to\app\file.bat", but when I try to start it it pauses for several 
seconds then dies with "error 1062: can't start service".  This is using 
both "cygrunsrv -S SomeService" and "net start SomeService". A reboot made 
no difference.

I thought maybe it was a path problem, so I copied cygrunsrv.exe and 
cygwin1.dll into the same directory as the batch file, and tried it from 
there.  I also copied the batch file into the / of my Cygwin installation, 
and ran cygrunsrv from the /bin folder.  No difference either way.

Also, I don't think the readme mentioned an option for setting "interact 
with desktop".  Is there one?? (doesn't affect me, I tried enabling that 
manually with the created service, didn't help)

Is cygrunsrv capable of handling batch files or is it only capable of 
handling executables??

If this won't work (rather than I've screwed it up ;), are there other free 
{beer|speech} srvany replacements for NT and 2000 out there??

Thanks,
Glenn



         --------------------------------------
Bill Gates: "Innovate."
Me: "You keep using that word. I do not think it means what
      you think it means."


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cygrunsrv and .bat files ??
  2001-08-01 12:37 cygrunsrv and .bat files ?? Glenn Mabbutt
@ 2001-08-01 12:56 ` fred
  0 siblings, 0 replies; 7+ messages in thread
From: fred @ 2001-08-01 12:56 UTC (permalink / raw)
  To: Glenn Mabbutt; +Cc: cygwin

cygrunsrv executes the controlled program via the execv() system call,
which (AFAIK) doesn't understand win32 batch files.  You might try
configuring your service to run cmd.exe as the program and give it the
name of your batch file as an argument, so that cygrunsrv executes
cmd.exe which then runs the batch file.

On Wed, Aug 01, 2001 at 02:37:36PM -0500, Glenn Mabbutt wrote:
> Hi. I've got a 2 line batch file that I'm trying to run as a service on 
> NT/2000 (starts a secure tunnel client which spawns vncviewer in listen 
> mode, then kills vncviewer process after secure tunnel client exits).  

-- 
Fred Yankowski           fred@OntoSys.com      tel: +1.630.879.1312
Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* cygrunsrv and .bat files ??
@ 2001-08-01 12:37 Glenn Mabbutt
  2001-08-01 12:56 ` fred
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Mabbutt @ 2001-08-01 12:37 UTC (permalink / raw)
  To: cygwin

Hi. I've got a 2 line batch file that I'm trying to run as a service on 
NT/2000 (starts a secure tunnel client which spawns vncviewer in listen 
mode, then kills vncviewer process after secure tunnel client exits).  
Tested so far on an NT Wkstn 4.0 sp6a.

The batch file works fine as stand-alone.

I can daemonize it using FireDaemon, works just fine (however, I'd rather 
not ultimately end up using it due to their licensing).

I've tried installing it using "cygrunsrv -I VncControl -p 
c:\vnc\vncviewer.bat", that appears to work (service shows up, no errors at 
this point) - I've confirmed the path is correct as far as the filesystem 
goes.  However, trying to start it using "cygrunsrv -S VncControl" or "net 
start VncControl", I get an error saying "error 1062: Service not started".  
So far, I've tried this with cygrunsrv and cygwin1.dll in the c:\vnc 
directory (where the batch file is), as well as moving the batch file to the 
/ of my Cygwin installation, and running cygrunsrv from /bin (I thought 
maybe it was a path problem).

Anything I'm missing??  Can cygrunsrv handle .bat files or only 
executables??

Also, in the readme I don't see an option for enabling "interact with 
desktop".  Is this possible??  In my case it won't help, I tried enabling 
that manually after installing the service with cygrunsrv, it made no 
difference.


Thanks,
Glenn

         --------------------------------------
Bill Gates: "Innovate."
Me: "You keep using that word. I do not think it means what
      you think it means."


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-08-02  7:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-02  7:12 cygrunsrv and .bat files ?? Glenn Mabbutt
  -- strict thread matches above, loose matches on Subject: below --
2001-08-01 15:08 Glenn Mabbutt
2001-08-01 13:11 Glenn Mabbutt
2001-08-01 13:34 ` Corinna Vinschen
2001-08-01 13:05 cygrunsrv and .bat files?? Glenn Mabbutt
2001-08-01 12:37 cygrunsrv and .bat files ?? Glenn Mabbutt
2001-08-01 12:56 ` fred

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).