为debian7的旧系统添加开机启动项

新建启动脚本文件,

vi /etc/init.d/ktsee-app

填入脚本

#!/bin/sh

### BEGIN INIT INFO

# Provides: ktsee-app

# Required-Start: $network $remote_fs $local_fs

# Required-Stop: $network $remote_fs $local_fs

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: ktsee-app init script

# Description: ktsee-app init script, written by ktsee

### END INIT INFO

[需要执行的命令]

exit 0

如果是需要开机在后台执行,把上面需要执行的命令换成以下

nohup [需要执行的命令] >/dev/null 2>&1 &

为脚本文件增加执行权限

chmod +x /etc/init.d/ktsee-app

接着加入开机启动项

update-rc.d ktsee-app defaults

测试

/etc/init.d/ktsee-app

如果需要移除开机启动项,使用

update-rc.d -f ktsee-app remove

评论

Popular Posts

《活法》作者:[日]稻盛和夫 pdf下载

浩方对战平台优化版 V2.05 部分去除浩方广告和弹出窗口

麦当劳免费Wifi帐号密码及连接设置

解决word和excel运行时错误:91未设置对象变量或with block变量

MIFARE Classic Tool - 安卓NFC门禁卡修改工具

U盾安装及检测不到U盾问题的排查方法

Superheroes - The Script

《挪威的森林》精彩篇章:永远记得我