方式一:centos 7 设置svn开机自启动 使用新的systemctl 服务命令  (笔者成功验证过,该方式可行)
  1. [root@iZjvr37lpviqbkZ init.d]# vi /lib/systemd/system/svnserve.service
  2. [root@iZjvr37lpviqbkZ init.d]# vi /etc/sysconfig/svnserve
  3. [root@iZjvr37lpviqbkZ init.d]# systemctl enable svnserve.service
  4. Created symlink from /etc/systemd/system/multi-user.target.wants/svnserve.service to /usr/lib/systemd/system/svnserve.service.

安装好 svn 服务后,默认是没有随系统启动自动启动的, CentOS 7 的 /etc/rc.d/rc.local 是没有执行权限的, 系统建议创建 systemd service 启动服务

于是查看 systemd 里 svn 的配置文件 /lib/systemd/system/svnserve.service

[plain] view
plain
 copy

 
  1. [Unit]
  2. Description=Subversion protocol daemon
  3. After=syslog.target network.target
  4. [Service]
  5. Type=forking
  6. EnvironmentFile=/etc/sysconfig/svnserve
  7. ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS
  8. [Install]
  9. WantedBy=multi-user.target

找到 svn 的 service 配置文件 /etc/sysconfig/svnserve 编辑配置文件

[plain] view
plain
 copy

 
  1. vi /etc/sysconfig/svnserve

将 OPTIONS="-r /var/svn" 改为 svn 版本库存放的目录,:wq 保存退出

在提示符下输入

[plain] view
plain
 copy

 
  1. systemctl enable svnserve.service

启动服务:

  1. systemctl start svnserve.service
查看服务列表状态
  1. systemctl list-units --type=service

systemctl list-unit-files

 

重启服务器,输入

[plain] view
plain
 copy

 
  1. ps -aux | grep 'svn'

看 svn 服务启动了没有

Linux下设置svn开机自启动的更多相关文章

  1. Linux下设置Tomcat开机自启动

    --未验证 第一步:在/etc/init.d下新建一个文件tomcat(需要root操作权限) vi /etc/init.d/tomcat 然后点击"i"写下如下代码,tomcat ...

  2. linux下配置tomcat开机自启动

    Linux下配置tomcat开机自启动   1.写一个tomcat脚本,内容如下,设置其权限为755,放在/etc/init.d/目录下 #!/bin/bash## /etc/init.d/tomca ...

  3. ElasticSearch(十四):Linux下设置ElasticSearch 开机自启

    一.创建脚本文件 在  /etc/init.d  目录下,创建脚本文件 elasticsearch # cd /etc/init.d/ # vim elasticsearch 将以下内容写入文件中(其 ...

  4. Linux(CentOS)系统下设置nginx开机自启动

    Nginx 是一个很强大的高性能Web和反向代理服务器.下面介绍在linux下安装后,如何设置开机自启动.首先,在linux系统的/etc/init.d/目录下创建nginx文件,使用如下命令:vi ...

  5. linux下的tomcat开机自启动(亲测),更改静态ip

    开机自启动Tomcat: 1.修改脚本文件rc.local:vim /etc/rc.d/rc.local 这个脚本是使用者自定的开机启动程序,可以在里面添加想在系统启动之后执行的脚本或者脚本执行命令 ...

  6. Linux CentOS7 下设置tomcat 开机自启动

    网上有很多教程说是可以设置Tomcat 自启动,但是一一验证了都不行.最后找到一个方法 验证可以: 1.改rc.local   位于/etc/rc.d/文件下的rc.local   vi /etc/r ...

  7. Linux centos7下设置Tomcat开机自启动

    1,centos7 使用 systemctl 替换了 service命令 参考:redhat文档: https://access.redhat.com/documentation/en-US/Red_ ...

  8. Linux下 tomcat 的开机自启动设置

    每次开机都要启动tomcat,非常麻烦:通过直接修改系统文件,实现tomcat自启动: 1. 修改脚本文件rc.local:vim /etc/rc.d/rc.local 这个脚本是使用者自定的开机启动 ...

  9. Linux下设置Nginx开机自启

    1.本地环境 [root@dev ~]#cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) 2.在/etc/init.d创建ngi ...

随机推荐

  1. iOS 微信打开第三方应用(Universal Links 和 URL Schemes)

    一.前言 项目中时常有这种需求, 是通过链接跳转到应用内部,现在iOS主流的方案有两个 Schema: 常用在于一个应用跳转到另一个应用内部,属于应用间的跳转.当然ios9以下,网页可以通过schem ...

  2. Spring Boot 注解配置 day03

    一.SpringBoot注解 @PropertySource 和 @ImportResource和@Bean 1.@PropertySource 加载指定位置的配置文件(只能是properties文件 ...

  3. Vuex入门(5)—— 为什么要用Action管理异步操作

    Action 类似于 mutation,不同在于: 1.Action 提交的是 mutation,而不是直接变更状态. 2.Action 可以包含任意异步操作. 官方给的定义我没什么意见,事实上我通过 ...

  4. java框架之SpringCloud(2)-Rest微服务案例

    在上一章节已经对微服务与 SpringCloud 做了介绍,为方便后面学习,下面以 Dept 部门模块为例做一个微服务通用 Demo —— Consumer 消费者(Client) 通过 REST 调 ...

  5. FastDFS的单点部署

    1  安装libfastcommon 注意:在Centos7下和在Ubuntu下安装FastDFS是不同的,在Ubuntu上安装FastDFS需要安装libevent,而外Centos上安装FastD ...

  6. Could not open JDBC Connection for transaction; nested exception is com.alibaba.druid.pool.GetConnection

    Could not open JDBC Connection for transaction; nested exception is com.alibaba.druid.pool.GetConnec ...

  7. Cocos2d-js3.3 模态对话框的实现

    首先,先了解一下什么是模态对话框,百度百科的给出了下面一个定义: 模态对话框(Modal Dialogue Box,又叫做模式对话框),是指在用户想要对对话框以外的应用程序进行操作时,必须首先对该对话 ...

  8. C#设计模式(8)——桥接模式(Bridge Pattern)(转)

    一.引言 这里以电视遥控器的一个例子来引出桥接模式解决的问题,首先,我们每个牌子的电视机都有一个遥控器,此时我们能想到的一个设计是——把遥控器做为一个抽象类,抽象类中提供遥控器的所有实现,其他具体电视 ...

  9. 原生侧边栏sidebar

    创建侧栏导航 html: <a href="#" class="btn">点我啊</a> <div class="sid ...

  10. Unity之显示fps功能

    如下: using UnityEngine; using System.Collections; public class ShowFpsOnGUI : MonoBehaviour { public ...