如何在 Pi 板启动时自动 运行 a.out 文件?

How to automatically run a.out file at the startup in Pi board?

我有一个可执行文件 a.out 并且我想在我的 Pi 板每次启动时 运行 它?有什么建议我该怎么做?

/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.

另外,你知道这个板子吗:https://raspberrypi.stackexchange.com/

在 /etc/init.d 中创建一个新的 shell 脚本,其中包含您的应用程序的路径:

#!/bin/sh
/<insertpath>/a.out

告诉系统更新它的启动:

update-rc.d a.out defaults

最后您需要使您的应用程序可执行:

chmod ugo+x /etc/init.d/a.out