Post #152,212
4/22/04 10:29:48 AM
|

keeping server process alive after logout
We have a server process that starts but when the user who started it logs out the process is killed. How do I prevent this without changing it into a Windows service?
|
Post #152,213
4/22/04 10:48:52 AM
|

I don't think you do.
Services are how programs are run without a user being logged in.
Nobody wins in a butter eating contest
|
Post #152,215
4/22/04 11:01:36 AM
|

Isn't there a way to detach the process
like in Unix?
|
Post #152,216
4/22/04 11:03:27 AM
|

Not that I know of. Peter?
Of course, there are wrapper applications which let you run an application as a service - but I don't know details about that.
Nobody wins in a butter eating contest
|
Post #152,226
4/22/04 11:57:44 AM
|

RUN/DETACHED PATH_TO_PROGRAM.EXE /OUTPUT=MYLOGFILE.TXT
Whoops, sorry, that's VMS.
Sorry, no. You'll have to write/borrow said wrapper to run it as a service, or do some other silly shit to emulate real OS behaviour in Win32.
Peter [link|http://www.debian.org|Shill For Hire] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Blog]
|
Post #152,223
4/22/04 11:35:12 AM
|

Log in via RDP
and disconnect, rather than log out.
*chuckle*
Imric's Tips for Living
- Paranoia Is a Survival Trait
- Pessimists are never disappointed - but sometimes, if they are very lucky, they can be pleasantly surprised...
- Even though everyone is out to get you, it doesn't matter unless you let them win.
|
Nothing is as simple as it seems in the beginning, As hopeless as it seems in the middle, Or as finished as it seems in the end.
|
|
Post #153,686
5/4/04 11:31:00 AM
|

Windows service spawns another process ...
is that process automatically run as a service as well? If not, is there a way to do it?
|
Post #153,690
5/4/04 11:42:06 AM
|

Re: Windows service spawns another process ...
A process spawned by a service runs with system privilege but is not a service, in that it is not registered. If a non-admin user is logged on, the process spawned by the service will still be able to muck with drivers and protected registry that the user would not be allowed to access.
|
Post #153,702
5/4/04 12:10:25 PM
5/4/04 12:10:42 PM
|

Is there a way for the spawning service ...
to register the child process as a service?

Edited by bluke
May 4, 2004, 12:10:42 PM EDT
|
Post #153,704
5/4/04 12:29:39 PM
|

Not exactly.
If you want your secondary process to run as a service, you would have to use the service control manager api to define interface, register, and start the process. It's not as simple as spawning a process. It can be a little tricky to set up. Further, MS is allegedly doing away with user interfaces for services in the near future, but I have no details.
|