How to run a shell script at startup

前端 未结 21 2010
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 13:39

On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my

21条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 14:09

    For Debian 9 see https://askubuntu.com/questions/228304/how-do-i-run-a-script-at-start-up. It is helped me. Short version for Debian 9: add commands (as root) to /etc/rc.local

    /path_to_file/filename.sh ||  exit 1   # Added by me
    exit 0
    

    Probably, /path_to_file/filename.sh should be executable (I think so).

提交回复
热议问题