[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Proposal for svnserve as a Windows service - 0.1

From: Ivan Zhakov <chemodax_at_gmail.com>
Date: 2006-02-22 17:31:18 CET

On 2/21/06, Arlie Davis <adavis@stonestreetone.com> wrote:
> I have edited my proposal, to incorporate feedback from the list. Please
> review and give feedback.
>
> Thanks.
>
> -- arlie
>
>
>
> Windows Service Support for svnserve
> ------------------------------------
>
> This is a proposal for adding support to svnserve for
> running as a Windows Service. This proposal was written by
> Arlie Davis (adavis@stonestreetone.com).
>
>
> Request for Comments
> --------------------
>
> If you are interested in this feature, please read through
> this proposal, and provide your (constructive) comments,
> either to the SVN development list (dev@subversion.tigris.org)
> or privately to me, at adavis@stonestreetone.com.
>
Good idea, you can depend on me for reviewing and commiting your
patches for this feature.

>
> Spec Change Log
> ---------------
>
> 0.0 - 2/20/2006
> Posted first version to dev list
>
> 0.1 - 2/21/2006
> Incorporated list feedback
> Changed parameters for --create-service
> Added new --update-service
> Added new --list-service
>
>
> Summary
> -------
>
> svnserve would be modified to add support for running "natively"
> as a Windows service. This allows svnserve to be managed like
> any other Windows service (start / stop from "Services"
> management tool, see status, manage it remotely, etc.), to be
> reliably started when the system boots, and to be reliably
> stopped when the system shuts down.
>
> Support will be provided for installing, enumerating, and
> uninstalling instances of svnserve services. The
> implementation would support any number of svnserve
> repositories; there will not be any limitation on the
> number of installed services.
>
>
> Command-line Changes
> --------------------
>
> svnserve would be modified to support these new command-line
> parameters:
>
> --service
>
> Causes the process to run as a Windows service. Users do
> not specify this switch; this switch will only be present
> when the service is launched by the Windows Service Control
> Manager (SCM). This flag is mutually exclusive with the
> other start-mode flags, such as --inetd, --tunnel, --daemon,
> and so on. Does not require any parameters.
>
> --create-service <name> [parameters]
>
> Installs a new Windows Service for a given Subversion
> repository. The service is created, but is intentionally
> not started. The usual Windows procedures for starting
> and stopping the service apply ("net start <name>" and
> "net stop <name>", or using the standard Windows service
> management GUI). The following parameters may be specified:
>
> --root <root>
> Specifies the root directory of the repository.
> This parameter is required.
>
> --service-start [auto|manual]
> Specifies whether the service should automatically be
> started when the system boots. "auto" means that the
> service should be started. "manual" means that the
> service should not be started, but can be started
> later by an administrator. This parameter is optional;
> if omitted, the "auto" value is the default.
>
> --listen-host <host>
> Specifies the hostname or IP address on which to listen.
> This parameter is optional; if omitted, then the service
> will listen on all installed IP interfaces.
>
> --listen-port <port>
> Specifies the TCP port on which to listen. This
> parameter is optional; if omitted, then the service
> will listen on the default port.
>
> --update-service <name> [create-parameters] [--restart]
>
> Changes the parameters of an existing service instance.
> The parameters are the same as for the --create-service
> option, in addition to the --restart parameter.
>
> This command will also check to see if the service is
> currently running. If the service is running, and the
> user has specified the --restart parameter, then the
> command will stop the service, update the configuration,
> and restart the service.
>
> If the service is running, and the user has not specified
> the --restart parameter, then the command will display
> a warning, indicating that the service needs to be stopped
> and started.
>
> If the service is not running, then the command will
> display a message indicating that the service is not
> running, and will not take any other actions; the --restart
> parameter is ignored.
>
Looks good, but why reinventing wheel? Might be use apache httpd
command line interface? Many Windows Subversion administrators already
knows apache command line.
Usage: C:\\Program Files\\Apache2\\bin\\Apache.exe [-D name] [-d
directory] [-f file]
                                               [-C "directive"] [-c "directive"]
                                               [-w] [-k
start|restart|stop|shutdown]
                                               [-k
install|config|uninstall] [-n service_name]
                                               [-v] [-V] [-h] [-l]
[-L] [-t] [-S]
Options:
[..]
  -n name : set service name and use its ServerConfigFile
  -k start : tell Apache to start
  -k restart : tell running Apache to do a graceful restart
  -k stop|shutdown : tell running Apache to shutdown
  -k install : install an Apache service
  -k config : change startup Options of an Apache service
  -k uninstall : uninstall an Apache service
[..]

Looks acceptable for me.

[..]

>
> Configuration Data
> ------------------
>
> svnserve would be modified to store and read startup parameters
> in the registry key associated with the service. This includes
> the repository root path, listen host, and listen port. This
> allows svnserve to start without requiring that these parameters
> be specified on a command-line.
I really don't understand what is the reason for storing this options
in registry. Why not specify it on command line for service?

>
> No other values would be stored in the registry. Specifically,
> there is no overlap with values stored in the registry and
> values stored in the SVN "conf" directory.
>
>
> Installer GUI
> -------------
>
> In addition to the command-line support for creating and managing
> service instances, I will contribute a GUI app for doing the same
> thing.
I consider this overkill. Windows already have GUI for managing services.

[..]

--
Ivan Zhakov
Received on Wed Feb 22 17:48:24 2006

This is an archived mail posted to the Subversion Dev mailing list.