This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Error using cygrunsrv to stop bash scripts
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: "Cousins, Andrew" <Andrew dot Cousins at logicacmg dot com>
- Cc: cygwin at cygwin dot com
- Date: Tue, 2 Mar 2004 10:38:43 -0500 (EST)
- Subject: Re: Error using cygrunsrv to stop bash scripts
- References: <733D8705A187D511B62300B0D0D15C8201C4A023@swires.au.logica.com>
- Reply-to: cygwin at cygwin dot com
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@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.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/