[SVN] Set the SVN service to start automatically under ubuntu

Table of contents

0. Background + environment

1. Start-up steps


0. Background + environment

1) Under ubuntu, the svn version library has been built. For the specific building method, refer to other blog links at the end of the article

2) In the process of setting up the svn server, it was found that after ubuntu restarted, the svn service was closed

When svn is normally opened, see the figure below

 So here is a script to make the svn service start automatically

1. Start-up steps

1) Write a script startsvn.sh under /etc/init.d/

cd /etc/init.d

sudo touch startsvn.sh

sudo vim startsvn.sh

Script content:

#!/bin/bash

#!/bin/sh
### BEGIN INIT INFO
# Provides:          startsvn.sh
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: start svn service
### END INIT INFO

svnserve -d -r /usr/svn

 Note: Here /usr/svn is your ubuntu's own version library , and the blogger's version library is this path

create.sh:

Edit .sh content:

2) After the content is saved, give startsvn.sh +x permission or modify the permission of 755

Method one + x permissions: sudo chmod +x startsvn.sh

Method 2 Modify 755 permissions: sudo chmod 755 startsvn.sh

3) Use the ubuntu tool update-rc.d

sudo update-rc.d startsvn.sh defaults 100

Then reboot to restart 

At this point, svn boot self-starting configuration is complete


test:

reboot free

View svn status with command

ps aux|grab svnserve

The sentence with the red arrow pointing to it means that it has been started automatically.

 I also tried connecting and transferring files on the windows client, and they are all ok

--END--


Related blogs:

1) SVN builds the ubuntu server process (graphics and texts are super detailed)

2) The SVN client under windows accesses the SVN server under ubuntu

3) Download and installation of SVN client (graphics and texts are super detailed)

Guess you like

Origin blog.csdn.net/qq_41539778/article/details/131060072