centos7中svn服务启动问题

liming1019 2015-11-16 02:05:07
本人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.
...全文
2960 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
z15158080 2018-07-23
  • 打赏
  • 举报
回复
[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
lq2003 2017-12-06
  • 打赏
  • 举报
回复
svnserve: 根路径“/var/svn”不存在,或者不是目录 创建一个就成了!
longweis 2016-03-04
  • 打赏
  • 举报
回复
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.
  • 打赏
  • 举报
回复
看英文提示,错误信息及原因,不全都有了么
常书 2016-01-04
  • 打赏
  • 举报
回复
既然提示不存在,那么创建一个再试试看
皇御雷霆 2016-01-03
  • 打赏
  • 举报
回复
svnserve 脚本里面的路径改下
FightForProgrammer 2015-11-17
  • 打赏
  • 举报
回复
这样的问题可以搜得到吧

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