LoginSignup
0
1

More than 5 years have passed since last update.

line monitor > /etc/rc.local (151213)

Last updated at Posted at 2015-12-13

line monitor
http://qiita.com/7of9/items/028556c5a819a6a8de96


2015年12月13日現在、/etc/rc.localに記載しているもの。

## for line monitor
cd /home/pi/lineMonitor/python-151113-lineMonitor
nohup ./linemonitor.py &

## IP address display (2015 Nov. 28)
cd /home/pi/lineMonitor/python-151127-7segLed_IPadrDisplay
nohup ./IPadrDisplay.py &

## shutdown (2015 Dec. 05)
cd /home/pi/lineMonitor/python-151205-shutdownButton
nohup ./shutdownButton.py &

## USB copy (2015 Dec. 12)
cd /home/pi/lineMonitor/python-151212-logFolderCopier
nohup ./logFolderCopier.py /home/pi/lineMonitor/python-151113-lineMonitor/Log/ &

exit 0

こういうのはgitで管理していないので、microSDがとんだら復旧が面倒。

nohupでなくsudo &

(追記 2018/03/12)

上記の例ではnohupを使っているが、/etc/rc.localの設定例をいくつか見ると以下の書き方をするようだ。

...
## IP address display (2015 Nov. 28)
cd /home/pi/lineMonitor/python-151127-7segLed_IPadrDisplay
sudo ./IPadrDisplay.py &
...

.pyにchmodで実行権限をつけていない場合はsudo python ファイル名.py &とする。

0
1
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
1