小编AJ *_* GS的帖子

如何在启动后使用busybox自动运行程序?

我正在使用带有 busybox 的嵌入式 Linux。我想自动运行名为“myApplication”的应用程序(启动后运行级别 5,所有服务均已启动)。

到目前为止我所做的:

  • 我在 /etc/init.d/ 下创建了一个名为 S90myscript 的脚本
  • 然后我将这一行添加到 inittab 中:

::sysinit:/etc/init.d/S90myscript

该脚本包含以下内容:

! /bin/sh
### BEGIN INIT INFO
# Provides: myApplication
# Should-Start: $all
# Required-Start: $remote_fs $network $local_fs
# Required-Stop: $remote_fs
# Default-Start: 5
# Default-Stop: 0 6
# Short-Description: start myprogram at boot time
### END INIT INFO
#

set -e

. /lib/lsb/init-functions
PATH=/root:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin
PROGRAMNAME="myApplication"
case "$1" in
start)
$PROGRAMNAME
;;
stop)
skill $PROGRAMNAME
;;
esac
exit 0
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?符号链接?难道是我做错了什么?

先感谢您

startup busybox buildroot autostart

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

autostart ×1

buildroot ×1

busybox ×1

startup ×1