public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Error using cygrunsrv to  stop bash scripts
@ 2004-03-02  5:15 Cousins, Andrew
  2004-03-02 16:30 ` Igor Pechtchanski
  0 siblings, 1 reply; 4+ messages in thread
From: Cousins, Andrew @ 2004-03-02  5:15 UTC (permalink / raw)
  To: 'Igor Pechtchanski'; +Cc: 'cygwin@cygwin.com'

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

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

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

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.

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

Thanks

Andrew C.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

--
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/

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

* Re: Error using cygrunsrv to  stop bash scripts
  2004-03-02  5:15 Error using cygrunsrv to stop bash scripts Cousins, Andrew
@ 2004-03-02 16:30 ` Igor Pechtchanski
  0 siblings, 0 replies; 4+ messages in thread
From: Igor Pechtchanski @ 2004-03-02 16:30 UTC (permalink / raw)
  To: Cousins, Andrew; +Cc: cygwin

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/

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

* Re: Error using cygrunsrv to  stop bash scripts
  2004-03-02  2:06 Cousins, Andrew
@ 2004-03-02  3:53 ` Igor Pechtchanski
  0 siblings, 0 replies; 4+ messages in thread
From: Igor Pechtchanski @ 2004-03-02  3:53 UTC (permalink / raw)
  To: Cousins, Andrew; +Cc: cygwin

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

> I have installed cygrunsrv to run bash.exe with a script as parameter.
> Service starts and stops OK but on the stop
> it also produces these errors. .
>
> A system error has occurred.
> System error 1067 has occurred.
> The process terminated unexpectedly.
>
> Script does catch the signal and terminate gracefully and it also
> runs OK from command line and can be terminated properly with a TERM
> signal.
>
> Help in what is causing the errors would be appreciated.

Andrew,

What exact command are you using to install the service?  Does
/var/log/<svc_name>.log show anything?  Does the script run and terminate
OK from a SYSTEM-owned shell?  What is the environment that the script
runs under ("env >> /tmp/svc_env", or, even better, "cygcheck -svr >
/tmp/svc_cygcheck.out")?  Did you try using another signal for service
termination?
	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/

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

* Error using cygrunsrv to  stop bash scripts
@ 2004-03-02  2:06 Cousins, Andrew
  2004-03-02  3:53 ` Igor Pechtchanski
  0 siblings, 1 reply; 4+ messages in thread
From: Cousins, Andrew @ 2004-03-02  2:06 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

I have installed cygrunsrv to run bash.exe with a script as parameter.
Service starts and stops OK but on the stop
it also produces these errors. .

A system error has occurred.
System error 1067 has occurred.
The process terminated unexpectedly.

Script does catch the signal and terminate gracefully and it also
 runs OK from command line and can be terminated properly with a TERM
signal.

Help in what is causing the errors would be appreciated.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

--
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/

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

end of thread, other threads:[~2004-03-02 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-02  5:15 Error using cygrunsrv to stop bash scripts Cousins, Andrew
2004-03-02 16:30 ` Igor Pechtchanski
  -- strict thread matches above, loose matches on Subject: below --
2004-03-02  2:06 Cousins, Andrew
2004-03-02  3:53 ` Igor Pechtchanski

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).