Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <5AC19B5C084C754D82F23EA55ECF2EF610BBC4@mailgate.salmon.ltd.uk> From: Glen Burson To: Glen Burson , "'cygwin AT cygwin DOT com'" Subject: Restart cygrunsrv service on failure Date: Thu, 20 Oct 2005 21:06:48 +0100 MIME-Version: 1.0 Content-Type: text/plain Hi everyone, I posted this a few days ago with no responses. If anyone out there has managed to get cygrunsrv to restart using the XP/2000 recovery I would be really interested - I'm getting desperate! Details of my problem are below... 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/