linux - rc.local 中的脚本在启动时未执行

标签 linux raspberry-pi raspbian

我在树莓派 pi2b 上运行 rasbian jessi。

我插入:sudo usr/bin/fbi -T 1 -t 1 -1 -a -noverbose/home/pi/Pictures/*.jpg 到我的 /etc/rc .local 文件,但启动时没有任何反应。如果我在终端中键入/etc/rc.local,那么我的脚本运行良好。但是在启动时没有任何反应。

我试过了

sudo usr/bin/fbi -T 1 -t 1 -1 -a -noverbose/home/pi/Pictures/*.jpg

sudo fbi -T 1 -t 1 -1 -a -noverbose/home/pi/Pictures/*.jpg

#!/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

sudo fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg

_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

最佳答案

我没有解决这个问题,但通过使用 init.d 进程而不是 rc.local 设法解决了这个问题。

此处说明: Run Script on Startup with Raspbian Jessi Wheezy and Raspberry Pi2b

关于linux - rc.local 中的脚本在启动时未执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35156220/

相关文章:

linux - 在 qt linux 中保存配置

linux - 将多个标准输出重定向到单个文件

hadoop - Raspberry Pi 到 Kafka 主题

python - 树莓派人数计入谷歌表格

linux - Raspberry PI - RT2870(内核模块 mt7601Usta)WiFi SUB dongle - 作为 WiFi 接入点

python - 如何使用 python 在 Raspberry Pi 上打开 PowerPoint?

Python 3 一起加入代码 - Raspberry Pi

Linux 比较两个文本文件

ruby-on-rails - git post-receive hook 没有运行 bundle install

linux - 挂载/卸载 USB 笔式驱动器后运行命令