我自己需要開機運行一個腳本,按照網上的說法,修改了/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,說明這個腳本沒有執行
添加回答
舉報
0/150
提交
取消