38 1234
发新话题
打印

subversion安装包可以下载了!启动服务怎么……

subversion安装包可以下载了!启动服务怎么……

subversion安装包可以下载了!

http://subversion.tigris.org/files/documents/15/34093/svn-1.4.0-setup.exe

可是启动服务谁能给个详细的配置方法?

[ 本帖最后由 snowvan 于 2006-9-15 23:10 编辑 ]

TOP

启动什么服务?

TOP

创建服务
sc create svnservice binpath= "e:\versioncontrol\subversion\bin\svnserve.exe --service" displayname= "svnservice" depend= Tcpip
设置为自启动
sc config svnservice start= auto
启动服务
net start svnservice

注意:上面的命令行右边都有一个空格,左边没有

TOP

sc是什么东西?

TOP

C:\>sc
DESCRIPTION:
        SC is a command line program used for communicating with the
        NT Service Controller and services.
USAGE:
        sc <server> [command] [service name] <option1> <option2>...

        The option <server> has the form "\\ServerName"
        Further help on commands can be obtained by typing: "sc [command]"
        Commands:
          query-----------Queries the status for a service, or
                          enumerates the status for types of services.
          queryex---------Queries the extended status for a service, or
                          enumerates the status for types of services.
          start-----------Starts a service.
          pause-----------Sends a PAUSE control request to a service.
          interrogate-----Sends an INTERROGATE control request to a service.
          continue--------Sends a CONTINUE control request to a service.
          stop------------Sends a STOP request to a service.
          config----------Changes the configuration of a service (persistant).
          description-----Changes the description of a service.
          failure---------Changes the actions taken by a service upon failure.
          qc--------------Queries the configuration information for a service.
          qdescription----Queries the description for a service.
          qfailure--------Queries the actions taken by a service upon failure.
          delete----------Deletes a service (from the registry).
          create----------Creates a service. (adds it to the registry).
          control---------Sends a control to a service.
          sdshow----------Displays a service's security descriptor.
          sdset-----------Sets a service's security descriptor.
          GetDisplayName--Gets the DisplayName for a service.
          GetKeyName------Gets the ServiceKeyName for a service.
          EnumDepend------Enumerates Service Dependencies.

        The following commands don't require a service name:
        sc <server> <command> <option>
          boot------------(ok | bad) Indicates whether the last boot should
                          be saved as the last-known-good boot configuration
          Lock------------Locks the Service Database
          QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
        sc start MyService

Would you like to see help for the QUERY and QUERYEX commands? [ y | n ]: y
QUERY and QUERYEX OPTIONS :
        If the query command is followed by a service name, the status
        for that service is returned.  Further options do not apply in
        this case.  If the query command is followed by nothing or one of
        the options listed below, the services are enumerated.
    type=    Type of services to enumerate (driver, service, all)
             (default = service)
    state=   State of services to enumerate (inactive, all)
             (default = active)
    bufsize= The size (in bytes) of the enumeration buffer
             (default = 4096)
    ri=      The resume index number at which to begin the enumeration
             (default = 0)
    group=   Service group to enumerate
             (default = all groups)
SYNTAX EXAMPLES
sc query                - Enumerates status for active services & drivers
sc query messenger      - Displays status for the messenger service
sc queryex messenger    - Displays extended status for the messenger service
sc query type= driver   - Enumerates only active drivers
sc query type= service  - Enumerates only Win32 services
sc query state= all     - Enumerates all services & drivers
sc query bufsize= 50    - Enumerates with a 50 byte buffer.
sc query ri= 14         - Enumerates with resume index = 14
sc queryex group= ""    - Enumerates active services not in a group
sc query type= service type= interact - Enumerates all interactive services
sc query type= driver group= NDIS     - Enumerates all NDIS drivers

TOP

请问我这么写有什么问题?因为我想把仓库的路径给加到这个命令里面去。命令行提示无法执行。谢谢。

sc create SubversionService  binpath= "\"d:\program files\subversion\bin\svnserve.exe\" --service -root F:\subversion\Repository"   displayname= "Subversion Repository" depend= Tcpip

系统是windowsXP sp2,subversion版本是1.4.0,参照的是http://svn.collab.net/repos/svn/ ... windows-service.txt

附加:尝试这么也不行。
sc create svnservice binpath= "d:\program files\subversion\bin\svnserve.exe --service" displayname= "Subversion Repository" depend= Tcpip

尝试了一些类似的其它操作也不行,出来类似的错误。

[ 本帖最后由 luckyfox 于 2006-9-16 23:04 编辑 ]

TOP

注意binpath的写法,路径要用""包起来,而且"要写成\",所以创建服务时应写成:

sc create SubversionService  binpath= "\"d:\program files\subversion\bin\svnserve.exe\" --service -root \"F:\subversion\Repository\""   displayname= "Subversion Repository" depend= Tcpip

TOP

