Start up scripts not working


#1

We are having trouble with getting start up scripts to work on our Yocto build and require help from a skilled forum i.e. you.

The Yocto system uses the sysvinit to boot scripts at startup, but the ones we put into place do not seem to get run.

We have made a script that we would like to have executed at startup (and preferably if the script crashes as well). It has been placed in the /etc/init.d folder with permissions 0755. Group and user is the same as all the others in that folder root and root. We have tried registrering it with update-rc.d placing it in runlevels S,2,3,4,5 as symbolic links with the right format SXXname. The script we used has the start, stop, restart and usage (*) properties, but still does not fire.

We have even tried copying the qmuxd script in the init.d folder and removed everything that was not an echo within each command (start, stop, restart, usage) and changed the text so that it would be easily recognizable and still it does not fire. We even tried adding cronie to the build through recipes and this was not fired during startup either (didn’t have S level on that though, but still).

All the scripts work when I do them manually.

There are apparently no difference in rights, group or user. The shebang is the same (#! /bin/sh) so it is all very strange.

Any help would be greatly appreciated as we are running out of time fast.

Thank you.


#2

Hi TBj,
we can’t do it manually directly on the target (actually we can add the script manually on the target in the user1/MTD4 partition,
but it will not be taken account during the bootup), so it needs to do it through Yocto by a regeneration of the rootFS.
The reason why we can’t do it manually on the target is that the startup executes scripts from read-only file system (MTD2 partition),
skipping the changes performed manually on the target (on the MTD4 partition).

It can be done in 2 ways:

  1. Via INITSCRIPT_PARAMS in yocto recipe:

You would need to specify run level for InIT script in INITSCRIPT_PARAMS at your yocto “recipe” ,as in our case it is rcS.

INITSCRIPT_NAME = "Your_startup_script"
INITSCRIPT_PARAMS = “start 90 S . stop 60 S .” //90 is secquence level for script and 60 is stop sequence

Init_1.4.11 for refrence

  1. Via update-rc.d
    Have shared sample recipe (initscripts) for it.

Regards,
Hassan

init_1.4.11.txt (567 Bytes)

initscripts.7z (750 Bytes)


#3

Hi Hassan,

Thank you very much! I will give it a try when I can.

Regards,
Thomas