ubuntu 16.04 添加开机启动项

来源:互联网 发布:阿里云域名续费 编辑:程序博客网 时间:2024/06/08 16:38

执行

# cd  /etc/init.d/

# vi test.sh

输入如下bash脚本:

#!/bin/sh### BEGIN INIT INFO# Provides: test# Short-Description: mlkk test# Description:  # Required-Start: $remote_fs $local_fs# Required-Stop: $remote_fs $local_fs# Default-Start: 2 3 4 5# Default-Stop: 0 1 6### END INIT INFO
modprobe can
exit 0

执行:

# chmod  +x test.sh

执行:

# update-rc.d  test.sh defaults  NN     (备注:NN为启动数字,数字大的启动顺序越后)

执行:

# reboot

执行:

# lsmod | head 查看是否有can字样。

(备注:bash脚本前面的字样必须加入)




原创粉丝点击