LoginSignup
0
0

More than 3 years have passed since last update.

Linuxでの自動起動の方法

Posted at

はじめに

Raspberry piでarduinoなどと同様に電源ONでプログラム起動できるようにする簡単な方法を調べました。
サーバ用途の場合はサービス化した方がよさそうです。

方法

/etc/rc.localに起動したいコマンドを書く。
※「exit 0」より上に書く。

image.png

起動されるスクリプト

スクリプトはrootとして実行される。
スクリプト内では「sudo」や「su」は使用できない。(rootで実行されるので不要とは思う)
(スクリプトの例)
image.png

ここも参照
http://hendigi.karaage.xyz/2016/11/auto-boot/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0