zoukankan      html  css  js  c++  java
  • 基于Linux Shell的开机启动服务

    CentOS重启后,很多服务需要手动启动,很是麻烦,今天把需要开机启动或关闭的服务整理了一下,放入Linux Shell中,再将该Shell加入/etc/rc.local中,即可实现存储的自动挂载、SVN、VSFTPD、防火墙等服务开机自动启动或关闭,方法如下:

    1、把./root/shell/autoRun.sh写入/etc/rc.local文件中:

    echo /root/shell/autoRun.sh >> /etc/rc.d/rc.local

    2、vi /root/shell/autoRun.sh,写入以下内容:

    #!/bin/bash
    
    #重启ssh服务
    service sshd restart
    
    #重启xinetd服务
    service xinetd restart
    
    #启动SVN服务
    svnserve -d -r /opt/svn
    
    #停止防火墙服务
    service iptables stop
    
    #挂载磁盘阵列
    mount 10.32.8.31:/vol/vol_linux1  /netapp
    
    #重启vsftpd服务
    service vsftpd restart
    
    #启动缓存系统
    #/usr/local/bin/memcached -d -m 1024 -l 10.32.8.29 -p 11211 -u root
    
    #多网卡路由设置
    #route add -net 192.192.3.9 netmask 255.255.240.0 dev eth2

     保存退出即可实现存储的自动挂载、SVN服务、VSFTPD服务开机自动启动。

  • 相关阅读:
    文本属性和属性连写
    并集选择器
    子代选择器
    后代选择器
    交集选择器
    xpath helper 表格爬取
    爬取xiachufang图片试手
    bs4 beautifullsoup网页内容选择器
    requests第三方库使用 抓取
    python 爬虫学习
  • 原文地址:https://www.cnblogs.com/yhdsir/p/5026474.html
Copyright © 2011-2022 走看看