How to autostart application

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to autostart application

ソリューションへジャンプ
3,560件の閲覧回数
patsandt
Contributor III

I'd like to autostart my application on boot. (This seems like something others would have done.) I'm using a board derived from the Sabre board with iMX6. I'm running Linux. Searches online have yielded suggestions based on inittab (does not exist), init.d, rc.d, etc. I've added a script to init.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d, rc6.d, and rcS.d. None of these result in running the script.

I can run the script manually after logging in, but the goal is to avoid logging in. That is, the device I'm writing for has no GUI at all.

Any hints are appreciated. I normally run from TeraTerm running the console.

タグ(2)
0 件の賞賛
返信
1 解決策
2,330件の閲覧回数
b36401
NXP Employee
NXP Employee

Actually adding the script into rcX.d is a good idea.

First please check which runlevel your system is actually running:

# runlevel
N 3
#

And then you can add your script into this exact runlevel.
Its name should starts with "S" that means "start".
The "S" should be followed with 2 digits, this number is used for start seqence - S01* starts prior to S02*, and so on to S99*.
Also please make sure that it is canonical shell script with something like "#!/bin/sh" in first line and has good permissions (755 for example).
Then the script will be executed with system start up with "start" parameter.
However please note that process environment incomplete. It has no $PATH, etc.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
2,330件の閲覧回数
patsandt
Contributor III

I did have some convoluted FILES_${PN} instances that were interfering with each other. By correcting these and changing the names, I now have the script running on startup.

0 件の賞賛
返信
2,331件の閲覧回数
b36401
NXP Employee
NXP Employee

Actually adding the script into rcX.d is a good idea.

First please check which runlevel your system is actually running:

# runlevel
N 3
#

And then you can add your script into this exact runlevel.
Its name should starts with "S" that means "start".
The "S" should be followed with 2 digits, this number is used for start seqence - S01* starts prior to S02*, and so on to S99*.
Also please make sure that it is canonical shell script with something like "#!/bin/sh" in first line and has good permissions (755 for example).
Then the script will be executed with system start up with "start" parameter.
However please note that process environment incomplete. It has no $PATH, etc.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
2,330件の閲覧回数
patsandt
Contributor III

That was useful information and I've changed the names to reflect that

information. I realized that to avoid "installed but not shipped" errors in

the past, I had installed to /home/root rather than system directories.

This technique does not work for these scripts.

I've edited bitbake.conf to add "$/*" to the FILES_$ list,

but continue to get the same QA issues.

I would like to know what to change to create these files in the installed

image before reaching the login prompt. Any clues?

0 件の賞賛
返信