[ntp:questions] Re: Specifying command line parameters for ntpd running as a w2k service?

mayer at gis.net mayer at gis.net
Fri Jan 21 23:16:42 UTC 2005


mayer at gis.net wrote:
> Terje Mathisen wrote:
> > Martin Burnicki wrote:
> > > mayer at gis.net wrote:
> > >
> > >>No, there is no specific key you can set for a service to
> automatically
> > >>read and pass. The basic design of services assumes a
> Windows-centric
> > >>view where all keys can be read directly out of the registry and
it
> > >>doesn't need to pass any command line options. Getting around
this
> > >>problem is a chore.
> > >
> > >
> > > I'm currently looking at how this could be implemented the best
> way.
> > >
> > > Assuming we already have added a Windows registry key which
> contains a
> > > string of command line parameters, e.g. "-g -L" OR "-gL".
> > >
> > > Normally if ntpd starts as service it would read the registry key
> and
> > > evaluate the contents of the registry key string.
> > >
> > > However, ntpd can also be run from a command line. Depending on
the
> actual
> > > command line parameters, it can stay in the foreground, or start
> itself as
> > > service.
> > >
>
> You already know whether or not it is being run interactively
> or the service since it comes in at NTmain in ntservice.c or
> through main in ntpd.c if running as a service. You can therefore
> set flags and values appropriately to do the rigt thing.
>

That didn't come out very well so let me rewrite it.

You already know whether or not it is being run interactively
or as a service since it comes in at NTmain in ntservice.c
if it is interactive and through main in ntpd.c if running
as a service. You can therefore set flags and values
appropriately to do the right thing.

Danny




More information about the questions mailing list