sc的中文描述,适用于WinXP及以上系统

描述:
        SC 是用于与服务控制管理器通信的命令行程序。
用法:
        sc <server> [command] [service name] <option1> <option2>...


        选项 <server> 的格式为 "\\ServerName"
        可以键入 "sc [command]"以获得命令的进一步帮助
        命令:
          query-----------查询服务的状态,
                          或枚举服务类型的状态。
          queryex---------查询服务的扩展状态,
                          或枚举服务类型的状态。
          start-----------启动服务。
          pause-----------发送 PAUSE 控制请求到服务。
          interrogate-----发送 INTERROGATE 控制请求到服务。
          continue--------发送 CONTINUE 控制请求到服务。
          stop------------发送 STOP 请求到服务。
          config----------(永久地)更改服务的配置。
          description-----更改服务的描述。
          failure---------更改服务失败时所进行的操作。
          qc--------------查询服务的配置信息。
          qdescription----查询服务的描述。
          qfailure--------查询失败服务所进行的操作。
          delete----------(从注册表)删除服务。
          create----------创建服务(将其添加到注册表)。
          control---------发送控制到服务。
          sdshow----------显示服务的安全描述符。
          sdset-----------设置服务的安全描述符。
          GetDisplayName--获取服务的 DisplayName。
          GetKeyName------获取服务的 ServiceKeyName。
          EnumDepend------枚举服务的依存关系。

        下列命令不查询服务名称:
        sc <server> <command> <option>
          boot------------(ok | bad) 表明是否将上一次启动保存为
                          最后所知的好的启动配置
          Lock------------锁定服务数据库
          QueryLock-------查询 SCManager 数据库的 LockStatus
示例:
        sc start MyService

您想查阅 QUERY 和 QUERYEX 命令的帮助吗? [ y | n ]:
y

QUERY 和 QUERYEX 选项:
        如果查询命令带服务名称,将返回
        该服务的状态。其他选项不适合这种
        情况。如果查询命令不带参数或
        带下列选项之一,将枚举此服务。
    type=    要枚举的服务的类型(driver, service, all)
             默认 = service)
    state=   要枚举的服务的状态 (inactive, all)
             (默认 = active)\n"
    bufsize= 枚举缓冲区的大小(以字节计)
             (默认 = 4096)
    ri=      开始枚举的恢复索引号\n"
             (默认 = 0)
    group=   要枚举的服务组
             (默认 = all groups)

句法示例
sc query                - 枚举活动服务和驱动程序的状态
sc query messenger      - 显示信使服务的状态
sc queryex messenger    - 显示信使服务的扩展状态
sc query type= driver   - 仅枚举活动驱动程序
sc query type= service  - 仅枚举 Win32 服务
sc query state= all     - 枚举所有服务和驱动程序
sc query bufsize= 50    - 枚举缓冲区为 50 字节
sc query ri= 14         - 枚举时恢复索引 = 14
sc queryex group= \"\"  - 枚举不在组内的活动服务
sc query type= service type= interact - 枚举所有不活动服务
sc query type= driver group= NDIS     - 枚举所有 NDIS 驱动程序

TOP

我使用svnservic并不需要sc的参与,你看过svnservice的文档?

TOP

引用:
原帖由 quicksand 于 2006-9-17 07:56 发表
注意binpath的写法,路径要用""包起来,而且"要写成\",所以创建服务时应写成:

sc create SubversionService  binpath= "\"d:\program files\subversion\bin\svnserve.exe\&qu ...
谢谢quicksand的指点,原来是我后面的仓库路径写的不对,看那个说明上没这么说,只是说有空格等字符的时候用"\",所以后面的路径就没用这种写法。

我采用下面这种方法完成了设置,下载的svnservice.exe。其实我1.3.*就采用了这种方式,升级以后我想采用svn自身提供的方法吧,没想到没搞定。我翻了一下原来的设置方式,感觉应该和svn版本没关系,同样适合,就不采用这种最新方式了。

下面内容来源: http://www.duduwolf.com/post/setting_up_subversion.asp

STEP 4:运行SVN服务


在命令行执行
svnserve --daemon --root E:\svn\repository
服务启动,--daemon可简写为-d,--root可简写为-r,可以建立一个批处理文件并放在windows启动组中便于开机就运行SVN服务,或者在这个地址http://clanlib.org/~mbn/svnservice/下载那个svnservice.exe文件,拷贝到E:\svn\bin目录下,再从命令行下执行:
svnservice -install --daemon --root "E:\svn\Repository"
sc config svnservice start= auto
net start svnservice
此文件会将SVN变成windows系统的一个服务,并默认为自启动,注意:执行第三句时确保前面以命令行方式运行的SVN服务已经停止,如果没停止可在其窗口中按Ctrl+C中止运行。

[ 本帖最后由 luckyfox 于 2006-9-17 09:39 编辑 ]

TOP

 38 1234
发新话题