自定义shell脚本服务开机自启动
来源:互联网 发布:阿里巴巴商学院 知乎 编辑:程序博客网 时间:2024/06/04 21:07
需求:启动linux是需要添加自定义ip地址到eth0网卡
在/etc/rc.d/init.d目录下编辑auto_run文本:
#!/bin/bash
#add ip eth0ip addr add 10.8.2.1/32 dev eth0
添加auto_run服务: chkconfig --add auto_run
报错:
service auto_run does not support chkconfig
经过查证后才知需要添加两句代码:
#chkconfig: - 85 15
#description: nginx is a World Wide Web server. It is used to serve
修改后:
#!/bin/bash
#add ip eth0#chkconfig: - 85 15
#description: nginx is a World Wide Web server. It is used to serve
ip addr add 10.8.2.1/32 dev eth0
添加auto_run:
chkconfig --add auto_run
成功!
设置auto_run服务开机自启动:
chkconfig auto_run on
0 0
- 自定义shell脚本服务开机自启动
- Linux下开机自启动自定义shell脚本
- ubuntu编写开机自启动shell脚本
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- Linux Oracle服务启动&停止脚本与开机自启动
- 常用代码片段
- PHP 线程安全与非线程安全版本的区别深入解析
- sleep(),yield()
- (四)线程之间的协作
- 第3章 IP:网际协议
- 自定义shell脚本服务开机自启动
- Tomcat简介
- OBS源码阅读笔记--取出licence和update
- web.xml
- Servlet
- c#调用控件时出现各种错误提醒
- (五)新类库的构件
- 一阶低通滤波器和二阶低通滤波器
- linear-regression