sersync 是一个软件,, 相应的他的启动时一个脚本执行, 并非命令,, 所以添加到 / etc/rc.local 中没有效果
我们从网络上下载好 sersync,, 解压到本地,, 然后将 sersync 这个目录复制到 / usr/local 下
将 / usr/local/sersync/bin/sersync 赋予可执行权限 然后复制到 / etc/init.d 下
然后在 / etc/init.d 中编写脚本如下:(这里我命名为 sersync.sh)
- #!/bin/bash
- # chkconfig: 2345 10 90
- # description: resind
- /usr/local/sersync/bin/sersync -dro /usr/local/sersync/conf/confxml.xml
然后将该脚本赋予可执行权限 chmod +x sersync.sh
将脚本添加到系统服务:
添加到系统服务
chkconfig --add sersync.sh
设置开机自启动:
chkconfig sersync.sh on
最后重启一下试试吧 shutdown -r 0
来源: http://www.bubuko.com/infodetail-2927923.html