X-Spam-Check-By: sourceware.org Date: Sat, 2 Sep 2006 16:47:41 -0400 (EDT) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: Ron Dozier cc: cygwin AT cygwin DOT com Subject: Re: cygrunsrv, sshd, services and not starting after boot In-Reply-To: <000601c6cecc$d7f73330$0201000a@RPC> Message-ID: References: <000601c6cecc$d7f73330$0201000a AT RPC> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: 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 On Sat, 2 Sep 2006, Ron Dozier wrote: > I noted that a lot of people are having trouble getting the sshd service > to start automatically. I think I discovered a problem. > > Run services.msc and selecting sshd) there is a "Path to executable" > field that currently says :"C:\cygwin\bin\cygrunsrv.exe" > > Based on looking at some other entries like "automatic updates which use > C:\WINDOWS\system32\svchost.exe -k netsvcs", I believe it should say: > > C:\cygwin\bin\cygrunsrv.exe -S sshd > > otherwise the application cygrunsrv has no idea what service to start. Actually, that's not true. Cygrunsrv knows exactly which service to start, since the service application can easily retrieve the name of the service, the parameters, etc. svchost is just lazy, I guess... Also, "cygrunsrv -S" will not do what you want -- it will send the message to the service control manager to start the service (which will attempt to execute "cygrunsrv -S" again, causing an infinite loop). > Microsoft says it's up to the developer to provide a mechanism to do so. > > "net start" sshd works. Currently someone has to log in after a boot > and type the command. The fact that it works after boot but doesn't at boot indicates a missing service dependency (so that the system attempts to start sshd before some prerequisite is started, while after boot the prerequisite service is already running). The well-known prerequisites are the Tcp/ip service and the various firewall services. I'd try those. > The suggestion of running a batch file containing > "net start sshd" has been suggested to run automatically after a user > logs in but was not tried. > > This would require a user logging in. Most likely that will work too, but adding the dependency will cause the service to start correctly the first time. > Features of cygrunsrv I'd like to see: > A method of changing the Path variable reported by services.msc. Look at the "-e" option. > A method of changing the options presented to sshd reported by > services.msc. Look at the "-a" option. All of the information shown by "cygrunsrv --verbose -Q" is stored in standard ways in the service specifications. If services.msc does not display that information, then this is a deficiency on the part of services.msc. > Am I barking up the wrong tree? Most likely yes, sorry. HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte." "But no -- you are no fool; you call yourself a fool, there's proof enough in that!" -- Rostand, "Cyrano de Bergerac" -- 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/