Method One: CentOS 7 setup SVN boot using the new SYSTEMCTL Service command (the author has successfully verified that the method is feasible)
- [Email protected] init.d]# Vi/lib/systemd/system/svnserve.service
- [Email protected] init.d]# Vi/etc/sysconfig/svnserve
- [Email protected] init.d]# Systemctl enable Svnserve.service
- Created symlink From/etc/systemd/system/multi-user.target.wants/svnserve.service to/usr/lib/systemd/system/ Svnserve.service.
After the SVN service is installed, the default is not automatically started with the system boot, CentOS 7/etc/rc.d/rc.local is not execute permissions, the system recommends the creation of SYSTEMD service startup services
Then look in the systemd svn configuration file/lib/systemd/system/svnserve.service
- [Unit]
- Description=subversion Protocol Daemon
- After=syslog.target Network.target
- [Service]
- Type=forking
- Environmentfile=/etc/sysconfig/svnserve
- Execstart=/usr/bin/svnserve--daemon--pid-file=/run/svnserve/svnserve.pid $OPTIONS
- [Install]
- Wantedby=multi-user.target
Find the SVN service profile/etc/sysconfig/svnserve Edit the configuration file
Vi/etc/sysconfig/svnserve
Change options= "-R/VAR/SVN" to SVN version inventory: Wq Save exit
At the prompt, enter
Systemctl Enable Svnserve.service
Start the service:
systemctl start svnserve.service
View Service List status
systemctl list-units --type=service
Systemctl List-unit-files
Restart the server, enter
Ps-aux | grep ' SVN '
Look at the SVN service started up no way two: the traditional way to set the SVN boot up (author in Centos7 settings not successful)
1. Installed SVN server, the default is not boot from the boot, each boot itself will be very troublesome, we can set it to boot
First: Write a startup script svn_startup.sh, which I put in/root/svn_startup.sh
#!/bin/bash
/usr/bin/svnserve-d-r/home/svnrepos/Here The Svnserve path is safe, it is best to write the absolute path, because the environment variable may not be loaded when it is started.
How do you find the absolute path?
Which Svnserve
There may also be a problem, if you build and write in Windows under the footsteps, get Linux, with VI or VIM modified may not be able to execute, this is a file format problem
VI svn_startup.sh
Input: Set FF Enter
If the displayed result is not Fileformat=unix
Re-enter
Set Ff=unix
It's OK.
Then modify the Execute permissions for the script
chmod a+x svn_startup.sh or
chmod ug+x svn_startup.sh
or everything.
chmod 777 svn_startup.sh
Last: Join Auto run
Vi/etc/rc.d/rc.local
Add the path to the script at the end, such as:
/root/svn_startup.sh
Now, you can reboot and try again. Do not know how to confirm success? I lost you.
Ps-ef|grep Svnserve
link in original: 74575458
Blog is to remember that they are easy to forget things, but also a summary of their work, the article can be reproduced, without copyright. Hope to do their own efforts to do better, we work together to improve!
If there is any problem, welcome to discuss together, code if there is a problem, you are welcome to the great God!
Set up svn to boot from Linux