linux开机脚本自启动(linux开机脚本)
生活随笔
收集整理的這篇文章主要介紹了
linux开机脚本自启动(linux开机脚本)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
linux開機自動啟動腳本放在哪兒?
在/etc/rc.local中添加如果不想將腳本粘來粘去,或創建鏈接什么的,則:step1.先修改好腳本,使其所有模塊都能在任意目錄啟動時正常執行;step2.再在/etc/rc.local的末尾添加一行以絕對路徑啟動腳本的行;如:$ vim /etc/rc.local#!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.touch /var/lock/subsys/local. /etc/rc.d/rc.tune/opt/pjt_test/test.pl保存并退出;
linux如何開機自動運行sh腳本?
要開機 運行只需將它加入到 rc.local ,一般為/etc/rc.d/rc.local 在其中加入以下行:
sh /path/to/test.sh
使用linux全局變量$?可以確定是否執行,如
if
then
echo "succeed!"
fi
#modified some typo --update @22:48
總結
以上是生活随笔為你收集整理的linux开机脚本自启动(linux开机脚本)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python股票自动买卖视频教程_十分钟
- 下一篇: js动态给按钮赋id_如何给SHOPIF