delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/02/10:40:25

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 2 Mar 2004 10:38:43 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: "Cousins, Andrew" <Andrew DOT Cousins AT logicacmg DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Error using cygrunsrv to stop bash scripts
In-Reply-To: <733D8705A187D511B62300B0D0D15C8201C4A023@swires.au.logica.com>
Message-ID: <Pine.GSO.4.56.0403020829180.12963@slinky.cs.nyu.edu>
References: <733D8705A187D511B62300B0D0D15C8201C4A023 AT swires DOT au DOT logica DOT com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

Andrew,

Please make sure your mailer respects the Reply-To: header -- I set it for
a reason.  More below.

On Tue, 2 Mar 2004, Cousins, Andrew wrote:

> Igor,
>
> Service is installed with
>
> #
> cygrunsrv   --install actest3                      	 	\
>                 --path c:/usr/Cyg-Win32/bin/bash.exe   	\
>                 --args d:/usr/ea/dr_service/actest.sh 		\
>                 --desc "MOSAIC/DNMS Disaster Recovery"  	\
>                 --type manual                          		\
>                 --neverexits                            		\
>                 --shutdown
>
> The log files put out a single line .. Terminated.... each time the service
> is stopped

There should be *one* log file, /var/log/actest3.log.  Which ones are you
looking at?  Try explicitly specifying it using the "-1" and "-2"
cygrunsrv options.  Also, what does the Windows Event log show
(on Win2k, right-click on "My Computer", choose "Manage", then "Event
Viewer"->Application).

> Putting a cygcheck -svr in the service script and redirecting output to a
> file I get this with the last line (code 5)  repeated a few times before the
> Terminated Message.
>
> cygcheck: dump_sysinfo: GetVolumeInformation() failed: 67
> cygcheck: dump_sysinfo: GetVolumeInformation() failed: 67
> cygcheck: dump_sysinfo: GetVolumeInformation() failed: 5
> ....
> ....
> Terminated

$ net helpmsg 67
The network name cannot be found.
$ net helpmsg 5
Access is denied.

I'd suspect something wrong with your mounts (e.g., they aren't system
mounts), or directory permissions.  The output of "cygcheck -svr" from a
regular shell would have been very helpful (and it *is* requested in the
Cygwin problem reporting guidelines at <http://cygwin.com/problems.html>,
which you should read in any case).

> Putting
> 	env >> tempfile
> doesn't produce anything from within the service.

Which probably means that the service runs with an empty environment...
Unless...  Try specifying /bin/env explicitly, just in case, as well as
the full path to the tempfile.  Putting 'echo "$PATH" >&2' into the bash
script might also be helpful.

> Looks like it's only stderr being generated from within the service as there
> is none of the additional info I get from these two commands when it is run
> interactively.
>
> Tried the INT signal, same symptons. Does what I want, but displays the
> error messages.

Did you try trapping SIGINT in the bash script and printing out a message
before exiting?

> I'm not Windows enabled - how would I run this interactively under a SYSTEM
> owned sh.
>
> Thanks
> Andrew C.

Googling for "system-owned window cygwin" should give you a couple of
recipes.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019