最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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)論

宁国市| 通化市| 青海省| 长岛县| 平远县| 邯郸市| 金溪县| 墨竹工卡县| 江西省| 宣威市| 阳曲县| 克山县| 晋江市| 南岸区| 镇康县| 临泽县| 西藏| 祁门县| 安庆市| 漯河市| 同仁县| 深水埗区| 乳山市| 凤台县| 吉木萨尔县| 兴义市| 信丰县| 克东县| 弥勒县| 永吉县| 合江县| 图们市| 合水县| 开平市| 崇文区| 郁南县| 巴彦淖尔市| 右玉县| 梁平县| 深水埗区| 万安县|