Discussion:
Remove cygwin services
Jason FU
2005-08-12 06:47:58 UTC
Permalink
What do I do in order to remove installed services of cygwin like sshd, init and
so on?

Thanks.

Jason
Herb Martin
2005-08-12 08:21:44 UTC
Permalink
Post by Jason FU
What do I do in order to remove installed services of cygwin
like sshd, init and so on?
[ I am new to cygwin so factor this into my answer...]

cygrunsrv -R SERVICE_NAME

Example: cygrunsrv -R sshd

You may also use the Windows services.msc Control Panel
to "disable" or set a service to "manual".

Note that manual service MAY still run if some other service
starts them -- manual doesn't mean a user/admin must start
them, only that the OS will not start them automatically
unless requested to do so by another process or by an actual
manual user/admin request.

I have been unable to use cygrunsrv to "modify" a service;
so far, I have always removed the service and re-added it.

--
Herb Martin
Jason FU
2005-08-12 08:31:58 UTC
Permalink
Post by Herb Martin
[mailto:cygwin-owner <at> cygwin.com] On Behalf Of Jason FU
What do I do in order to remove installed services of cygwin
like sshd, init and so on?
[ I am new to cygwin so factor this into my answer...]
cygrunsrv -R SERVICE_NAME
Example: cygrunsrv -R sshd
You may also use the Windows services.msc Control Panel
to "disable" or set a service to "manual".
Note that manual service MAY still run if some other service
starts them -- manual doesn't mean a user/admin must start
them, only that the OS will not start them automatically
unless requested to do so by another process or by an actual
manual user/admin request.
I have been unable to use cygrunsrv to "modify" a service;
so far, I have always removed the service and re-added it.
--
Herb Martin
***@ITO2 ~
$ cygrunsrv.exe -R sshd
cygrunsrv: Error removing a service: QueryServiceStatus: Win32 error 1053:
The service did not respond to the start or control request in a timely fashion.


***@ITO2 ~
$ cygrunsrv.exe -R init
cygrunsrv: Error removing a service: QueryServiceStatus: Win32 error 1053:
The service did not respond to the start or control request in a timely fashion.


By root, I mean this is an administrator a/c.


Jason
Herb Martin
2005-08-12 09:13:10 UTC
Permalink
Post by Jason FU
$ cygrunsrv.exe -R init
The service did not respond to the start or control request
in a timely fashion.
By root, I mean this is an administrator a/c.
As I understand cygrunsrv, when you remove a service it
also assumes you wish to stop that service. If the service
refuses to stop -- which isn't that uncommon for services
started under cygrunsrv (for testing) since they don't know
they are "services" -- then you will see that error.

I believe that cygrunsrv has already changed the registry
(unconfirmed) and therefore the service will be gone on
next boot. (If not, I would consider this a bug in cygrunsrv.)

It might help (pure speculation) to enable one of the "signals"
when creating Cygwin-Apps as services. This way the "stop"
will include a HUP or TERM.

--
Herb Martin
Igor Pechtchanski
2005-08-16 02:16:02 UTC
Permalink
Post by Herb Martin
It might help (pure speculation) to enable one of the "signals"
when creating Cygwin-Apps as services. This way the "stop"
will include a HUP or TERM.
$ cygrunsrv --help 2>&1 | grep -C2 'HUP'
-s, --termsig <signal> Optional signal to send to service application
when service is stopped. <signal> can be a number
or a signal name such as HUP, INT, QUIT, etc.
Default is TERM.
-y, --dep <svc_name2> Optional name of service that must be started

As you can see, cygrunsrv sends SIGTERM to processes by default when the
service is stopped.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ ***@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ***@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA
Continue reading on narkive:
Loading...