From: Jason C. <jas...@gm...> - 2013-11-01 18:10:50
|
Yocto uses upstart. Upstart calls the SysV style /etc/init.d scripts last, it does this only for compatibility with SysV. You can create an upstart script in /etc/init instead. You will have more control over when it happens in the boot process, as well as the ability to have the script be triggered as soon as prerequisite tasks (e.g. wifi brought up) are complete. Look at the scripts in /etc/init for examples, full Upstart documentation (there is a lot of it, it is not as bad as it looks) is at http://upstart.ubuntu.com/cookbook/. Your existing shell script can be placed in an upstart .conf file mostly unaltered (or you can just exec it from there). On Fri, Nov 1, 2013 at 1:45 PM, beaker <pe...@ya...> wrote: > I've been though several threads on this forum trying to find a definitive > up > to-date way of launching a program as root after Linux has finsihed booting > without logging in. In my case my program (in /home/root) is a long'ish > shell script which initializes WiFi using wpa_supplicant.conf, outputs a > splash screen to an SPI OLED display, reads some GPIO buttons, calls > media-ctl and yavta, and then calls some other code I've written to analyze > the grabbed image. I want to use my Yocto rootfs 3.5 kernel Gumstix-based > system as a headless device without (ideally) a serial port root console > permanently attached to it. > > I've tried adding an executable script to my /etc/init.d/ directory along > the lines of: > #!/bin/sh > /home/root/myscript & > > and then putting a symlink to this in /etc/rc5.d/ > > However, this only seems to partially work as I can see the WiFi > initialization being called (it looks as if it is happening before the > libertas_sdio driver finishes loading) and then I get no other output > despite having numerous echo calls in my script. I did try 'update-rc.d > myscript defaults' and that seems to create a low-numbered (i.e. > S20myscript) symlink in almost all of the rc?.d directories which is not > what I want as I just want the script to run after everything has finished > loading so I only need a one call in rc5.d. > > I'm trying to figure out if the SysV init approach is the right/best route > or whether I should be looking at systemd instead which the rootfs calls at > startup. If systemd is the way to go, then exactly what do I need to do to > implement a solution that way? If SysV is ok, then does the script need to > have start/stop/restart functions? > > I also came across a thread about AutoLogin but that referred to > /etc/inittab and /etc/rc.local neither of which appear to be in my /etc > directory. > > > > -- > View this message in context: > http://gumstix.8.x6.nabble.com/Overo-Yocto-running-a-program-automatically-after-Linux-has-finished-booting-tp4968205.html > Sent from the Gumstix mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Android is increasing in popularity, but the open development platform that > developers love is also attractive to malware creators. Download this white > paper to learn more about secure code signing practices that can help keep > Android apps secure. > http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |