Raspberry piの起動時に、Pythonコード "iotrobot.py"を起動させたいです。
rc.localに記述しましたが、本体の起動時にエラーとなります。
#エラー
[Failed]Failed to start /etc/rc.local Compatibility.
See "systemctl status rc-local.service" for detrails.
詳細
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; enabled)
Drop-In: /etc/systemd/system/rc-local.service.d
└─ttyoutput.conf
Active: failed (Result: exit-code) since 金 2018-11-09 19:14:01 JST; 14min ago
Process: 464 ExecStart=/etc/rc.local start (code=exited, status=127)
Warning: Unit file changed on disk, 'systemctl daemon-reload' recommended.
#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
iotrobot.py
exit 0
#追記
pythonファイルが実行されたらログが残るようにしていますが、
ログが吐き出されていないのを確認済みです。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。