本人svn服务是通过yum安装的,安装后,自定义的svn库路径为/opt/svn/repos,并且通过svnserve -d -r /opt/svn/repos启动服务成功,并且测试svn也是好用的。
问题是:最近学习systemctl命令,通过systemctl status svnserve.service命令查看svn状态,提示以下错误信息,不知道为什么会有如下错误发生:
-------------------------------------------------------------------------------------------------------------------------------------------------------
[root@localhost /]# systemctl status svnserve.service
svnserve.service - Subversion protocol daemon
   Loaded: loaded (/usr/lib/systemd/system/svnserve.service; enabled)
   Active: failed (Result: exit-code) since 一 2015-11-16 10:22:30 CST; 33min ago
  Process: 3960 ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS (code=exited, status=1/FAILURE)11月 16 10:22:29 localhost.localdomain svnserve[3960]: svnserve: 根路径“/var/svn”不存在,或者不是目录。
11月 16 10:22:29 localhost.localdomain svnserve[3960]: DIGEST-MD5 common mech free
11月 16 10:22:29 localhost.localdomain systemd[1]: svnserve.service: control process exited, code=exited status=1
11月 16 10:22:30 localhost.localdomain systemd[1]: Failed to start Subversion protocol daemon.
11月 16 10:22:30 localhost.localdomain systemd[1]: Unit svnserve.service entered failed state.

解决方案 »

  1.   

    svnserve 脚本里面的路径改下
      

  2.   

    Have a look at the /run/svnserve permission and owner. If you have changed the User that svnserve runs as then that user needs to be able to write the svnserve.pid to the /run/svnserve directory.
      

  3.   

    svnserve: 根路径“/var/svn”不存在,或者不是目录
    创建一个就成了!
      

  4.   

    [root@localhost ~]# systemctl start svnserve.service
    Job for svnserve.service failed because the control process exited with error code. See "systemctl status svnserve.service" and "journalctl -xe" for details.
    [root@localhost ~]# systemctl status svnserve.service
    ● svnserve.service - Subversion protocol daemon
       Loaded: loaded (/usr/lib/systemd/system/svnserve.service; disabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since 一 2018-07-23 19:59:59 CST; 9s ago
      Process: 10018 ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS (code=exited, status=1/FAILURE)7月 23 19:59:59 localhost.localdomain systemd[1]: Starting Subversion protocol daemon...
    7月 23 19:59:59 localhost.localdomain svnserve[10018]: svnserve: 根路径“/var/svn”不存在,或者不是目录。
    7月 23 19:59:59 localhost.localdomain systemd[1]: svnserve.service: control process exited, code=exited status=1
    7月 23 19:59:59 localhost.localdomain systemd[1]: Failed to start Subversion protocol daemon.
    7月 23 19:59:59 localhost.localdomain systemd[1]: Unit svnserve.service entered failed state.
    7月 23 19:59:59 localhost.localdomain systemd[1]: svnserve.service failed.
    Hint: Some lines were ellipsized, use -l to show in full.[root@localhost ~]# vi /etc/sysconfig/svnserve
    # OPTIONS is used to pass command-line arguments to svnserve.
    #
    # Specify the repository location in -r parameter:
    OPTIONS="-r /home/SVNdata"保存退出。启动OK了。
    [root@localhost ~]# ps aux | grep svn
    root     10045  0.0  0.0 162188   904 ?        Ss   20:03   0:00 /usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid -r /home/SVNdata
    root     10047  0.0  0.0 112664   972 pts/0    S+   20:04   0:00 grep --color=auto svn查看端口
    [root@localhost ~]# netstat -tnlp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN      10045/svnserve      
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      979/sshd            
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1530/master         
    tcp6       0      0 :::22                   :::*                    LISTEN      979/sshd            
    tcp6       0      0 ::1:25                  :::*                    LISTEN      1530/master         设置开机启动
    [root@localhost ~]# systemctl enable svnserve.service
    Created symlink from /etc/systemd/system/multi-user.target.wants/svnserve.service to /usr/lib/systemd/system/svnserve.service.开启防火墙
    [root@localhost ~]# firewall-cmd --zone=public --add-port=3690/tcp --permanent && firewall-cmd --reload
    success
    success