首页 > 系统 > linux > 正文

linux设开机自启动服务
2013-07-23 08:34:55 点击:

linux设开机自启动服务 1. 把启动命令放到/etc/rc.local中, 编辑:/etc/rc.local文件 如下:可以添加直接服务启动,也可以添加S...
linux设开机自启动服务
 
    1. 把启动命令放到/etc/rc.local中,
    编辑:/etc/rc.local文件
    如下:可以添加直接服务启动,也可以添加SHELL脚本
 
    bash /etc/init.d/webstart start
    bash /etc/init.d/redis
 
    以上运行的程序都是以root权限来执行的。如果某些程序要以某个用户的身份去运行,那么可以这样:
 
    su show -c /home/show/server/tomcat/bin/startup.sh
 
    2. chkconfig命令
 
    [root@localhost ~]# chkconfig --list     显示开机可以自动启动的服务
    [root@localhost ~]# chkconfig --add *** 添加开机自动启动***服务
    [root@localhost ~]# chkconfig --del ***   删除开机自动启动***服务
 


相关热词搜索:linux 开机 启动

上一篇:Linux端口的关闭和启用
下一篇:LINUX安装ImageMagick和PHP Imagick扩展