public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Installing sshd with option --type manual
Date: Wed, 10 May 2017 18:01:00 -0000	[thread overview]
Message-ID: <03c9c136-c08c-e96d-3f73-6c279e6d43b0@SystematicSw.ab.ca> (raw)
In-Reply-To: <oeu729$dfh$1@blaine.gmane.org>

On 2017-05-09 23:05, Charles Russell wrote:
>> On 5/4/2017 3:31 PM, Fran Litterio wrote:
>>> You can try opening the Services Control Panel app (run "start 
>>> services.msc" in a Command Prompt) and changing the startup type
>>> of service "Cygwin sshd" to "Automatic (Delayed Start)".
> Yes! I was looking in the alphabetized list of services for sshd, not
> for CYGWIN sshd.

...or from an elevated admin shell where you installed the Cygwin 
service with cygrunsrv -I or ran the /bin/...-config script e.g.:

	$ sc config sshd start= delayed-auto depend= cygserver/tcpip

no space before = (part of option), space between = and value required, 
services it should start after and depends on separated by forward slashes.

From any shell, you can list installed Cygwin services using 

	$ cygrunsrv -L

with -V also listing all parameters and their values.

From any shell, you can also list and modify parameters easily using e.g.

$ regtool list -p /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd
Parameters\
Type
Start
ErrorControl
ImagePath
DisplayName
DependOnService
ObjectName
$ regtool set -d /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/DelayedAutostart 1
$ regtool list -p /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd
Parameters\
Type
Start
ErrorControl
ImagePath
DisplayName
DependOnService
ObjectName
DelayedAutostart
$ regtool get /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/DelayedAutostart
1
$ regtool list -p /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/Parameters
AppPath
AppArgs
$ regtool set -d /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/Parameters/Preshutdown 1
$ regtool list -p /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/Parameters
AppPath
AppArgs
Preshutdown
$ regtool get /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/Parameters/Preshutdown
1

with the usual caveats regarding registry key names, changes, and 
modifications.
Parameters and other cygrunsrv changes will not be picked up until 
the service is stopped and restarted from cygrunsrv in an elevated 
admin shell.

This approach has the advantages that cygrunsrv does not support 
service or parameter changes or modifications, cygrunsrv -I and 
sc config require an elevated admin shell, sc config does not support 
cygrunsrv and other services' Parameters and other features, and 
regedit requires formatted file input or a GUI.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2017-05-10 17:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-29  2:35 Charles Russell
2017-05-04 20:31 ` Fran Litterio
2017-05-07  0:18   ` Charles Russell
2017-05-07  0:25     ` Charles Russell
2017-05-07  3:27       ` Charles Russell
2017-05-10  5:31       ` Charles Russell
2017-05-10 18:01         ` Brian Inglis [this message]
2017-05-06 17:28 ` Charles Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03c9c136-c08c-e96d-3f73-6c279e6d43b0@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).