当前位置:首页 > 计算机相关 > ubuntu系统 > 正文内容

ubuntu18.04,20.04添加rc.local启动

piikee2年前 (2021-12-06)ubuntu系统2037

ubuntu18.04开始,没有了rc.local文件,所以没办法设置一些启动项。通过以下方法,可以给ubuntu18.04或者后面版本的ubuntu20.04增加rc.local文件.

修改文件内容

sudo vim /lib/systemd/system/rc-local.service 在文件末尾增加

[Install]
WantedBy=multi-user.target
Alias=rc-local.service



touch /etc/rc.local

chmod +x /etc/rc.local

vi /etc/rc.local

输入

 #!/bin/sh 
 exit 0

ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service

执行这几句即可

扫描二维码推送至手机访问。

版权声明:本文由萍客小居发布,如需转载请注明出处。

本文链接:https://www.piikee.net/1489.html

分享给朋友:

相关文章

ubuntu14.04 解压rar和7z文件问题

rar问题apt-get   install  unrar   这是安装rar格式文件的解压apt-get   install  rar        这是安装rar文件的压缩接下来是如何使用,你可以直接输入rar  --help 会有很...

(In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))

 (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))的解决办法。在ubuntu系统中,想umount...

find命令多目录多文件查找和批量删除

linux,ubuntu,centos等系统下find文件查找命令的多目录多文件查找:find 目录一 目录二 目录三 -iname *.swf -or -iname *.txt -or -iname *.inc -or -iname *....

vi编辑器删除第一行到当前光标位置的命令

vi编辑器删除第一行到当前光标位置的命令为:1,.d其中1表示从第一行开始,逗号是分隔符,.表示当前行,也可以输入3表示第三行,d表示删除。...

ubuntu升级内核的方法(命令行升级ubuntu的内核)

sudo apt-get install linux-generic-lts-xenial linux-image-generic-lts-xenial一路y下去,最后reboot重启。重启完uname -a就可以看到新内核版本了。...

ubuntu下设置iptables方法

# whereis iptables #查看系统是否安装防火墙可以看到:iptables: /sbin/iptables /usr/share/iptables /usr/share/man/man8/iptables.8.gz #表示已经...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。