[Mono-dev] mono-service bugs

Robert Jordan robertj at gmx.net
Mon Feb 4 14:30:38 EST 2008


Hi,

Avery Pennarun wrote:
> On 04/02/2008, Robert Jordan <robertj at gmx.net> wrote:
>> Mono-service might call an internal method, e.g
>> Environment.SetUserInteractive(false), via reflection.
>>
>> Another way might be to check whether the process has
>> a controlling terminal.
> 
> Do you know if mono-service drops the controlling terminal?  I suspect
> it won't if you use --debug, so that might lead to screwy behaviour.

it doesn't, AFAIK.

> I think it's safe to say that "no controlling terminal" implies "not
> UserInteractive", but "controlling terminal" does not necessarily
> imply "UserInteractive."  Do we need to do both of the above
> suggestions?

I'd go for the first and set it to false unless --debug was
supplied. This should even work for services written for
Windows that have this logic in their Main ():

if (Environment.UserInteractive)
	// run in console mode
else
	ServiceBase.Run	(...);

Robert




More information about the Mono-devel-list mailing list