2016-03-08 60 views
-1

环境:无法启动,因为在rc.local启动脚本

虚拟化软件:VMware Workstation的12球员

客户机:红帽6.4

主机:Windows 7专业版服务包1

问:

我想在我的虚拟机的开机自动执行SVN更新。我编辑rc.local文件是这样的:

#!/bin/sh -e 
# 
# This script will be executed *after* all the other init scripts. 
# You can put your own initialization stuff in here if you don't 
# want to do the full Sys V style init stuff. 

sleep 10 

svn update path/to/repository 

exit 0 

但与此虚拟机无法启动,它会持续(如果我删除了svn命令行,没有问题)。如果我尝试关机或重启的客人,我们可以看到这一点:

Guest machine window

因此,这意味着SVN命令执行,但没有奏效。我已经尝试编写“svn update --username user --password xxx”,但结果相同。我如何获得svn命令来运行?

回答

0

如果你在/etc/init.d/svnserve

创建文件
#!/bin/bash 
### BEGIN INIT INFO 
# Provides:   svnserve 
# Required-Start: $local_fs $remote_fs $network $syslog 
# Required-Stop:  $local_fs $remote_fs $network $syslog 
# Default-Start:  2 3 4 5 
# Default-Stop:  0 1 6 
# X-Interactive:  true 
# Short-Description: Start/stop svnserve 
### END INIT INFO 

svnserve -d -r /PATH/TO/YOUR/REPOSITORY 

使其可执行:

chmod u+x /etc/init.d/svnserve 

创建从运行级别的脚本链接:

update-rc.d svnserve 

然后检查链接被正确创建

find /etc/ -name '*svnserve*' 

问候

丹尼尔

+0

谢谢您的回答!已经有一个svnserve文件:http://pasted.co/4000d4db。我修改它使它看起来像你的,我使用chkconfig,但它仍然没有做任何启动。 – Chaton