Jump to...
redirecting...

Log for Ubuntu 台灣社群

[photo](media:AgADBQADU6kxGwmliFUwomAxEmBxl3Gn-TIABAEAAwIAA20AA9gXBQABFgQ@telegram)
請問 18.04 預設不用 /etc/rc.local 了 那有什麼替代方案可以在開機後自動執行?
寫一個systemd的startup script就可以了
crontab不行嗎?
# vi /lib/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

[Install]
WantedBy=multi-user.target



重新載入systemd
# systemctl daemon-reload

開機啓動rc-local.service
# systemctl enable rc-local.service
這是改用systemd 來管 實在不是很想這麼做 0rz , anyway thanks !
How to install package from ubuntu desktop distro?(package in ubuntu server distro is too old)
download source and compile ?
Oh
之前在18.04下試過
我記得直接建立一個/etc/rc.local
然後chmod 755
這樣它就會在開機時執行了
但感覺這只是個過渡期的作法
也許以後/etc/rc.local會完全消失吧
no , 還必須要啟動 systemd 的 rc.local service /etc/rc.local 才有作用
我剛在虛擬機灌了一個全新的Ubuntu 18.04
的確是兩個步驟它就會自己run起來了
這是之前找到的教學
https://steemit.com/cn/@oflyhigh/ubuntu-18-04-rc-local
thanks , I will try tomorrow
大神幫幫我
[photo](media:AgADBQADy6gxG66eiFUEJ_-v7pr7IRGn-TIABAEAAwIAA20AAyAnBQABFgQ@telegram)
我連用浮動IP 的 telnet 25 去寄信給自己都可以收到了
qq来了
好吧 我卸载了