This is the mail archive of the cygwin@sources.redhat.com 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]

Re: Starting as Service on NT


This is very easy to do, in fact.

Just write the service as you normally would (check out Richter's
book), then add it to your registry in the appropriate place (there's
a registry key somewhere under HKLM where you put the name of the
executable and a couple other params), then in your
Services Control Panel, just go to the "Log On As" section and
put in there under what user context you want the service to
run under.

This can all be done programatically as well, by looking up the
SID of the user and sticking THAT in the registry, although I've
never done it.

Note that a BAT file cannot itself be a service. Windows NT has
a particular API you must implement (called a "Service Control
Program") where you have to respond to events like start-service,
stop-service, and pause-service within a certain amount of time.
However, it's rather trivial to write a C program which invokes
a BAT file via the shell.

	c

At 05:41 AM 10/6/2000 -0500, you wrote:
>From my limited understanding of NT (mostly familiar with 9x), I don't
>think this would work since noone is logged in when the computer
>restarts.  I'm thinking it would have to be something like 9x's AUTOEXEC.BAT
>or a service listed in the registry.  I don't know much about NT specifics.
>Does it do something like AUTOEXEC.BAT?  If it does, would putting Cygwin
>in there stop NT from booting until Cygwin exited?  (Must get some sleep now.
>Hope this made sense.)
>
>Paul
>
>Tim Prince wrote:
>
>> Did you try putting a copy of cygwin.bat in the startup folder?  Or do you
>> mean something else?
>> ----- Original Message -----
>> From: "Paul Boniol" <CompuPaul@turbosport.com>
>> To: <cygwin@sources.redhat.com>
>> Sent: Thursday, October 05, 2000 10:38 PM
>> Subject: Starting as Service on NT
>>
>> > I would like to get Cygwin to start automatically as a service
>> > on Windows NT server (i.e., when it boots up) under a particular
>> > user's account.  Anyone know how to do this?
>> >
>> > Thank you,
>> > Paul
>
>
>******
>Get free pop3/imap/web-based e-mail with smtp support, 40 megs of space,
>autoresponders, forwarding, and more at http://www.turbosport.com,
>http://www.webmailcity.com, or http://www.mailplanet.net.
>Also sign up for free paging service!
>******
>To report SPAM mail please send an e-mail to spam@turbosport.com.
>
><a
href="http://click.linksynergy.com/fs-bin/click?id=SZd9To*quJQofferid=19156.
10000002type=1&subid=0" >Be unique at NamePlanet! firstname@lastname
addresses!</a><IMG border=0 width=1 height=1
src="http://ad.linksynergy.com/fs-bin/show?id=SZd9To*quJQbids=19156.10000002
type=1&subid=0">
>
>
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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