AUTO-UP
配置Linux开机自启动 #
方式一,(rc.local)启动说明 #
脚本位置
/etc/rc.local -> /etc/rc.d/rc.local
脚本内容
nexus(runself)
tomcat(runself)
-rwxr-xr-x 1 elizabeth root
frp(forNAT-runself)
-rwxrwxrwx 1 elizabeth root
方式二,(chkconfig)启动说明 #
简介
制作启动脚本
1 `vim /etc/init.d/zentao`
```shell
#!/bin/bash
# chkconfig: 2345 85 15
# description: auto luanch service of zentao
# It has a lot of features
# processname: zentao
case "$1" in
start ) echo 'start' ;;
stop ) echo 'stop' ;;
restart) echo 'restart';;
status ) echo 'status' ;;
* ) echo 'invalid';;
esac
```
2 `将启动脚本权限改为可执行`
$ chmod a+x /etc/init.d/zentao
3 `添加启动项并启动`
$ chkconfig --add zentao
$ chkconfig --zentao on
4 `检查是否设置成功`
$ chkconfig –list |grep zentao
5 `需要注意`
```shell
在这个脚本的编写过程中,其中开头有几个虽然是以注释形式出现的属性,
但是要注册服务的话必须拥有,其中chkconfig 2345 85 15 这三个数字表示。
2345:表示0-6这七个等级开关(上图最后一行),
85表示开启时候的优先级,15表示关闭的时候的优先级,
所以开启的时候尽量数字写大点,优先级低点,关闭的时候优先级高点,最先关闭。
```
方式三,(ntsysv)图形化配置(root) #
comments powered by Disqus