zoukankan      html  css  js  c++  java
  • CentOS新增开机启动项

    编辑rc.local文件

     vi /etc/rc.d/rc.local

    例如

     1 #!/bin/sh
     2 #
     3 # This script will be executed *after* all the other init scripts.
     4 # You can put your own initialization stuff in here if you don't
     5 # want to do the full Sys V style init stuff.
     6 
     7 touch /var/lock/subsys/local
     8 /opt/redis/src/./redis-server /opt/redis/redis.conf
     9 
    10 memcached -d -u root -P /tmp/memcached.pid -m 128m
    11 
    12 /opt/activemq/bin/./activemq start
    13 
    14 /opt/tomcat/bin/./startup.sh
    15 
    16 /usr/local/nginx/sbin/./nginx
    17 
    19 /opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &

     赋予权限

    chmod 771 /etc/rc.d/rc.local

    若是开机不执行

    /usr/bin/rsync --daemon

    echo "/usr/bin/rsync --daemon" >> /etc/rc.local

    ls -al /etc/rc5.d/S99local 看下S99local究竟指向的是 /etc/rc.local 还是 /etc/rc.d/rc.local
    如果是/etc/rc.d/rc.local,就自己 ln -sf /etc/rc.d/rc.local /etc/rc.local

     cd /etc/init.d

    »service rc.local start
    hello world
    »initctl start rc.local
    initctl: Unknown job: rc.local
    »initctl list | grep rc
    rc stop/waiting
    rcS stop/waiting
    rc-sysinit stop/waiting
  • 相关阅读:
    ERP SYSTEM 开发指南(一)简单模块开发
    机器学习--决策树
    机器学习---线性模型
    机器学习
    《IDA Pro 权威指南》学习
    内核漏洞利用技术
    word2vec、seq2seq
    Ring0级的探索
    ActiveX 控件的漏洞挖掘
    FTP的漏洞挖掘
  • 原文地址:https://www.cnblogs.com/libaoting/p/4120500.html
Copyright © 2011-2022 走看看