发布网友
共1个回答
热心网友
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
***
删除开机自动启动***服务