Centos7開機啟動php指令碼

2021-10-23 07:43:42 字數 544 閱讀 7723

1,cd /etc/rc.d/init.d;

2,新增開機啟動shell指令碼myscript.sh,內容如下:

#!/bin/bash

# chkconfig: 2345 90 99

# description: express_task service auto start

/usr/bin/php /mnt/clientone.php

/usr/bin/php /mnt/server.php

3,賦予myscript.sh可執行許可權:chmod +x ./myscript.sh;

4,新增指令碼到開機啟動專案中:

①:chkconfig --add myscript.sh

②:chkconfig myscript.sh on

5,重啟,驗證結果:reboot

1,執行:chkconfig --list 命令,檢視當前設定開機啟動的服務;

2,找到我們剛剛新增的myscript服務,執行:chkconfig --del myscript 命令刪除。

Centos7開機啟動程式

1.自己新建乙個指令碼,如centnet service.sh mkdir centnet 建立檔案 centnet service.sh 經過後面的幾個步驟後,這個指令碼在開機的時候會執行,在這個指令碼裡面可以寫你開機的時候想執行的命令,如啟動tomcat,oracle等服務 2.在指令碼中輸入啟...

centos 7 開機啟動配置

centos 7 開機啟動 1 開機啟動配置檔案位於 usr lib systemd system 2 nginx的配置 unit description nginx high performance web server after network.target remote fs.target ...

Centos7 開機自動啟動服務

第一種方法 在 etc rc.d rc.local 的檔案中新增你要開機啟動服務的絕對路徑 第二種方法 寫乙個指令碼 用stop或satart來控 務的啟動 把這個指令碼放入 etc rc.d init.d 中並給它可執行許可權 chmod a x 這樣就可以用service啟動啦,如果你還想開機啟...