[Mono-devel-list] Re: Mono-devel-list digest, Vol 1 #1576 - 3 msgs
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
> 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);
> asmpath=Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, AppDomain.CurrentDomain.FriendlyName);
> si.Context.Parameters["assemblypath"] ="\"" +
> asmpath +
> "\" /s";
> IDictionary stateSaver = new Hashtable();
> > 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
> Michael Rasmussen
> Get my public GnuPG keys:
> michael rasmussen cc
> mir datanom net
> mir miras org
> 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.
More information about the Mono-devel-list