亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Linux中沒有rc.local文件的完美解決方法

 更新時(shí)間:2019年09月20日 10:18:19   作者:selfcs  
這篇文章主要介紹了Linux中沒有rc.local文件的解決方法,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

比較新的Linux發(fā)行版已經(jīng)沒有rc.local文件了。因?yàn)橐呀?jīng)將其服務(wù)化了。

解決方法:

1、設(shè)置rc-local.service

sudo vim /etc/systemd/system/rc-local.service
[Unit]
 Description=/etc/rc.local Compatibility
 ConditionPathExists=/etc/rc.local
[Service]
 Type=forking
 ExecStart=/etc/rc.local start
 TimeoutSec=0
 StandardOutput=tty
 RemainAfterExit=yes
 SysVStartPriority=99
[Install]
 WantedBy=multi-user.target

2、激活rc-local.service

sudo systemctl enable rc-local.service

3、添加啟動(dòng)服務(wù)

手工創(chuàng)建或者拷貝已有的/etc/rc.local,并賦予執(zhí)行權(quán)限

#!/bin/sh -e
# 
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# 下面這條是要開機(jī)啟動(dòng)的命令
/home/selfcs/anaconda3/bin/python /home/selfcs/t.py > /home/selfcs/auto.log 

exit 0
#給予腳本執(zhí)行權(quán)限
sudo chmod +x /etc/rc.local

總結(jié)

以上所述是小編給大家介紹的Linux中沒有rc.local文件的完美解決方法,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!

相關(guān)文章

最新評(píng)論