方式一: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. python全栈开发 * 29知识点汇总 * 180712

    29 正则表达式 re模块一.正则表达式官方定义:正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符.及这些特定字符的组合,组成一个“规则字符串”, 这个“规则字符串”用来表达对字 ...

  2. 线程同步-使用SimaphoreSlim类

    SimaphoreSlim类是作为Semaphore类的轻量级版本的.该类限制了同时访问同一个资源的线程数量. 代码Demo: using System;using System.Threading; ...

  3. Filter and servlet

    filter与servlet的区别与联系呢? 1. Filter    实现javax.servlet.Filter接口,在web.xml中配置与标签指定使用哪个Filter实现类过滤哪些URL链接. ...

  4. Navicat 远程连接 Oracle11g 数据库报错 No listener 的问题

    1.首先确认已经启动 OracleOraDb11g_home1TNSListener 服务时,仍无法连接:   2.进入计算机系统属性中查看 Oracle 服务端计算机的全名:   3.进入 Orac ...

  5. Echarts-图表根据值的不同展示成不同的颜色

    series : [        {            name:'直接访问',            type:'bar',            barWidth: '60%',      ...

  6. 求职季全攻略:优秀的UX设计师作品集该如何准备?

    这是一篇关于如何制作杰出的UX设计师作品集,看了下文,我们在2019年冲冲冲~制作出自己的作品集! 转自墨刀公众号. Paul Rand 曾经说:“设计很简单,因而也复杂.” 也许你已经掌握了所有的U ...

  7. android 前台服务不显示通知

    原因可以在哪里写了执行完成后就自动结束的吧 导致前台服务没有出现 如我 @Override public int onStartCommand(Intent intent, int flags, in ...

  8. This Debug perspective is designed to support application debugging.it incorporates views for displaying the debug stack,variables and breakpoint mamagement

    使用IDE(Eclipse Version:Neon.2 Release (4.6.2)),出现以下提示信息: This kind of launch is configured to openthe ...

  9. scrum学习笔记

    http://www.scrumcn.com/agile/scrum-knowledge-library/scrum.html#tab-id-1 推荐电子书 <Scrum精髓_敏捷转型指南> ...

  10. CentOS 7 之 Systemd 入门教程:实战篇

    开机启动对于那些支持 Systemd 的软件,安装的时候,会自动在/usr/lib/systemd/system目录添加一个配置文件. 如果你想让该软件开机启动,就执行下面的命令(以httpd.ser ...