This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Restart cygrunsrv service on failure


Hello,

cygrunsrv V1.10
Windows XP

I'm having real trouble getting my service to restart on failure, using the
Windows service "Recovery" options. I have set: -

First Failure "Restart the Service"
Second Failure "Restart the Service"
Subsequence Failures "Restart the Service"

I have installed my process like: -

cygrunsrv -I test -p /tmp/test.sh

"test.sh" just goes to sleep for 10 seconds then terminates.

Windows logs in the Event Viewer that the service terminated (gracefully,
error code 0) but doesn't restart it.

I have tried exiting from the script using a non-zero code (I've tried lots
of different ones) but although the non-zero exit code is logged in the
Event Viewer, it still doesn't restart it.

I've also tried the install option "-n" which tells Windows that the service
should never terminate but, although I now get an error in the Event Viewer,
it still doesn't restart it!

The ONLY way I've managed to get Windows to restart the service is to kill
the cygrunsrv process before the child script terminates. Killing the child
script does not work either.

It seems to be related to how the process terminates but I seem to crack it!

Thanks in advance for any suggestions. I've seen some postings that imply
that people have this working but no examples.

Thanks,
Glen.



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]