I am using BusyBox, however I think my question is generic. This is an example of what one of the tty lines looks like in my inittab file.
tty1::respawn:/sbin/getty -n -l /usr/bin/loginwrapper 38400 tty1
I want to know if there is a way to detect that the getty process has respawned.
So for example in my profile script I want to be able to run a command only the very first time getty spawns.
Thanks!
I would create a wrapper script which you can place there into your inittab, replacing the actual
gettycommand.In that script you can do your jobs and at the end you can start the
getty.So instead of the original inittab line you’ll get something like this:
And in that script:
Update
If you have ramdisk, you can create a file on that and check its existence as a flag.