RaspberryPiをHDMI端子で液晶モニタとキーボード・USBのみ接続でLANケーブルやWiFi等のネットワークには接続せずにPythonやRubyプログラムを電源ON時に自動実行したい。
いろんなサイト等で下記rc.localを設定すれば実行できるとなっていたので実施。
$ sudo nano /etc/rc.local
下記に変更した後の内容を記載します。
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi sudo python /home/programs/py/*****.py & exit 0
exit 0の前に実行するコマンドを入力しましたが、ネットワークに繋がったLANケーブルが接続されていると自動実行されますが、LANケーブルが接続されていないと自動実行されません。
OS側で他の設定は特に変更していません。
updateやupgradeは実施しています。
OS側で何か他に設定変更する必要があるのでしょうか?
それともそもそも私の設定が間違っているのでしょうか??
宜しくお願い致します。

回答2件
あなたの回答
tips
プレビュー