ubuntu 20開啟rc.local


新版的ubuntu去掉了rc.loca,改用systemd的service方式

rc.local使用習慣了,現把它找回來

ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service
touch /etc/rc.local
chmod +x /etc/rc.local

 

修改/etc/rc.local內容:

#!/bin/bash

#你的命令,不要有死循環或無法退出的程序,不然進不了系統
#mount -t 9p -o trans=virtio hostshare /mnt/share

exit 0

  

直接執行生效

/etc/rc.local start


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM