linux自启动服务方式

方式一:

  /etc/init.d/servicename  restart 

  编写 /etc/init.d/ 下面的标准的服务shell脚本

方式二:

    vim /etc/rc.local

  /home/memcached/bin/memcached -d -m 200 -u root -l 192.168.1.218 -p 11212 -c 1000 -P /tmp/memcached.pid

    /home/memcached/bin/memcached -d -m 200 -u root -l 192.168.1.218 -p 11213 -c 1000 -P /tmp/memcached.pid

方式三:

  ntsysv --level 234  图形界面设置启动

  或者

  chkconfig 命令 打开关闭

 

原文地址:https://www.cnblogs.com/icyy/p/4649295.html