1

Login prompt on serial or any network is comes from which init script? My Embedded system is running with Linux 2.36 and default file system of ti814x.

In my scenario, I want to verify /etc/passwd and /etc/shadow file for corruption before login prompt because after firmware upgrade operation many times files found as corrupted and so we need to do nand scrubing which consumes our lot's of time.

1 Answer 1

1

Most *nix systems use init and some form of getty to present a login prompt. Have a look at /etc/inittab, which will contain something like this for your serial port:

T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

For your purposes the important bit is the 23: this indicates that a login prompt will be presented on /dev/ttyS0 at runlevels 2 and 3. The default runlevel of your system will also be in /etc/inittab and look like

id:2:initdefault:

If your default runlevel is 2, then make sure your script runs for this runlevel. On non-systemd distros this involves arranging for a symlink to the script in /etc/rc2.d. Different distros manage this in different ways, and you don't say which you're using, but Debian-based systems use LSB headers and update-rc.d to manage the symlinks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .