[Mono-devel-list] Re: Mono-devel-list digest, Vol 1 #1576 - 3 msgs

Rafael Teixeira monoman at gmail.com
Mon Apr 4 10:10:19 EDT 2005

On Apr 3, 2005 12:49 AM, Michael Rasmussen <mir at miras.org> wrote:
> lør, 02 04 2005 kl. 11:05 -0500, skrev Jonathan Pryor:
> How does it work on windows when you install an application running as a
> service? What part of the winapi is used? (Sorry for asking this if it
> is a trivial question. By knowledge of windows is very sparse)

Windows has a service manager that start services in a headless way,
with the SYSTEM user account. AFAIK, this service talks to services
(to pause/stop/restart) via pipes.

In Linux, we have init scripts and those can talk to running servers
via signals, but there's no central service manager and we have only
some conventions not a rigid API for a service to follow.

In Windows this API  extends beyond controlling services to
performance monitoring and logging, all of this has to be duplicated
in Linux or inside Mono for Mono to really host .NET Services in a
more natural way...

I think costs to implement all that are steep and the benefits are
harder to evaluate as significant. But if more people express the
need, and better, contribute code, things can surely advance.


>                 public static void Install()
>                 {
>                         ServiceInstaller si = new ServiceInstaller();
>                         ServiceProcessInstaller spi = new
> ServiceProcessInstaller();
>                         spi.Account = ServiceAccount.LocalSystem;
>                         si.Parent = spi;
>                         si.DisplayName = DISPLAY_NAME;
>                         si.ServiceName = SERVICE_NAME;
>                         si.StartType = ServiceStartMode.Automatic;
>                         si.Context = new
> System.Configuration.Install.InstallContext("install.log", null);
>                         string
> asmpath=Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, AppDomain.CurrentDomain.FriendlyName);
>                         si.Context.Parameters["assemblypath"] ="\"" +
> asmpath +
> "\" /s";
>                         IDictionary stateSaver = new Hashtable();
>                         si.Install(stateSaver);
>                 }
> > This is especially attractive, as the mono convention is to provide a
> > shell script to start your program (/usr/bin/mcs is a shell-script), so
> > you could modify this shell script to run "nohup mono myprogram.exe" if
> > your --background option is specified.
> >
> This could be a working hack. Not entirely satisfactory though.
> > As for portability, you've lost portability as soon as you use
> > Mono.Unix, which (except for Stdlib and related classes) will only run
> > under Unix-like platforms.  If you're on a Unix-like platform, you
> > should be able to add your own P/Invoke calls relying upon unix
> > functionality.
> >
> I see your point.
> > I think we also have differing opinions behind the "whole idea behind
> > C#".  It is not a Java replacement, attempting to provide "write once,
> > run anywhere" portability -- just looking at System.Windows.Forms should
> > reinforce this.  Mono/C# is an environment allowing greater productivity
> > while still making the most of your target platform.  If you can do this
> > while being portability, so much the better, but Mono won't try to
> > ensure portability.  The ease of P/Invoke should reinforce this view.
> Bad formulated from me. What I meant to argue was the idea behind Mono
> is to be able to have an application written on either *nix or windows
> to be able to run on all platforms which is supported by mono or dot
> net.
> Hilsen/Regards
> Michael Rasmussen
> Get my public GnuPG keys:
> michael  rasmussen  cc
> http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xD3C9A00E
> mir  datanom  net
> http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE501F51C
> mir  miras  org
> http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
> --------------------------------------------------------------
> Princess Leia:
> I'll be back.

Rafael "Monoman" Teixeira
I'm trying to become a "Rosh Gadol" before my own eyes. 
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
It hurts!

More information about the Mono-devel-list mailing list