国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

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

2024-08-28 00:02:21
字體:
來源:轉載
供稿:網友

比較新的Linux發行版已經沒有rc.local文件了。因為已經將其服務化了。

解決方法:

1、設置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、添加啟動服務

手工創建或者拷貝已有的/etc/rc.local,并賦予執行權限

#!/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.# 下面這條是要開機啟動的命令/home/selfcs/anaconda3/bin/python /home/selfcs/t.py > /home/selfcs/auto.log exit 0#給予腳本執行權限sudo chmod +x /etc/rc.local

總結

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 会同县| 英德市| 滕州市| 蛟河市| 修水县| 临沂市| 孙吴县| 渝北区| 慈溪市| 昭平县| 青海省| 衡水市| 高青县| 阳城县| 石林| 大埔区| 桃园市| 璧山县| 红安县| 固阳县| 高碑店市| 岚皋县| 萍乡市| 武强县| 勃利县| 宜章县| 贵南县| 准格尔旗| 泗水县| 同心县| 贵州省| 遂宁市| 渝中区| 绥德县| 郓城县| 辽中县| 商城县| 新干县| 越西县| 蓬安县| 邵阳县|