亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

該如何使用linux系統開機啟動自己寫的腳本?

該如何使用linux系統開機啟動自己寫的腳本?

吃雞游戲 2021-10-14 21:11:55
我自己需要開機運行一個腳本,按照網上的說法,修改了/etc/rc.local root#cat /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/home/guest/myproject/autorun.sh最后一行是我加進去的自己的腳本路徑,但是不起作用,開機還是無法自己啟動,誰知道為什么嗎?手動自己執行這個腳本是可以的。腳本可讀可寫可執行,腳本內容:[[email protected] myproject]# pwd/home/guest/myproject[[email protected] myproject]# cat autorun.sh #!/bin/bashcd /home/guest/myproject echo "I am running" > ooooo.txtnohup ./server | tee server_run.log重啟之后也沒有出現ooooo.txt,說明這個腳本沒有執行
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 285 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號